• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

Configuring Write-Through Provider

Note

This feature is only available in NCache Enterprise Edition.

To preserve the cache data in some persistent storage, you can configure write-through providers for a cache. By using write through provider, the cached data and data added/updated/removed is synchronized with a data source.

Important

For Java, before deploying your JAR files, you need to make sure that:

  • You have JDK 11 LTS installed
  • Your Environment Variable for Java is set

Using NCache Web Manager

Note

Java based providers can also be configured using NCache Web Manager.

  • Launch NCache Web Manager by browsing to http://localhost:8251 or <server-ip>:8251 on Windows and 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.

Configure Read Through Web

  • 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.

  • Check the Enable Write Through box. Select + Add Provider.

Configure Read Through Web

  • A new page will open up. Enter the Provider Name in the text box and then click on the ... button to browse for assembly implementing IWriteThruProvider interface. Select the class name from the drop down list.

  • Select the required Write-Through provider.

Configure Write Through Provider Name

  • You can also provide the values to your write-through provider class, if required. Specify the parameter name in Parameter field and its value against it under the Value field.
Note

These parameters, along with their assigned values, are passed to the selected Write-Through provider when it is initialized on cache start. Providing the parameters is optional.

Configure Write Through Parameters

  • Click OK.

  • Selected provider class will be listed in Read-Through provider list at Backing Source tab.

Write Through Providers List

  • Deploy the write-through provider assembly along with its dependent assemblies if any. Click on the Deploy Backing Source Provider button at the bottom left of the Backing Source tab page. Browse for the required assemblies, select all of the required assemblies and click Open.

Write Through Providers List

  • After applying all the changes click on Save Changes.

Using PowerShell

Configure Write-Through

Add-BackingSource cmdlet enable users to configure backing source (read-through, write-through) providers for the specified cache.

This command configures Writer1 as write-through provider on demoClusteredCache.

Add-BackingSource demoClusteredCache -AssemblyName C:\Downloads\Providers.dll -Class NCache.Sample.Providers.Writers.Writer1 -ProviderName writer1 -WriteThru

This command configures Writer2 as write-through provider on demoClusteredCache using the executable jar.

Add-BackingSource demoClusteredCache -AssemblyName C:\Downloads\BackinSourceProviders-1.0.jar -Class NCache.Sample.Providers.Writers.Writer2 -ProviderName writer2 -WriteThru

Remove Write-Through

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-through provider named Writer1 from demoClusteredCache existing on server 20.200.20.39.

Remove-BackingSource demoClusteredCache -ProviderName MyWriter –WriteThru –Server 20.200.20.39

See Also

Read-Through Provider
Write-Through Provider for Write-Behind Operations
Deploy Providers
Add Test Data

Back to top Copyright © 2017 Alachisoft