When Mark Zuckerberg left Harvard in the summer of 2004, he didn’t move his fledgling company to the mountains, or the Gulf of Mexico, or San Francisco, he moved to Silicon Valley. Well, Palo Alto to be precise. In an interview with Y Combinator partner Jessica Livingston last year, he said of his impression of Silicon Valley, “You get this feeling that you need to be out here.” Many founders are familiar with this magnetic force. It’s the reason that Silicon Valley has been a mecca for technology companies and startups over the last several decades.

Of course, Facebook left the East Coast eight years ago, and a lot has changed in the meantime. In the same interview, Zuckerberg admits that he probably wouldn’t choose Silicon Valley as the base of operations for Facebook if he had it to do all over again. Sure, the money is still in the Valley, but as Startup Genome has shown, entrepreneurs aren’t feeling the same pressure to move to Silicon Valley as they once did. Tech hubs are shifting to urban centers across the country, and as the Valley loses some of its momentum, it seems that its neighbor is moving swiftly to pick up the slack.

The economy has been sickly over the last few years, but the tech industry has remained one of the few bright spots. The national employment rate has has dropped now that the worst of the recession is over, but it still sits way above the historical average at 8.1 percent.

The Bay Area, in contrast, has been having better luck thanks to a booming tech industry. April saw all nine counties in the Bay Area register ~1 percent decreases in unemployment over the previous year, with San Francisco, Marin, and San Mateo counties all coming in below the national average (SF County being the highest at 7.4 percent).

Historically, the availability of office space and comparatively lax tax laws have led to a higher concentration of tech jobs in the Valley. This is still appealing enough to convince many startups to pick up and move, but if you look at these numbers, San Francisco is now looking favorable compared to its southern neighbor.

In fact, as The Wall Street Journal describes at length, the City By The Bay is catching up and catching up fast. There are now over 94,000 people employed in tech in San Francisco, an increase of 10 percent from the year prior, compared to 211K in San Jose’s metro area. San Jose and its counties lead the way, but their growth was far smaller — 3 percent — than that of San Francisco.

Twitter and Airbnb recently signed major contracts to keep their businesses in San Francisco, and they’re not alone. Some of that credit goes to the city’s mayor, Ed Lee, who, like Mayor Bloomberg in New York City, has been on a mission to bring tech jobs to San Francisco and keep the city on the cutting edge. He launched the TechSF Initiative earlier this year with a $5 million federal grant to help “reskill” the city’s residents for high tech jobs, for example.

And, through somewhat controversial changes, has helped convince companies like Twitter to keep their operations in the city — which is also partially reflected in Facebook’s decision to move to Menlo Park from Palo Alto last year. (Menlo Park is considered part of the SF metro area.)

What’s more, Pinterest is rumored to be looking for a new home in San Francisco, and Benchmark Capital partner Peter Fenton recently penned a post for TechCrunch about the firm’s decision to open new offices in San Francisco. This thanks to the “new spirit of entrepreneurship in the city:”

Our move to the city speaks to a change in the entrepreneurial landscape. Two out of every three new investments we have made since 2009 have been in San Francisco. Our partners currently sit on more than 20 boards in San Francisco including Twitter, Yelp, Instagram, Uber, NewRelic, Zendesk, Dotcloud, Asana, OpenTable, DemandForce, NextDoor, ServiceSource, Lithium, Marin Software, 1Life, Second Life, Coverity, EngineYard, Couchsurfing, Grockit and Pipewise.

Fenton also touches on a few other big issues in the rise of San Francisco’s new attraction as a destination for tech companies and startups, including this new government policy and focus on innovation, a microcosmic reflection of the growing national trend of re-urbanization as workers move back to cities to live and raise families, as well as a growing depth of the talent pool in SF.

The tech industry has become sexy, business is booming, and companies across San Francisco and Silicon Valley are hiring. Facebook’s petition to expand its new campus in Menlo Park was recently approved, which could see the company add as many as 3K new employees — and thousands more if it decides to expand to the campus across the street. Salesforce, too, is significantly impacting the talent and commercial real estate ecosystems in San Francisco, as it surpasses 1 million square feet and could grow to as many as 9,000 employees over the next year.

