1. Basic architecture of Microsoft. Practices. enterpriselibrary. caching
Before deciding where to save the cache data, we need to first understand the two cache types defined by the caching Application Block,
They are memory-resident caches and disk-resident caches. As the name suggests, these two types of caches are named by storage locations,
In terms of function, the difference is based on whether the cached data can be persisted.
In the caching Application Block, the following four methods are provided to save cache data: memory storage (default)
, Independent storage (isolated storage), database cache storage, and custom storage (custom cache storage ).
1. Memory storage: the memory storage cache is the only memory resident cache in the above four methods. It is also the most common way in our development,
The advantage of fast response speed is unmatched by other methods. However, if you use this method alone, the following drawbacks may occur:
1. cache data cannot be persistent. After the server restarts, All cached data will be lost.
2. If the server uses the memory cache when using Server Load balancer, ensure that the memory cache status of multiple servers is synchronized,
However, this will put a lot of pressure on Io and cause system bottlenecks. Therefore, from the perspective of system performance and development costs, it is not easy to use memory cache in a server Load balancer environment.
2. Independent cache (isolated storage): isolated storage is an option for caching data persistence,
It is a disk resident cache. If you are careful enough, you will find an isolatedstorage folder on each machine;
With independent caching, our cache information will be saved in this folder in the form of binary files,
The following is the directory where the cache information generated after the cache data is used:
C: \ Documents ents and Settings \ Administrator \ Local Settings \ Application Data \ isolatedstorage
3. Custom Storage.
4. database cache storage: see
Http://www.cnblogs.com/artech/archive/2008/08/11/1265055.html