Cost of living is always important to consider. Looking at this site[0] for a ballpark figure, it would seem that someone living in San Francisco needs to be earning at least the double of someone in Berlin, to afford the same standard of living. San Francisco is still a very attractive place to work as a Software Engineer, but it's not as black and white, as the huge difference in pay might make it look.
[0] https://www.numbeo.com/cost-of-living/compare_cities.jsp?cou...