Image copyright Alan Brandt

A mill town with high unemployment has seen its fortunes changed by Facebook's need for data servers. But will the town have to radically change to save itself?

The people of Prineville live deep in a valley surrounded by dense forests. In the 1800s, it was the first place in central Oregon where white settlers drove out Native Americans to start a city.

Steve Forrester's grandparents got here in 1902. When he was growing up in the 1970s, Prineville felt idyllic.

"It was a magical, magical place to grow up," he remembers.

"My dad worked in the sawmill industry as an electrician; my mom didn't work. We all learned to hunt and shoot a gun.

"We all learned how to drive in the forest before we were 16. In the spring, we could snow-ski in the morning and water-ski in the afternoon.

"And everybody had a job, and everyone did well."

Prineville was the largest producer of ponderosa pine in the world. But when the federal government restricted logging and increased protections for animals like the spotted owl, the city's milling industry was decimated.

As an adult, Forrester took a job with one of the few remaining mills, because he wanted to live in Prineville.

Eric Klann was driven by the same devotion. He's the seventh generation of his family to live here. Out of college, he also took a job in Prineville that he knew wouldn't last.

"There was always a little voice in the back of my head saying, 'What are you doing - you want to be here, but you're in a dying industry,'" he says.

A few years later, the US housing bubble burst and demand declined for parts made by the last mills. Lots of people lost jobs and left. It felt like Prineville couldn't catch a break.

Image copyright Alan Brandt Image caption One of Prineville's new kind of "factory" - a data server farm

Both Forrester and Klann felt lucky to land jobs at the city - Forrester as city manager, Klann as city engineer. Their chance to save Prineville arrived in 2009 in the form of a mysterious email from a company called Vitesse.

"For the longest time, we had no idea what Vitesse meant," he says.

All Klann knew is that Prineville's natural resources made it perfect for a new industry - the information industry, created to save the massive amounts of information people post on the web.

Vitesse wanted to build a big warehouse and fill it with rows and rows of servers - servers that tend to get hot. Central Oregon's cold nights could cool them naturally.

Klann remembers the first in-person meeting with Vitesse, and how it felt like Prineville's last chance.

"Right before I walked into our conference room to meet with their nine lawyers, I got an email and our unemployment rate had peaked at 23%," Klann says. "I got that email and I walked into that room, and I kept thinking, 'I better not screw this up.'"

Klann and Forrester decided to outperform the other cities Vitesse was considering. They showed the company their small town could move at big-city speed, by responding to Vitesse's questions day and night.

"What we heard back is that other cities weren't doing that," Forrester says.

Their strategy worked, and in 2010, Prineville finally learned who Vitesse actually was.

"They had the big finger with a thumb-up Facebook sign, and we all pressed the button and it lit up, et cetera," Mayor Betty Roppe says, recounting the new data centre's groundbreaking.

"That was the big announcement - it was Facebook."

It was Facebook's first data centre of its own. Mark Zuckerberg was there, and Roppe had planned to give him a cowboy hat to show the city's pride in its cowboy culture.

"Cowboy hats are not cheap. They said, 'Do not get Mark Zuckerberg a cowboy hat. He does not want a cowboy hat.' OK. So, I got him a hoodie. He wears hoodies all the time," she says.

When she presented the gift, Roppe gave Facebook's founder a kiss on the cheek. "He just blushed like he wanted to have the floor open up and swallow him."

Image copyright Rupa Shenoy Image caption Mayor Betty Roppe oversaw Prineville's transformation after data centres were built in the city

Seven years later, Facebook has two more data centres in Prineville and six others across the world. Apple's moved into Prineville, too - it's built three data centres here. All of them sit high above Prineville's valley, in huge, long, flat buildings painted pale blue and grey so they blend in with the sky.

About 500 employees work in the centres, most of them from Prineville. Security's tight, so few other people ever see inside. Despite their low profile, the data centres have had a profound impact.

Roppe says the mills taught Prineville a lesson - not to rely on just one industry. So they're putting in things that appeal to lots of employers - like good roads, walking and biking paths, modern wastewater treatment, a new hospital and a state college outpost.

But now that the city's successful, officials have a lot more to think about. Like, how do you slow success down?

"We can keep the small-town feel. I'm sure of it," Roppe says. "We don't want to be a big city."

The cost of housing is up, so city officials know they have to build more affordable housing. And Mayor Roppe's own granddaughter, with a college degree, can't find a living wage job. So, they have to keep bringing in new employers.

All city manager Forrester can do is calibrate the development carefully. He worries about Prineville changing too much, too.

"We are small-town people. We live the Western lifestyle," Forrester says. "The quiet and peace of central Oregon is a beautiful, beautiful thing, and to be able to make a living here is tremendous."

But Forrester says he's seen that central Oregon towns that don't adapt will die.

And he knows they have to risk changing Prineville in order to save it.

The World is a co-production of the BBC World Service, PRI and WGBH. This piece is part of the series 50 States: America's place in a shrinking world.