There is an entire world of commuter residences all around San Francisco, and people figured out how to commute to San Francisco long before the tech boom (and most people wanting to live in the city) existed. Dublin/Pleasanton is the extreme, but there's also Castro Valley on my same line, a whole shitload of Oakland like Lake Merritt, and if you take the Pittsburg/Bay Point a whole bunch up there, too. Take off the San Francisco blinders and take advantage of the commute options that were built long before this industry.
It feels like people moving to San Francisco now treat it like New York City, where living in New Jersey and commuting in tends to suck. So most people focus on the boroughs, and landlords take advantage of them. San Francisco's out-of-town situation is far better, and I don't regret choosing a place an hour out of town at all.