Memcached Gateway Approach [Deprecated]
NCache provides Memcached Gateway Servers to use NCache without any application code changes or recompilation. NCache Memcached Gateway is implemented based on the Memcached socket protocol and acts as a Memcached server for Memcached applications. It understands all Memcached client requests and sends responses accordingly. However, it only serves as a proxy and, in fact, connects to the NCache cluster.
Note
This feature is only available in NCache Enterprise.
Gateway intercepts Memcached commands and executes the NCache API equivalent on the NCache distributed cache. This approach gives you NCache support for any Memcached client, regardless of the application's programming language. There are two deployments of the NCache Memcached gateway:
Memcached Client Side Gateway
NCache Gateway Server installs on the application servers. Applications talk to the local Gateway Servers, and then the Gateway Servers act as NCache clients and execute the requested commands on NCache.
The Gateway Server is an intelligent NCache client that keeps a record of all NCache servers in the cluster. Thus if any of the nodes in the NCache cluster gets down, the gateway starts communicating with other available NCache servers. This approach avoids a single point of failure for application. While using the gateway, use the NCache remote client configuration. Figure 1 illustrates this deployment.
Figure 1: The Memcached Gateway Server running on the NCache Remote Client Machines.
Memcached Server Side Gateway
When NCache is installed on any cache server it also installs the Gateway just like any other service. Applications talk to Gateway Servers running on cache servers, and then the Gateway Server talks to the cache and sends a response back to the client. In Figure 2, the Memcached Gateway Server (the Memcached Client Wrapper) runs on the NCache cache servers. The Memcached client application talks to this gateway like a Memcached server. And, in turn, talks to the NCache cluster using NCache API calls.
In this configuration, when a Gateway Server runs on one of the server nodes in the cluster, the Memcached application communicates with only that server node. This approach produces a single point of failure risk for Memcached client applications. However, in this configuration, i.e., the Memcached socket protocol, messages are communicated over a network that is more compact and less in size than NCache protocol messages. Figure 2 illustrates this deployment.
Figure 2: The Memcached Gateway Server running on the NCache Remote Cache Servers.
See Also
Memcached Client Plug-In for .NET
Entity Framework Core Caching
Debug NCache Providers in Visual Studio