SALES: 1-800-867-1380

In-Role Cache FAQ (Azure Cache)

Updated: October 31, 2012

What is Azure Caching?

Microsoft Azure Cache is a distributed, in-memory cache that you can use to accelerate the performance and scale of your cloud applications built on Microsoft Azure and Azure SQL Database. Caching is often used to keep frequently-queried data in-memory close to the application itself, which both reduces overhead on the database tier and also eliminates unnecessary network latency.

ASP.NET developers can use Cache without code changes, as pre-built session state and output caching providers enable you to activate with simple configuration changes. Cache capabilities are also directly available using a simple API for even more flexible and customized application use. At runtime, Cache transparently distributes ASP.NET session/output cache data or .NET Framework objects stored in the cache across the elastic, scale-out infrastructure.

For more information on Cache, see About In-Role Cache for Azure Cache.

What is new with Azure Caching?

In-Role Cache on Microsoft Azure Cache introduces a new ability to host Cache within your Microsoft Azure roles. The cache is distributed across the instances of the role that hosts the cache. This is a change from Microsoft Azure Shared Caching. The main difference from Shared Caching is that role-based In-Role Cache is private to your hosted service. With Shared Caching, Cache is offered as a multitenant service. As a result, role-based In-Role Cache does not have the quotas that a shared service must have. The size of the cache is determined by several variables. First, the size is dependent on the number of running instances of the role that has In-Role Cache enabled. It is also dependent on the size of those virtual machines and the percentage of memory that is devoted to In-Role Cache on the role. In-Role Cache on Microsoft Azure roles supports additional features, such as high availability, regions, notifications, and multiple named caches. Because it is part of your cloud service, In-Role Cache on roles should also have improved performance over Shared Caching.

For more information on role-based In-Role Cache, see the following resources.

Where can I download Caching?

The In-Role Cache binaries are part of the latest Microsoft Azure SDK. Download and install the latest Microsoft Azure SDK and Visual Studio tools to obtain everything necessary for In-Role Cache.

Is role-based Caching supported in production at this time?

Yes. In-Role Cache on Microsoft Azure Cache was released with the October 2012 release of the Microsoft Azure SDK.

Why can't I create a cache through the new Management Portal?

Role-based In-Role Cache is not provisioned through the Microsoft Azure Management Portal. Instead, In-Role Cache is configured as part of your cloud service deployment. If you need to create or manage caches that use Shared Caching, you must use the old Microsoft Azure Management Portal.

What is the provisioning model for role-based Caching?

Role-based In-Role Cache is provisioned as a part of your cloud service deployment. In-Role Cache is enabled on a role that provides Cache to all of the roles in the same deployment. You can enable In-Role Cache through the Caching tab of the role properties in Visual Studio. For more information, see Configure Caching on Azure Roles.

How am I billed for role-based Caching?

There is no premium associated with role-based In-Role Cache. Instead, you are billed using standard pricing for compute time for Microsoft Azure role instances. For example, if you had three web role instances running your ASP.NET web site, it is possible that you could use the extra memory on those instances for Cache. In this example, there would not be additional charges for using Cache on the existing web role. However, you might find that you need to add an additional web role instance or a dedicated In-Role Cache role. In this case, you would be charged for the additional running role instances that you require for Cache.

How can I increase or decrease the cache size?

With role-based In-Role Cache, a percentage of memory from each role instance contributes the total memory available for Cache. There are two ways to change the cache size. First, you can change the percentage of memory reserved for Cache on the role. Second, you can increase or decrease the amount of memory available for Cache by increasing or decreasing the number of instances of the role that has In-Role Cache enabled. The Microsoft Azure Management Portal supports the ability to make this change to a running cloud service. The actual change in memory is dependent on the virtual machine size for the target role and the percentage of memory allocated for In-Role Cache.

What kind of data can I store in the cache?

You can store any kind of data in the cache. The only requirement is that the data is serializable. This includes but is not limited to:

  • Common Language Runtime (CLR) objects

  • Rows

  • XML

  • Binary data

You can programmatically interact with the cache using the simple .NET Framework API. You can also configure the cache as a provider for ASP.NET session state and page output.

What is the difference between co-located and dedicated Caching topologies?

There are two main ways a role can host In-Role Cache: co-located and dedicated. In the co-located topology, the role that hosts In-Role Cache also hosts other web role or worker role functionality. The memory and resources of the role are shared between caching and non-caching application code and services. In the dedicated topology, which is supported for worker roles, the worker role only hosts caching. These Cache topologies differ primarily in the percentage of memory that is dedicated to Cache. For more information, see the topics on co-located Caching roles and dedicated Caching roles.

Does role-based Caching have any usage quotas?

There are no defined usage quotas for role-based In-Role Cache. However, the amount of memory and performance of the cache is constrained by physical resources. For example, Cache uses physical memory only. It is not possible to use more physical memory than the combined available memory on the virtual machine instances. It is also possible to have constraints for other physical resources. For example, if a worker role uses a high amount of processing time, adding In-Role Cache to that role could result in poor Cache performance.

By using Microsoft Azure roles for Cache, you have the control and flexibility to configure Cache in the best way for your application with no predefined quotas. To make the best choices, see Capacity Planning Considerations for In-Role Cache (Azure Cache).

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft