• Facebook
  • Twitter
  • Youtube
  • LinkedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Try NCache
  • Contact Us
Try NCache
Show / Hide Table of Contents

Add-BackingSource

The Add-BackingSource PowerShell cmdlet in NCache enables you to configure Read-Through and Write-Through providers for an existing cache, facilitating seamless integration with backend data sources. This cmdlet allows you to automatically fetch data on cache misses or synchronously update the database with cache writes. It also supports advanced features like batching, requeueing, and connection string parameters for optimized performance. This ensures efficient data retrieval, synchronization, and high throughput in distributed caching environments.

Warning

Make sure that the cache has been stopped before proceeding to execute this cmdlet.

Add-BackingSource -AssemblyPath -CacheName `
                  -Class [-DependentAssemblyPath] `
                  -ProviderName [-BatchInterval] `
                  [-DefaultProvider] [-isBatching] `
                  [-NoDeploy] [-NoLogo] `
                  [-OperationDelay] [-OperationEvictionRatio] `
                  [-OperationPerSecond] [-OperationQueueLimit] `
                  [-Parameters] [-Port] `
                  [-TlsCertPath] [-TlsCertPassword] `
                  -ReadThru [-Server] `
                  [-Credentials] -WriteThru

Examples

Important

Please note that either the ReadThru or WriteThru parameter must be specified when using this cmdlet.

  • This command configures Read-through provider for defaultCache.
Add-BackingSource -CacheName defaultCache -AssemblyPath C:\ReadThru.dll `
                  -Class ReadThru.Reader -ProviderName MyReader `
                  -ReadThru -Port 9803
  • This command configures Read-through provider for defaultCache and specifies a directory for all required secondary libraries.
Add-BackingSource -CacheName defaultCache -AssemblyPath C:\ReadThru.dll `
                  -Class ReadThru.Reader -ProviderName MyReader `
                  -ReadThru
  • This command configures Write-through provider for defaultCache.
Add-BackingSource -CacheName defaultCache -AssemblyPath C:\WriteThru.dll `
                  -Class WriteThru.Writer -ProviderName MyWriter `
                  -WriteThru
  • This command configures Write-through provider for defaultCache. The -NoDeploy parameter specifies that no assembly should be deployed.
Add-BackingSource -CacheName defaultCache -AssemblyPath C:\WriteThru.dll `
                  -Class WriteThru.Writer -ProviderName MyWriter `
                  -WriteThru -NoDeploy
  • This command configures Write-through provider with batching enabled, for defaultCache that exists on server 20.200.20.11. Please note that these batching settings are utilized only when the Write-behind mode is selected at the API level.
Add-BackingSource -CacheName defaultCache -AssemblyPath C:\Provider.dll `
                  -Class WriteThrough.Writer -ProviderName MyWriter `
                  -WriteThru -Server 20.200.20.11 `
                  -isBatching
  • This command configures Write-through provider with specific Write-behind throttles, including OperationDelay 10ms, BatchInterval 5s, OperationPerSecond 500, OperationQueueLimit 3000, OperationEvictionRatio 5% and Parameters which are key value pairs, _connectionString= “Server=localhost;Database=Northwind;Trusted_Connection=True;” and LoggerInfo=“Server=localhost;Database=TestLogger;Trusted_Connection=True;” for defaultCache that exists on server 20.200.20.11.
Add-BackingSource -CacheName defaultCache -AssemblyPath C:\Provider.dll `
                  -class WriteThrough.Writer -ProviderName MyWriter `
                  -WriteThru -Server 20.200.20.11 `
                  -isBatching -OperationDelay 10 `
                  -BatchInterval 5 -OperationPerSecond 500 `
                  -OperationQueueLimit 3000 -OperationEvictionRatio 5 `
                  -Parameters _connectionString=("Server=localhost; Database=Northwind;" + `
                                                  "Trusted_Connection=True;" + '$' + `
                                                  "LoggerInfo=Server=localhost;" + `
                                                  "Database=TestLogger;Trusted_Connection=True;")
  • This command configures WriteThrough.Writer from C:\Provider.dll as a write-through provider named MyWriter for defaultCache, with batching enabled, on the specified server with mutual TLS (mTLS) enabled. It runs from a machine where NCache is not installed and uses C:\certs\client.pem to authenticate the machine running the cmdlet. The -TlsCertPassword parameter decrypts the certificate’s password-protected private key. Omit this parameter if the private key is not encrypted.
