NCache 4.3 - Online Documentation

Write-through Cache Provider

 
NOTE: This feature is not available in NCache Express and Professional edition.
 
    Currently NCache provides two modes for write-through caching i.e. write thru and write behind. For write-thru, synchronous updates are applied to data  
    source, while in write-behind updates are applied asynchronously.
    For write-thru mode, all operations will be  applied on data source according to configured throttling rate.
    For write-behind mode, NCache provides operation batching. In this feature user can delay an operation (using operation delay) on data source for 
    configurable amount of  time. These operations will be collected from write behind queue on configured batch interval. This selected operation batch will 
    be applied on data source as bulk if batching is enabled. For non-batch mode, operations will be applied one by one on data source. Throttling rate will be 
    applied  in both, batch and non batch mode.
 
Namespace:
 
For enabling Write-through caching, you need reference of following assembly in your application:
Alachisoft.NCache.Runtime.dll
This assembly contains class implementing Alachisoft.NCache.Runtime.DatasourceProviders.IWriteThruProvider interface provided by NCache. The class implementing this interface gets notification requests to save data back to the master datasource whenever new data is added to the cache. Thus, the class needs to include the logic for writing data from cache to the master datasource.
Following namespaces are required in your project for using Write-Thru provider:
 
using Alachisoft.NCache.Web.Caching;
using Alachisoft.NCache.Runtime.DatasourceProviders;
using Alachisoft.NCache.Runtime;
 
Write-Through Interfaces:
 
In order to use Write-Thru/Write-Behind provider in your application, implement the following methods:
 
  public void Init(System.Collections.IDictionary parameters, String cacheId);
  public void Dispose();
  public OperationResult WriteToDataSource(WriteOperation operation);
  public OperationResult [] WriteToDataSource(WriteOperation [] operations);
 
 
See Also

 
© Copyright  2014 Alachisoft. All rights reserved.