Databases Reference
In-Depth Information
• We have replaced MySQL with Redis when simple key-value pairs were being
stored at such a high rate that the replicas fell behind, even though the master could
handle the load just fine. Redis is also popular for queues, due to its nice support
for queue operations.
• Hadoop is the elephant in the room, pun intended. Hybrid MySQL/Hadoop de-
ployments are very common for processing large or semistructured datasets.
Summary
Optimization isn't just a database thing. As we suggested in Chapter 3 , the highest form
of optimization is both business-focused and user-focused. Full-stack performance
optimization is what's really needed to achieve this.
The first thing to do is measure, as always. Focus on profiling per-tier. Which tiers are
responsible for most of the response time? Concentrate there first. If the user's experi-
ence is impacted the most by DOM rendering in the browser, and MySQL contributes
only a tiny fraction of the total response time, then optimizing queries further can never
help the user experience appreciably. After you've measured, it's usually easy to un-
derstand where your efforts should be directed. We recommend reading both of Steve
Souders's books ( High Performance Web Sites and Even Faster Web Sites ) and the use
of New Relic.
You can often find big, easy wins in web server configuration and caching. There's a
stereotypical notion that “it's always a database problem,” but that just isn't true. The
other tiers in the application are no less important, and they're just as prone to being
misconfigured, although sometimes the effects are less obvious. Caches, in particular,
can help you deliver a lot of content at a much lower cost than you'd be able to do with
MySQL alone. And although Apache is still the world's most popular web server soft-
ware, it's not always the best tool for the job, so consider alternatives such as Nginx
when they make sense.
 
Search WWH ::




Custom Search