Add-BackingSource
This PowerShell Cmdlet enables the user to configure backing source (read-through, and write-through) providers for a specified cache. It configures backing source with batching and requeue options.
Important
Make sure that the cache has been stopped before proceeding to execute this PowerShell Cmdlet.
Add-BackingSource –AssemblyPath [-CacheName] –Class -DependentAssemblyPath -ProviderName [-BatchInterval] [-DefaultProvider] [-isBatching] [-NoDeploy] [-NoLogo] [-OperationDelay] [-OperationEvictionRatio] [-OperationPerSecond] [-OperationQueueLimit] [-Parameters] [-Port] [-ReadThru] [-Server] [-Credentials] [-WriteThru]
Examples of Add-BackingSource
- The following command configures ReadThru provider for demoCache.
Add-BackingSource -CacheName demoCache -AssemblyPath C:\ReadThru.dll -Class ReadThru.Reader -ProviderName MyReader -ReadThru
- The following command configures WriteThru provider for demoCache.
Add-BackingSource -CacheName demoCache -AssemblyPath C:\WriteThru.dll -Class WriteThru.Writer -ProviderName MyWriter -WriteThru
- The following command configure the ReadThru provider for demoCache.
Add-BackingSource -CacheName demoCache -AssemblyPath C:\BackingSourceProvider-1.0.dll -Class ReadThru.Reader -ProviderName MyReader -ReadThru
- The following command configure the WriteThru provider for demoCache.
Add-BackingSource -CacheName demoCache -AssemblyPath C:\BackingSourceProvider-1.0.dll -Class WriteThru.Writer -ProviderName MyWriter -WriteThru
- The following command configures WriteThru provider with batching enabled, for demoCache that exists on server 20.200.20.11.
Add-BackingSource -CacheName demoCache -AssemblyPath C:\Provider.dll -Class WriteThrough.Writer -ProviderName MyWriter -WriteThru -Server 20.200.20.11 -isBatching
- The following command configures WriteThru provider with batching enabled, 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;”
andLoggerInfo=“Server=localhost;Database=TestLogger;Trusted_Connection=True;”
for demoCache that exists on server 20.200.20.11.
Add-BackingSource -CacheName demoCache -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;"
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. | - |
-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. | - |
-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. | 8250 |
-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. | 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. | - |
-WriteThru* |
<SwitchParameter> |
Specifies if provided backing source is configured for WriteThru. | False |