NCache 4.3 - Online Documentation

Client Plug-In for .NET

NCache provides its Memcached Client Plug-In for popular .NET and Java Memcached clients so that NCache can be used for Memcached applications. NCache API calls are equivalent to Memcached calls which are internally implemented in these plug-ins and there is no code change or recompilation required on application side.
It is generally recommended to use Plug-In approach instead of Gateway because gateway induces an extra network/process hop whereas this Plug-In becomes part of your client application process and directly talks to the NCache cluster using NCache API so it should give you better performance.
This Diagram illustrates NCache deployment with Plug-In approach.
Figure 3: Memcached Client Plug-In for .NET and Java
Using Memcached Client Plug-In for .NET
Step1: Replace NCache assemblies:
You need to select a client plug-in that you want to use in client application and replace plug-in assembly in application bin folders where you had previously referenced actual Memcached client assemblies.
Here are details on NCache client plug-in assemblies for a few popular .NET clients with their specific path. Source code of these plug-ins is also shipped along with these assemblies.
Remove DLL
Re-Reference DLL
.Net Memcached Client Library
NCache\integration\Memcached\Clients\.NET Memcached Client Library\bin\Memcached.ClientLibrary.dll
NCache\integration\Memcached \Clients\Enyim\bin\ Enyim.Caching.dll
NCache\integration\Memcached \Clients\BeITMemcached\bin\BeITMemcached.dll
Step2: Add cache name in app settings:
NCache Plug-in client needs to know which cache cluster you want to use to perform operations. You need to specify cache name in application configuration files. Add following key in app.config file of your application.
    <add key="NCache.CacheName" value="democache" />
Step3: Run your Client application
Now you have Memcached plug-in client ready to interact with NCache server. Run your application and your client will automatically connect to the NCache Server.
Verify that operations are being performed on specified cluster by viewing statistics of cluster in NCache Manager.
See Also

© Copyright  2014 Alachisoft. All rights reserved.