Sean MacDonald's shift as a Palo Alto fire captain starts at 8 a.m. By 4 a.m. he's out the door and on the road. It's 147 miles from his home in Roseville — northeast of Sacramento — to the fire station. Leave any later, and he risks getting stuck in traffic.

“The drive stinks, no easy way about it,” he said, but “that's the price you pay to have a job in the Bay Area and raise a family.”

Facing sky-high housing costs in the city they serve, long commutes have become the norm among MacDonald's fellow firefighters. “We've got guys living in Shingle Springs, Rocklin, Citrus Heights, Grass Valley,” he said, ticking off a dozen places over 100 miles from Palo Alto.

Some of the younger firefighters live closer to Palo Alto, but they share apartments to save on rent. And even then, MacDonald said, “what they're paying in rent is more than what I'm paying on a mortgage.”

“Housing prices here are so, so expensive,” agreed firefighter Matt Goglio, who makes a 105-mile journey from Oakdale, past Modesto. “We're basically being driven out of the area just due to the wages and the housing costs.”

It's not just firefighters who are being priced out by Silicon Valley's cost of living. As the Peninsula struggles to house a rapidly growing population, many people — especially the middle-class public servants and low-wage workers who keep the region running smoothly — have been moving away to more affordable places.

Yet since their jobs are still back on the Peninsula, these workers are spending more time behind the wheel — at least an hour each way for over 200,000 people.

Rising Rents

The booming tech economy has drawn more workers to Silicon Valley, but housing construction hasn't kept pace. Between 2010 and 2014, Santa Clara and San Mateo counties gained around 167,000 new jobs, but only added 22,000 additional housing units.

This imbalance between jobs and housing is even worse at the local level. The region's jobs tend to be clustered in affluent cities such as Palo Alto, Mountain View, and Santa Clara, which don't have nearly enough homes for their workforces.

“The amount of housing being built is so small compared to the growth in demand that it is causing the region to become much more unaffordable,” said Dave Vautin, a planner for the regional Metropolitan Transportation Commission.

With more people jockeying for a home near work, rents have climbed across the Peninsula — especially in the cities with the worst worker-to-housing imbalances:

Zillow rent data are only available from Nov. 2010 onwards.

Moving Away

Priced out of these expensive mid-Peninsula cities, Silicon Valley workers have been moving to places with more affordable living costs. Within Santa Clara and San Mateo counties, the population grew faster between 2010 and 2014 in areas with lower median rents and household incomes:

Income Rent To enable comparisons with inbound commuting data, population is the number of commuting workers who lived in a Census-designated place.

Growth is measured between 2010 and 2014.

Down at the south end of Santa Clara county, for example, Gilroy — where the median household income was $81,056 — grew 10 percent over that time period. In Menlo Park, where the average household made $115,650, the population dropped by about 100 people.

Many workers are moving even further out, to the East Bay or beyond, noted Matt Regan, a regional planning expert at the business-backed Bay Area Council.

“You only have to drive on (Interstate) 580 at 4:30 in the morning and just look at the headlights coming over the Altamont Pass,” he said, “to know that that's where we're building our affordable housing, on the other side of the hill.”

Disparate Commutes

This growth in places far from core Peninsula cities has driven up commute times, since more workers are traveling longer distances on increasingly congested roads. Between 2010 and 2014, the proportion of workers who spent an hour or more getting to their jobs jumped from 10 to nearly 15 percent.

Vautin noted that there's an important income disparity in those commute times. The highly paid technical and business services workers who live in Silicon Valley have relatively short commute times, since they typically work nearby. It's middle- and lower-income workers — teachers and firefighters, security guards at tech campuses, waiters at restaurants — who have been priced out of the Peninsula and are spending much more time in traffic:

Mean Commute Time 60+ Minute Commutes

At the local level, the disparity is even more apparent. Expensive job centers such as Mountain View and Menlo Park have the highest proportion of workers who travel for an hour or more, yet have some of the lowest shares of residents with long commutes:

Workers Residents All numbers are for 2014.

“If you can afford to live in Silicon Valley, you're actually in pretty good shape when it comes to commuting,” said Vautin. “It's the folks who can't afford it and thus have to live really far away that are suffering.”

Stemming the Sprawl

Policy experts argue that the key to bringing commute times under control is to address the underlying housing shortage. By building higher-density apartment buildings and townhouses near worksites and along public transit corridors, planners hope to house more workers on the Peninsula and reduce the need to commute from outlying areas.

That kind of dense housing can be a hard sell in suburban Silicon Valley, where residents often fight new construction they fear will worsen traffic and change the character of their communities.

“As soon as a project proponent arrives at City Hall with a multi-family development idea, the pitchforks are sharpened and the flaming torches are lit,” said Regan. Because of such opposition, many attempts to build new housing have been scaled down or abandoned altogether.

Still, there are signs the worsening housing crunch is making residents more amenable to growth. Voters in Mountain View elected a pro-housing majority to the city council in 2014, community groups in several Peninsula cities are organizing to support new development, and Redwood City is building a cluster of tall new office and apartment buildings near its downtown Caltrain station.

Ultimately, how much Silicon Valley cities are willing to grow will affect everything from the region's carbon footprint, to whether it can retain teachers, to whether firefighters like Goglio will be around in a disaster.

“The Bay Area traditionally has not been the fastest growing region in the state,” said Vautin, and so it has been ill-prepared for the influx of new arrivals. “This is the critical issue of the decade here.”

CORRECTION (4/6/16): This post has been updated to correctly identify firefighters Sean MacDonald and Matt Goglio.