TL;DR
This paper introduces Ferdinand, a novel cooperative proxy-based caching system designed to scale web applications by offloading database load. Ferdinand achieves high cache hit rates through distributed caching and ensures consistency with a scalable publish/subscribe mechanism, significantly outperforming existing approaches.
What Problem Does This Paper Address?
Web applications often face performance bottlenecks at their backend database, especially when experiencing sudden spikes in user traffic. While Content Delivery Networks (CDNs) effectively handle static content, dynamic content, which is generated in real-time based on user requests and database queries, remains a challenge. Traditional solutions like database replication struggle with the latency requirements of global infrastructures, and existing proxy-based caching systems often suffer from inefficient cache consistency management, leading to poor performance under high update loads. This paper tackles the problem of scaling dynamic web applications by efficiently caching database query results across multiple proxy servers while maintaining data consistency.
Methods
Ferdinand employs a cooperative proxy architecture where multiple proxy servers work together to serve database queries. Key to its design are:
- Distributed Query Result Caching: Each proxy server maintains a local cache of query results. If a query misses in a local cache, it's forwarded to a "master" proxy server for that query within a Distributed Hash Table (DHT) overlay. This cooperative approach aims to increase the overall cache hit rate by leveraging results cached by other proxies.
- Publish/Subscribe for Consistency: Cache consistency is managed using a scalable, topic-based publish/subscribe system. When the backend database is updated, notifications are published to specific topics. Proxy servers subscribe to these topics to invalidate their cached query results.
- Offline Analysis for QUMA: A crucial component is the Query/Update Multicast Association (QUMA) problem: mapping database queries and updates to appropriate publish/subscribe topics for efficient consistency management. The authors propose an offline analysis technique that inspects web application templates to understand data dependencies between queries and updates. This analysis helps create efficient topic subscriptions and publications, minimizing unnecessary notifications.
- Hierarchical Consistency: To handle potential ordering issues in publish/subscribe systems, Ferdinand uses a two-tiered approach with "master" and "non-master" multicast groups. Updates are first published to master groups, and then re-published to non-master groups, ensuring that affected caches are invalidated correctly.
Datasets
The authors evaluated Ferdinand using standard web application benchmarks:
- TPC-W bookstore: A simulation of online bookstore activity, with a modified Zipf distribution for book popularity to better reflect real-world usage.
- RUBiS auction: A benchmark simulating an online auction system.
- RUBBOS bulletin board: A benchmark for a discussion forum.
These benchmarks were configured with realistic data sizes and user loads. The authors note that they manually generated the QUMA solution for these benchmarks but believe it can be automated.
Key Insights and Ideas
- Cooperative Caching is Key: The paper strongly suggests that simply caching at individual proxies (like SIMPLECACHE) is insufficient. The ability to share cached results across proxies (Ferdinand's cooperative approach) is critical for achieving significant scalability improvements.
- Consistency is a Bottleneck: The authors demonstrate that inefficient cache consistency management can be a major performance bottleneck, even with effective caching strategies. Their publish/subscribe approach, coupled with offline analysis, proves more scalable than simpler broadcast methods.
- Offline Analysis Pays Off: The QUMA problem is non-trivial. The insight that analyzing application templates offline can drastically improve the efficiency and accuracy of consistency management is a core contribution. This allows for fine-grained topic subscriptions and publications.
- DHTs and Pub/Sub are a Good Fit: The paper validates the use of DHT overlays for distributed caching and publish/subscribe for decentralized consistency management in this context.
Key Results
- Significant Throughput Gains: Ferdinand achieved up to a 13.4x scale-up on the TPC-W browsing mix compared to a non-caching system (NOPROXY). It also outperformed SIMPLECACHE (a non-cooperative caching system) by 40% on the auction benchmark and 80% on the bulletin board benchmark.
- Improved Cache Hit Rates: Ferdinand consistently achieved substantially better cache hit rates than SIMPLECACHE across all workloads, indicating the effectiveness of its cooperative caching.
- Scalability with Latency: While Ferdinand's performance degraded in higher-latency environments (as expected for any distributed system), it still outperformed SIMPLECACHE in low-to-medium latency scenarios. The authors suggest that application designers could further optimize for high-latency environments.
- Publish/Subscribe Superiority: Ferdinand's publish/subscribe-based consistency management significantly outperformed a broadcast-based approach, especially for workloads with a higher proportion of updates.
Limitations and Future Work
- Multi-statement Transactions: Ferdinand, like most query caching systems, relaxes consistency for multi-statement transactions, making it unsuitable for scenarios requiring strict transactional consistency.
- High Latency Performance: While Ferdinand performs well, its performance can be more sensitive to network latency than simpler caching systems due to the multiple network hops involved in a cache miss.
- Automated QUMA Generation: The authors manually generated the QUMA solution for their benchmarks and acknowledge the need for automated tools to do this for arbitrary applications.
- Adaptive Caching: Ferdinand currently caches all query results, which can lead to caching unused data and increasing consistency overhead. Future work includes developing techniques to adaptively cache only relevant results.
- Failure Scenarios: While the use of standard DHT and pub/sub implementations suggests robustness, a formal evaluation of Ferdinand under various failure scenarios is noted as future work.
- Compiler Optimizations: The authors are exploring compiler techniques to automatically optimize applications for environments with introduced latency.
Summary updated