When and How Does the Database Slow Down a Site?
I have read a book by O'Reilly that states that 70-80% of the performance of a site can be optimized via the front-end. That may mean that database queries may account to less than 20 or 30% of a site's performance. However, I have seen huge websites like Facebook and Twitter dedicate so much time to optimizing queries (via query caching, normalizations, etc). When does the database become so critical for a site's performance that it can account to more than the aforementioned percentage? Oh, and by performance I mean in the context开发者_运维百科 of speed, loading speed in particular.
Don't trust such figures to be so accurate. The role of the DB in each website varies: in some web sites there's no RDBMS, and in others it's all about queries and the DB dictates the entire performance of the system. In other words, such statistics are meaningless to you for any practical purpose. You need to analyze your system's particular performance by profiling it (measuring performance) and finding out exactly how much time/resources the DB part takes.
When does the database become so critical for a site's performance that it can account to more than the aforementioned percentage?
After you have already optimized the front-end to the max, the relative impact of the back-end will become much larger.
Also, very big sites face the problem of scalability. They might be able to serve a single user very fast, but as the load grows, it gets slower for everyone. The client-side part is spread across the users' machines, so scales very well. But the back-end is shared by everyone, and will become the bottleneck.
精彩评论