SPRZEDAŻ: 1-800-867-1389
EN
Ta zawartość nie jest dostępna w wymaganym języku. Wersja w języku angielskim znajduje się tutaj.

Run your Memcache app with Azure Managed Cache Service

Updated: July 16, 2010

noteNote
For guidance on choosing the right Azure Cache offering for your application, see Which Azure Cache offering is right for me?.

Managed Cache Service provides support for migrating role-based Cloud Services Memcache client applications to use Managed Cache Service by providing a Memcache client shim. This topic provides guidance on using this shim to enable your Memcache client applications to use Managed Cache Service.

In this section

Memcache Overview

Memcache is a distributed, in-memory caching solution used to help speed up large scale web applications by taking pressure off the database. Memcache is used by many of the internet’s biggest websites and has been merged with other technologies in innovative ways.

Azure supports the Memcache protocol to enable customers with existing Memcache implementations to easily migrate to Azure. If an application already uses Memcache, there is no necessity to replace this code with new code.

Running Azure Cache with Memcache is a better option than, for example, running just Memcache itself in a worker role. This is because Azure Cache offer value-added features such as graceful shutdown, high availability, local caching, notifications, data consistency, high availability (HA), and easy scale-up and scale-down that’s transparent to the clients, to name a few. For example, the server hashing scheme and partition management in Azure Cache with Memcache help load balancing and preserve data consistency.

Memcache Protocol Support

Azure Cache supports the Memcache wire protocol. There are two versions of the protocol, a binary version and a text version.

A Memcache client should expect compatibility with Azure. Azure Cache supports almost every API that other Memcache implementations support.

As such, should a user bring a Memcache application to Azure, point the application at Azure’s implementation of Memcache, it should continue to work as-is, with no additional application modifications.

Memcache Client Shim

The Memcache client shim is installed on the client that is accessing the cache. This is generally the Azure role that has the application itself. The client shim supports local cache.

The shim is a translation layer. It translates Memcache client calls to the Azure Cache API. The shim has two parts –a Memcache protocol handler, and an Azure Cache client. The shim – the translation layer – is installed on the client itself, wherever the Get and Put calls to Azure Cache API are made from.

When the Memcache client is pointed to localhost as the Memcache server, memcache operations will be initially handled by the local instance of the shim. The shim will translate the operation to a cache API request and send it to the Azure Cache.

How to Deploy the Client Shim for Azure Applications

noteNote
Before starting, ensure that you have the cache endpoint and the access key for your cache. For more information about creating a cache, see How to: Create a Cache for Azure Managed Cache Service. For more information about access keys, see Controlling Access using Access Keys.

  1. On the role which has the Memcache client, right click on the role name and select “Add Library Package Reference” to launch the NuGet window

  2. Search for “Azure Caching Memcache Shim”. Install this NuGet package

  3. The package will create the startup task, add an internal endpoint for memcache_default and map it to 11211, and add the appropriate dataCacheClients sections to App.config and web.config. This can be changed in the internal endpoints tab.

  4. Provide the Azure cache endpoint in the autoDiscovery element and the access key in the authorizationInfo in the dataCacheClientSection of the App.config or Web.config

  5. The client must now be configured to “point” to the shim. Edit the memcache client configuration and set the server to “localhost”. The correct port number(s) must also be set (the default is 11211).

Czy oceniasz te materiały jako pomocne?
(Pozostało znaków: 1500)
Dziękujemy za opinię.

Zawartość społeczności

Dodaj
Pokaż:
© 2014 Microsoft