As I'm sure you've seen, rents are sky-high right now. If you have some cash to put down, buying could be a very savvy investment right now. Not all loans require a 20% down payment. If you're a first time home buyer there are loans that require a lot less. Also, if your needs change in the future, you can always rent out your property. San Francisco is a great rental market from landlords. This has been my family's strategy for quite some time so I walk the talk, so to speak. These properties can be a great investment for your retirement plans as well to generate long-term cash flow.
I provide some great calculators on my website. Here's the one for mortgages:http://www.grobeckerco.com/home/listings/mortgage-calculator/
If you need assistance with finding decent neighborhoods and investments in SF I'm always happy to help. I'm a chartered retirement planning counselor and also a short sale/reo specialist.