Of course, while this is all well and good and we celebrate the success of the tech industry, the influx of startups and companies to San Francisco has negative consequences, too. (And it’s not just for San Francisco.) The growing labor force and talent pool is good for the economy, but it comes with a price: Competition.

While that sounds great for the Young Capitalists, the cost of acquiring talent and, worse, office space, is skyrocketing in Silicon Valley and San Francisco. It’s pretty ridiculous, actually. Justin Bedecarre, a young real estate broker who created the first War For Talent conference in San Francisco earlier this summer, tells us that “Twitter alone has driven rental rates in San Francisco’s Mid-Market district up by as much as 50 percent, buoyed by the fact that companies like One Kings Lane, Yammer, Zendesk and Zoosk have all moved their headquarters into area” as a result of Twitter’s presence and those aforementioned tax breaks granted to the region by the city.

This cost doesn’t bat many eyelashes at those companies that are fortunate to have millions in revenue or venture capital, but it’s a killer for the little guys. Most early-stage companies can’t compete with these companies in terms of salary, so they’re having to find new, creative ways to attract young talent. [Read more on this here.] Again, not necessarily a bad thing, but when you add high rent on top of that, it’s no wonder so many companies are scrambling for big early funding.

With the help of Greylock, Riviera Partners, and his firm, Cushman & Wakefield, Bedecarre and team put together an infographic that addresses many of the factors companies consider when deciding where they should locate in the Bay Area, and, importantly, offering a little comparative analysis of office space in these cities.

As you can see below, in downtown Palo Alto, the cost of work space is $5.78 per square foot/month, $4.81 in Stanford Park, and $5.21 in Menlo Park — and compared to the cost of rent in these towns, the average vacancy is tiny. Looking at this data, it’s really no wonder that startups are considering decamping to San Francisco, where the average cost of space is more attractive at $3.55 per square foot/month and the availability is more favorable at 11.4 percent. San Mateo, just south of SF, also looks more appealing at $2.41/month and 14.1 percent availability.

Another point of interest for startups and technical talent is that, according to Riviera’s numbers at least, nearly 60 percent of engineering placements are in San Francisco, and the average employee compensation is $112K. It’s still below the average compensation for Silicon Valley ($118K), but the gap is shrinking.

“Startups make real estate decisions based on recruiting and retaining top talent, sense of community, proximity to amenities and public transportation and access to investors and advisors,” Bedecarre says. “That is why San Francisco’s SOMA district and downtown Palo Alto are two of the most competitive markets in the country. Due to San Francisco’s size and centralized location to all Bay Area talent (South Bay, East Bay and North Bay), SOMA is the fastest growing.”

The City of San Francisco has been eager to encourage tech companies to set up shop in its urban center, and, so far, it’s been working. Yet, as tech workers move to SF, office space isn’t the only place where you’ll feel the squeeze. Housing is increasing in cost, too. And that’s in a city where the cost of living was already high.

Traditionally, San Franciscans have been willing to pay the difference for the opportunities it affords them. However, the New York Times pointed out in a recent article that RealFacts has seen the average rent of 50 buildings it’s tracking in SF grow to $2,663/month. That’s a record high.

The tech industry loves what Mayor Lee and the city are doing to encourage innovation and technology businesses at home, while others look at this snuggling-up a bit more skeptically. As non-tech-working San Franciscans see the cost of their office space and housing increase, they may not be so eager to look smile and nod.

For now, the city loves it, and it’s hard to think that it’s not good for everyone involved as we watch San Francisco begin rivaling Silicon Valley as a center for tech talent and innovation. “Talent is shifting to urban areas like San Francisco as companies like Twitter, Salesforce, Zynga and Airbnb choose to locate their headquarters there,” said veteran tech investor Ron Conway. Although, perhaps more importantly, we should be celebrating the efforts of cities outside the Bay Area to build thriving urban startup ecosystems. (More here.)

Startups have a lot to consider when deciding where to establish home base, and San Francisco is doing its part to make that decision easier (or more difficult, depending on where you stand), so check out the infographic below for more.

[If you’re having trouble viewing the infog, click on it and hold, and drag it into the URL bar at the top of the browser. Works for Chrome, Firefox.]