NCache 4.4 - Online Documentation

Write-Through Provider

 
NCache supports write-through caching. The idea behind write-through cache is that when an application updates a piece of data in the cache, the operation is not completed until the changed data has been successfully stored in the underlying data source. Though this enhances data integrity but affects the performance negatively in terms of the latency involved in writing to the data store. This latency can be overcomed by write-behind caching.
 
Using NCache Manager
 
  • Click on the cache name in Cache Explorer to open cache settings.
  • Go to the Baking Source tab.
  • Check Enable Write-Through on this cache check box to enable it. After enabling it, other options will get enabled as well.
 
 
 
  • Cllick Add to select assembly that has IWriteThruProvider implementation.
 
 
  • A new dialog box Add New Provider will open. Enter Provider Name and click on ‘…’ button to browse for assembly implementing IWriteThruProvider interface.
 
 
  • Browse for the required assembly and select Open. Name of selected assembly will be appeared in Assembly Name and its classes implementing interface will be listed down in Class Name list box.
 
 
  • Select the required read-through provider. You can also provide the values to your read-through provider class, if required. Just write the parameter name in Parameter field and its value against it under the Value field. Click OK.
 
 
  • Selected provider class will be listed in Write-Through provider list at Backing Source tab.
 
 
  • Now deploy the write-through provider assembly along with its dependency assemblies, if any. Click on the Deploy Provider button at the left bottom of the Backing Source tab. Browse for required assemblies. Select all the required assemblies and click Open.
 
 
  • Right click the cache in Cache Explorer and select Apply Configuration option.
 
 
 
 
 
Using Command Tool
 
  • Open command prompt
  • Go to the NCache tools directory: cd %NCHOME%/bin/tools
  • Use addbackingsource.exe tool, provide the required information as:
addbackingsource.exe demoLocalCache /path C:\Downloads\Providers.dll /cNCache.Sample.Providers.Writers.Writer1 /pnwriter1/W
  • Hit ENTER key, it will configure Writer1 write-through provider on demoLocalcache.
  • Now depoly all of the required assemblies (assembly in which you have implemented the write-through provider and all of its dependency assemblies) using deployprovider.exe. Use following command on command prompt:
deployprovider demoLocalCache /T C:\Users\Administrator\Downloads\Providers\
  • Hit ENTER key, it will deploy all of the assemblies from the given path to NCache deploy folder.
 
See Also