O'Reilly logo

Building Scalable and High-Performance Java™ Web Applications Using J2EE™ Technology by Greg Barish

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required