Hacker News new | ask | show | jobs
by shawnreilly 4639 days ago
No problem, glad I could help. I don't have a Blog to refer to, but I can give you a simplified example.

Imagine you are loading a Page with 20 Images out of the Database. The "slower" approach would be to query the Database for each Image individually, which means 20 queries to load 20 images. The "faster" approach would be to query the Database for all 20 images at once, which means 1 query to load 20 images.

Optimizing the Database end of a Dynamic Website (or Service/App) could be considered a specialty in itself, and it can get pretty complex; Indexing, Caching, even designing the Database Structure and Code a special way. I put the terms slower and faster in quotes because everything is relative, and your mileage may vary. If you are using a framework (like Wordpress for example), then it's possible that someone already put some thought into optimizing the calls.

The first step is to measure and determine where the bottlenecks are. You may find out that you don't even need to worry about the Database (depending on your performance measurements). To get started, check out Google Chrome’s Developer Tools (Resource Analysis), or WebPageTest.org (just some examples of tools you can use). Good Luck!