Add-BackingSource -CacheName defaultCache -AssemblyPath C:\Provider.dll `
                  -Class WriteThrough.Writer -ProviderName MyWriter `
                  -WriteThru -Server 20.200.20.11 `
                  -isBatching -TlsCertPath "C:\certs\client.pem" `
                  -TlsCertPassword "clientKeyPassword"
  • This command configures Read-through provider for defaultCache using security credentials.
Add-BackingSource -CacheName defaultCache -AssemblyPath C:\ReadThru.dll `
                  -Class ReadThru.Reader -ProviderName MyReader `
                  -ReadThru -Credentials(Get-Credential john_smith)

Properties

Note

The parameters with asterisk (*) on their names are the required parameters, and the rest are optional.

Parameters Data Types Description Default Value
-AssemblyPath* <String> Specifies the path of the assembly which will be configured as a backing source. -
-CacheName* <String> Specifies the name of the cache for which backing source will be configured.
NOTE: The cache must already exist on the source server.
-
-Class* <String> Specifies the fully qualified class from the backing source assembly which implements ReadThru/WriteThru. -
-DependentAssemblyPath <String> Specifies the dependent assembly folder/path. -
-ProviderName* <String> Specifies the provider name. -
-BatchInterval <Integer> Specifies periodic interval for operation expiration. 5
-DefaultProvider <SwitchParameter> Specifies the default provider in case of multiple providers. False
-isBatching <SwitchParameter> Specifies whether you want to enable batching or not. False
-NoDeploy <SwitchParameter> Specifies if no assembly should be deployed. False
-NoLogo <SwitchParameter> Suppresses the display of the logo banner. False
-OperationDelay <Integer> Specifies the time that cache suspends each operation write on data source. 0
-OperationEvictionRatio <Integer> Specifies the failed operations eviction ratio. 5
-OperationPerSecond <Integer> Specifies the rate at which cache writes the updates to the database. 1
-OperationQueueLimit <Integer> Specifies the maximum operation count to be re-queued in case of data source write operation failure. 5000
-Parameters <String> Specifies the list of the parameters passed to the backing source provider separated by ‘$’. -
-Port <Integer> Specifies the port on which NCache Service is running. 9803
-ReadThru* <SwitchParameter> Specifies if provided backing source is configured for ReadThru. False
-Server <String> Specifies a server name where the NCache Service is running and a cache with the specified cache-name is registered. IP of local machine
-Credentials <pscredential> Specifies the user credentials required to authorize access for the specified operation. These credentials should belong to a user with the appropriate permissions at the node. -
-TlsCertPath <string> Path to the client PEM certificate used to authenticate the machine running the NCache PowerShell cmdlet when connecting to an NCache server with mutual TLS (mTLS) enabled. The PEM file must contain the private key, leaf certificate, and any intermediate certificates. You can generate a certificate using New-NCacheTlsCertificate. This parameter is required when running the PowerShell module from a machine where NCache is not installed and the server requires mTLS. On a machine with an NCache server installation, the node's own certificate is used automatically. Relative paths are resolved against the current PowerShell location, and the file must exist. To configure the certificate presented by the server, use -CustomCertificatePath. -
-TlsCertPassword <string> Password used to load the encrypted private key in the PEM file specified by -TlsCertPath. Required only when the private key is password-protected. Not needed for an unencrypted private key. The password is used only to load the client certificate for the current command's connections. It is not saved in the NCache server configuration. -
-WriteThru* <SwitchParameter> Specifies if provided backing source is configured for WriteThru. False

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Try NCache
Pricing
NCache Playground

Deployments
  • Cloud
  • Docker
  • Kubernetes
  • On-Premises
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • SignalR Backplane
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Blogs
  • Foundations
  • Videos
  • Comparisons
  • Shows
  • Whitepapers
  • Articles
  • Tech Talks
  • Magazine Articles
  • Third-Party Articles
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Docs
  • Schedule a Demo
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Terms of Use
  •  
  • Privacy Policy
  •  
  • Cookie Policy
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
  • Facebook
  • Twitter
  • Youtube
  • LinkedIn
  • RSS