Chapter 7: Static Meets Dynamic Adding Caches to Reduce Costs
Two things should be clear by now. First, caching systems vary widely in their implementation, approach, and applicability. Second, on analysis you can determine which caching approach is right for a specific component to achieve dramatic improvements with respect to both performance and scalability.
In our original article page we witnessed three substantial database operations on every page. After implementing a variety of dynamic caching solutions we were able to achieve an acceptably high cache-hit rate (nearly 100%) and all but eliminate database queries from our pages. After users log in for the first time, their left navigation preferences are stored in their cookie, and it is unlikely that they will ever lose their cookie and require a database query to reset it. Articles data, which once required two queries to retrieve, are now compiled into a valid web page to be served directly by Apache, alleviating both database access and the dependency on an external caching mechanism.
Although the examples in this chapter are implemented in perl using the Apache::ASP embedding system, all the caching techniques presented can be implemented using almost any interpreted scripting language. The goal was to present concepts. Aside from the two-tier execution approach, all the concepts presented can be implemented in any language and in any architecture–even outside the Web.
The key to successful caching is understanding the true nature of your data: how frequently it is changed and where it is used.
|Non-Linux FOSS: Screenshotting for Fun and Profit!||Oct 20, 2016|
|Nasdaq Selects Drupal 8||Oct 19, 2016|
|Canonical Ltd.'s Ubuntu Core||Oct 19, 2016|
|Build Your Own Raspberry Pi Camera||Oct 18, 2016|
|Netlist, Inc.'s HybriDIMM Storage Class Memory||Oct 17, 2016|
|Secure Desktops with Qubes: Compartmentalization||Oct 13, 2016|
- Non-Linux FOSS: Screenshotting for Fun and Profit!
- Build Your Own Raspberry Pi Camera
- Nasdaq Selects Drupal 8
- Canonical Ltd.'s Ubuntu Core
- Secure Desktops with Qubes: Compartmentalization
- Linux Journal October 2016
- Netlist, Inc.'s HybriDIMM Storage Class Memory
- Polishing the wegrep Wrapper Script
- A New Mental Model for Computers and Networks
- The Peculiar Case of Email in the Cloud