NCache 4.6 - 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 overcome by Write-Behind caching.
 
Using NCache Manager
 
  • Click on the cache name in Cache Explorer to open cache settings.
 
  • Go to the Backing Source tab.
 
  • Check Enable Write-Through check box to enable it. After enabling it, other options will get enabled as well.
 
 
  • Click 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
 
  • Press ENTER, it will configure Writer1 Write-Through provider on demoLocalcache.
 
  • Now deploy 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\
 
  • Press ENTER, it will deploy all of the assemblies from the given path to NCache deploy folder.
 
 
See Also