Caching and Replication

A cache is a structure that contains a copy of information that originates at some source. Generally speaking, a cache consists of a table of key/value pairs. For each pair, a key represents a question and the corresponding value represents an answer.

Table 4-1. Sample California City/County Cache
City County
Pleasanton Alameda
Santa Clara Santa Clara
Livermore Alameda
Palo Alto Santa Clara
Marina del Rey Los Angeles
Garden Grove Orange

For example, to look up the California county that contains the city of Marina del Rey, we ask a question—What county is Marina del Rey located in?—and obtain an answer—Los Angeles. Table 4-1 shows this information in a sample cache of cities and counties.

The keys and values in a cache ...

Get Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.