A cache system consists of four major elements:
- Cache structure
- Permanent storage
- Local cache buffers
- Local cache vector
Figure 1 shows the four elements and their relationship
to each other.
Figure 1. Elements of a Cache
System
Each piece of shared data, referred to as a “data item”
throughout this topic
"Using Cache Services (IXLCACHE)", can be stored in different
locations within the cache system. Copies of shared data items are
stored in the local cache buffers (fastest access) belonging to each
cache user. The shared data also resides either in the cache structure
on the coupling facility (next fastest access), on permanent storage
(slower access to the data than from either the local cache or cache
structure) or both the cache structure and permanent storage. In general,
how quickly you can access the data depends on where it is stored.
A description of each element of a cache system follows:
- Local cache buffers — Local cache
buffers are storage buffers that users allocate in their own storage
area. They contain copies of data that is shared among cache users.
Users read data from permanent storage or from the cache structure
to their local cache buffers, and write data from their local cache
buffers to permanent storage, to the cache structure, or to both locations.
Each user who accesses the cache structure must have a set of local
cache buffers to accommodate the data items to be shared.
- The cache structure — The cache structure
is a structure in the coupling facility that contains:
- A directory to keep track of named data items that are shared
among cache users
- Optionally, data entries that hold data items
Users who are connected to the cache structure can use cache
services to access and manage shared data.
- Permanent storage — Permanent storage
is storage that is the final
repository for the data that users share, and might be on a direct
access storage device (DASD). Users can read the data from permanent
storage to local storage buffers for their use, and then either write
the data to the cache structure and maintain the data there, or maintain
the data in the local buffers and use the “directory-only”
caching method to track the validity of the data. After users make
updates to the locally-cached data, they are responsible for ensuring
that the changes are made to the permanent storage copy of the data.
They make these changes to permanent storage either immediately after
the update or at a later time, depending on the cache protocol.
- Local cache vector — The local
cache vector is a user-defined vector that provides a way for cache
users to determine the validity of data in their local cache buffers.
There is one local cache vector per user of the cache. Each vector
is divided into separate entries with each entry corresponding to
a local cache buffer. Each vector entry contains an indicator that
the system sets to indicate whether the data in the corresponding
local cache buffer is valid. Users must test the indicator to determine
the validity of the data in their local cache buffers.
Because
the local cache vector is in system storage and not directly addressable
by the user, the system provides the IXLVECTR service. IXLVECTR allows
the user to test the entries in the vector to determine whether the
corresponding local cache buffer is valid, and to dynamically change
the number of entries in the vector.