Configure Write-Through for Write-Behind Operations
Note
This feature is only available in NCache Enterprise Edition.
If write-behind option is enabled, then all of the data source operations are queued up and performed in the background. There are multiple settings, which can be used to optimize the write-through provider to fulfill the user requirements.
Using NCache Web Manager
Launch NCache Web Manager by browsing to
http://localhost:8251
(Windows) or<server-ip>:8251
(Windows + Linux).In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache to which the query index will be added. Against the cache name, click on View Details.
Note
Make sure that the cache is stopped.
This opens up the detailed configuration page for the cache. Go to the Advanced Settings tab and click on Backing Source in the left bar.
Configure a write-through provider as explained in Configuring Write Through Provider.
Once here, you can change or specify the values as per your application requirement(s).
Check the Enable Batching checkbox to perform all write-behind operations on data source in bulk/batches. You can also configure the Batch-interval(s) and Operation-delay(ms) for the batching mode.
Change the value for Operations per second, to control how many write-behind operations will be performed on data source in a second.
You can also configure the Failed operations queue limit. This queue is used to re-queue the failed operations and will be retried on the data source.
Failed operations eviction ratio specifies the eviction ratio percentage to evict the most retried operations when queue is full.
Once you have added the Read-Through/Write-Through providers, deploy the providers through Deploy Backing Source Providers which requires the assemblies to be deployed over NCache.
- After applying all the changes click on Save Changes.
Using PowerShell
Configure Write-Behind
Add-BackingSource cmdlet enable users to configure backing source (read-through, write-through) providers for the specified cache.
The following command configures Writer1 as write-through provider on demoClusteredCache with write-behind enabled and with throttling limit of 500 operations per second.
Add-BackingSource demoClusteredCache -AssemblyName C:\Providers.dll -Class NCache.Sample.Providers.Writers.Writer1 -ProviderName writer1 -WriteThru -IsBatching -OperationsPerSecond 500
Remove Write-Behind
Remove-BackingSource cmdlet removes the pre-configured backing source providers (read-through or write-through) from the cache or a specified server.
• The following command removes the pre-configured write-behind provider named Writer1 from demoClusteredCache.
Remove-BackingSource -CacheName demoClusteredCache -ProviderName Writer1 –WriteThru
See Also
Read-Through Provider
Write-Through Provider
Deploy Providers
Add Test Data