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.