Logical Model (Velocity)
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
The logical model of the cache cluster in Microsoft project code named "Velocity" consists of named caches, regions, and cached objects. In the following diagram, named caches span all the cache hosts in the cluster, but regions are limited to just one cache host in the cluster.
A named cache, also referred to as a cache, is a configurable unit of in-memory storage that all applications use to store data in the distributed cache. You can configure one or more named caches for each of your applications. Each cache can be configured independent of the others, which lets you to optimize the policies of each cache for your application.
As you saw in the previous diagram, each cache spans all cache hosts in the cluster. When "Velocity" is first installed, a cache comes pre-configured with the name "default." If you do not specify a particular cache name when performing cache operations, data is stored in this default cache.
All caches are defined in the cluster configuration. Use the PowerShell cache administration tool to create or reconfigure caches. Some settings can only be configured when you first create the cache. For example, you can only enable the high availability or notifications feature using the
New-Cache command. Other settings can be changed later, but may require the entire cache cluster to be restarted. For more information about the PowerShell cmdlets, see Cache Administration with PowerShell (Velocity).
Restarting your cache cluster causes all data to be flushed from all named caches in the cluster.
Regions are an additional data container that you can place in the cache. Regions are a cache construct: they are not defined in the cluster configuration settings. Regions are optional; if you want to use them, you must explicitly create them at runtime with your application code by using the CreateRegion method. For more information, see Basic Cache Methods (Velocity).
With regions, you can retrieve cached objects in other ways than by using the specific key value with which they were cached. Regions let you to search all cached objects in the region by using descriptive strings called tags. You can associate one or more tags to each object stored in the cache. For more information, see Tag-Based Methods (Velocity).
In order to provide this added search functionality, objects in a region are limited to a single cache host. Thus, applications that use that data cannot realize the scalability benefits of distributed cache. In contrast, if you do not specify a region, cached objects can otherwise be load balanced across all cache hosts in the cluster.
Regions offer searching capabilities, but by limiting cached objects to a single cache host, the use of regions presents a trade-off between functionality and scalability.
Objects retrieved from the cache cluster take the form of their System.Object base class, requiring type conversion in order to restore them to their original type. When an object is in the cache, the cache cluster associates additional information with it. This includes keys, tags, version numbers, and on which cache and region the object is stored. For basic cache operations, you do not have to return this additional information to your cache-enabled application. For tag-based or concurrency operations, you might have to retrieve the Tags or Version associated with your object.
The GetCacheItem method is provided to retrieve all the information associated with your cached object and package it in the form of a DataCacheItem object. For more information about the available APIs, see Cache Client API Overview (Velocity).
Data in the cache is not encrypted and is available to any cache client that has the appropriate configuration settings. We highly recommend that you secure the XML-based application configuration files, if used, to specify the cache client.