Add-BackingSource
Note
This feature is only available in NCache Enterprise Edition.
Add-BackingSource
cmdlet enables the user to configure backing source
(read-through, write-through) providers for the specified cache. It configures
backing source with batching and re-queue options.
Important
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] [-Password] [-Port] [-ReadThru] [-Server] [-UserId] [-WriteThru]
These properties are explained in detail in the Properties section.
Examples
- The following command configures read-through provider for demoCache.
Add-BackingSource -CacheName demoCache -AssemblyPath C:\ReadThru.dll -Class ReadThru.Reader -ProviderName MyReader -ReadThru
- The following command configures write-through provider for demoCache.
Add-BackingSource demoCache -AssemblyPath C:\WriteThru.dll -Class WriteThru.Writer -ProviderName MyWriter -WriteThru
- The following command configures write-through 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 write-through provider with batching
enabled, OperationDelay 10ms, BatchInterval 5s, OperationPerSecond
500, OperationQueueLimit 3000, OperationEvictionRatio 10%, Parameters
_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 |
---|---|---|---|
-CacheName* |
<String> |
Specifies the name of the cache for which backing source will be configured. | - |
-AssemblyPath* |
<String> |
Specifies the path of the assembly which will be configured as a backing source. | - |
-Class* |
<String> |
Specifies the fully qualified class from the backing source assembly which implements ReadThru/WriteThru. | - |
-ProviderName* |
<String> |
Specifies the provider name. | - |
-ReadThru* |
<SwitchParameter> |
Specifies if provided backing source is configured for ReadThru. | - |
-WriteThru* |
<SwitchParameter> |
Specifies if provided backing source is configured for WriteThru. | - |
-DependentAssemblyPath* |
<String> |
Specifies the dependent assembly folder/path | - |
-Parameters |
<String> |
Specifies the list of the parameters passed to the backing source provider ($ separated) e.g. key1=value1$key2=value2$.... | - |
-NoDeploy |
<SwitchParameter> |
Specifies if no assembly should be deployed. | False |
-DefaultProvider |
<SwitchParameter> |
Specifies the default provider in case of multiple providers. | False |
-isBatching |
<SwitchParameter> |
Specifies that whether you want to enable batching or not. | False |
-OperationDelay |
<Integer> |
Specifies the time that cache suspends each operation write on data source. | 0 |
-BatchInterval |
<Integer> |
Specifies periodic interval for operation expiration. | 5 |
-OperationPerSecond |
<Integer> |
Specifies the rate at which cache writes the updates to database. | 1 |
-OperationQueueLimit |
<Integer> |
Specifies maximum operation count to be re-queued in case of data source write operation failure. | 5000 |
-OperationEvictionRatio |
<integer> |
Specifies failed operations eviction ratio. | 5 |
-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 |
-Port |
<Integer> |
Specifies the port on which NCache service is running. | 8250 |
-UserId (Enterprise edition only) |
<String> |
Specifies the user-id used to authorize the user for this operation. It is required in case security is enabled on Cache Server. This user-id must be the active directory user-id prefixed with the domain name. | - |
-Password (Enterprise edition only) |
<String> |
Specifies the password of the user that is used to authorize the user for this operation. It is required in case security is enabled on Cache Server. This password must be the same as the active directory user password. | - |
-NoLogo |
<SwitchParameter> |
Suppresses display of the logo banner. | - |