ASP. NET distributed cache solution appfabric Cache

Source: Internet
Author: User

Address: http://xcai.net/archives/30

 

As mentioned above, the iis7 arr module can be used to implement nginx-like reverse proxy and provide a load balancing solution. However, to deploy it in actual applications, you must solve the session synchronization problem, session is actually a type of cache. In the previous Microsoft solution, there was no reliable distributed cache solution, which was usually implemented using memcached. net 4 has a relatively complete solution: Windows Server appfabric cache.

Physical Structure of appfabric Cache

the Windows Server appfabric cache function uses a server cluster that communicates with each other to form a single unified application Program cache system. No matter how many computers constitute a cache cluster, your client applications can be used with the cache of a single logical unit in the cluster.

The main components of the physical architecture include cache server, cache host Windows Service, cache cluster, Cache Management Tool Based on Windows powershell, cluster configuration storage location and cache client.

Logical Structure of appfabric Cache

The logical architecture of the cache cluster in appfabric consists of named cache, region, and cache object. In, the named cache spans all cache hosts in the cluster, but the region is limited to one cache host in the cluster.

Develop cache Client

For. NET development, provides the Microsoft. applicationserver. caching namespace interface for Development calls, the specific development is not detailed here, see: http://msdn.microsoft.com/zh-cn/library/ee790941.aspx

Achieve seesion Synchronization

Microsoft. applicationserver. caching provides a ready-made sessionprovider, without any application development, you can switch to the distributed cache through deployment, detailed configuration method reference: http://msdn.microsoft.com/en-us/library/ee790859.aspx

the configuration case is as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <Configuration> <! -- Configsections must be the first element --> <configsections> <! -- Required to read the <datacacheclient> element --> <section type = "Microsoft. applicationserver. caching. datacacheclientsection, Microsoft. applicationserver. caching. core, version = 1.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "name =" datacacheclient "allowlocation =" true "allowdefinition =" everywhere "/> </configsections> <! -- Cache client --> <datacacheclient> <! -- Cache host (s) --> 

at this point, Windows is basically complete.. NET platform for large-scale Web application solutions, and seamless migration can be achieved without modifying existing applications.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.