• Products
  • Solutions
  • Customers
  • Resources
  • Company
  • Pricing
  • Download
Try Playground
  • Persistent Distributed Cache
  • Create Cache
Show / Hide Table of Contents
  • Getting Started with NCache
  • Install NCache (.NET Edition)
    • Prerequisites
    • Installer
  • Install NCache (Java Edition)
    • Prerequisites
    • Installer
    • Docker
  • Getting Started with NCache Cloud
  • Distributed Cache
    • Create Cache
    • Add Local/Remote Clients
    • Simulate Cache Usage
    • Monitor Cache
  • Persistent Distributed Cache
    • Create Cache
    • Add Local/Remote Clients
    • Simulate Cache Usage
    • Monitor Cache
  • Pub/Sub Messaging Cache
    • Create Cache
    • Add Local/Remote Clients
    • Simulate Cache Usage
    • Monitor Cache
  • Clients
    • .NET Client
      • Data Caching
      • ASP.NET Core Sessions
      • Pub/Sub Messaging
    • Java Client
      • Data Caching
      • Java Web Sessions
      • Pub/Sub Messaging
    • Python Client
      • Data Caching
      • Pub/Sub Messaging
    • Node.js Client
      • Data Caching
      • Web Sessions
      • Pub/Sub Messaging

Create a Persistent Cache

This section will demonstrate how you can create a persistent cache through the NCache Management Center and the Command Line Interface.

Note

A distributed cache with persistence supports only partitioned topologies and local (OutProc) caches.

Create Persistent Cache Using Management Center

  • Launch the NCache Management Center by browsing to http://localhost:8251 or <server-ip>:8251 on Windows and Linux.

  • In the left navigation bar, click on Clustered Caches. This opens up the Clustered Caches page at <server-ip>:8251/ClusteredCaches/.

  • To create a Persistent Cache, click on New.

Create Persistence Database Web

  • From the In-Memory Store Type dropdown menu, select the Persistent Cache option, i.e., Distributed Cache with Persistence and specify the name of your cache. Click Next.
Note

A distributed cache with persistence supports JSON serialization only.

Create Persistent Cache Web

  • Select the caching topology and advanced options like Operation timeout and Statistic replication interval. Click Next.
Note

A distributed cache with persistence supports the Partitioned and Partition-Replica Topologies only.

Select Topology for Persistent Cache Web

  • Specify the Cache Partition Size and add your cluster nodes by providing the Server Node IP or Host Name and clicking on the Add Node button. To add more nodes, click Add Node. Once all the required nodes are added, click Next.
Warning

If a cache with the specified name already exists, you are prompted with an error message.

Specify Size Persistent Cache Web

  • Next, you need to provide the persistence store settings for this cache on the Persistence Settings page. Choose New Store against the Select Store label. Specify the name of your store against the Store Name label. For connection information, provide the UNC Path, User Name, and Password. Once done, click on Test Connection. If the connection to your persistence store has been successfully tested, you will receive a success notification. Click Next.
Important

NCache Persistence requires a shared path that is accessible from all nodes. Make sure that all nodes have read and write access to the shared path.

Warning

Unless the connection to the persistence store has been tested successfully, you can not proceed further with the cache creation process.

Verify Connection Web

  • Change the Cluster Port and Port Range if required. Enable pipelining for the cache if required by checking the Enable Pipelining checkbox. Set the Batch Interval for the duration after which the commands will be transmitted over the network in microseconds. Click Next.

Specify TCP Parameters for Persistence Cache Web

  • If you want to enable encryption and compression, check the Enable Encryption and Enable Compression checkboxes. If enabled, set the Providers and Key for encryption and Threshold Size for compression. Click Next.
Note

If you want to use an existing store with encryption while creating a new cache, then encryption must be enabled on the new cache and vice versa. If the existing store was encrypted, the encryption credentials (provider and key) need to be the same as the ones used for the original store. If they are different, you will not be allowed to create the cache.

Encryption and Compression for Persistence Cache Web

Warning

The cache will not start on a node on which the persistence store is inaccessible.

  • Click Finish to complete the process. Your created cache will appear on the Clustered Caches page with the server nodes and their status and a success notification will be displayed in the notification panel.
Warning

If a database already exists with the specified Database Name, you will be prompted with an error message "Database already exists".

Create Persistence Cache Web

Using Command Line Interface

You can also use PowerShell or Command Line Tools to manage persistence caches by using the NCache supported Command Line Interface.

  • Windows
  • Linux

Create Cache

The New-Cache PowerShell cmdlet is responsible for creating new caches.

Important

NCache Persistence requires a shared path that is accessible from all nodes. Make sure that all nodes have read and write access to the shared path.

The following command creates a distributed cache with persistence named demoPersistenceCache on the server nodes 20.200.20.39 and 20.200.20.40. A new NCache Persistence store named demoPersistenceCache_db is created on the path \\fileserver\stores using the provided connection string. The topology is Partition-Replica and the cache size is 1024MB.

Note

For Windows, User Name and Password are required if authentication is enabled on the file share. You can also provide the domain name along with the user name as domain_name\user_name.

New-Cache -Name demoPersistenceCache -Server "20.200.20.39,20.200.20.40" -InMemoryStoreType DistributedCacheWithPersistence -NewPersistenceStore -PersistenceStoreConnectionString "\\fileserver\stores;domain_name\user_name;password" -Topology Partition-Replica -Size 1024
Warning

The cache creation process will fail if the connection to the persistence store is unsuccessful.

Start Cache

The Start-Cache cmdlet enables the user to start the registered cache. If the server nodes are specified, the cache process is started on the specified nodes.

Warning

The cache will not start on the node on which the persistence store is inaccessible.

Perform this step on all server nodes to start the previously created demoPersistenceCache.

Start-Cache -Name demoPersistenceCache

Create Cache

The new-cache tool is responsible for creating new caches.

Important

NCache Persistence requires a shared path that is accessible from all nodes. Make sure that all nodes have read and write access to the shared path.

The following command creates a distributed cache with persistence named demoPersistenceCache on the server nodes 20.200.20.39 and 20.200.20.40. A new NCache Persistence store named demoPersistenceCache_db is created on the path \\fileserver\stores using the provided connection string. The topology is Partition-Replica and the cache size is 1024MB.

Note

For Linux, User Name and Password are required if authentication is enabled on the file share. You can also provide the domain name along with the user name as domain_name\user_name.

new-cache -name demoPersistenceCache -server "20.200.20.174,20.200.20.175" -in-memory-store-type DistributedCacheWithPersistence -new-persistence-store -persistence-store-connection-string "\\fileserver\stores;domain_name\user_name;password" -topology partitionreplica -Size 1024
Warning

The cache creation process will fail if the connection to the persistence store is unsuccessful.

Start Cache

The start-cache cmdlet enables the user to start the registered cache. If the server nodes are specified, the cache process is started on the specified nodes.

Warning

The cache will not start on the node on which the persistence store is inaccessible.

Perform this step on all server nodes to start the previously created demoPersistenceCache.

start-cache -name demoPersistenceCache

See Also

Create New Distributed Cache with Persistence
Add Local Remote Clients
NCache Programmer's Guide
NCache Command Line Interface

In This Article
  • Create Persistent Cache Using Management Center
  • Using Command Line Interface
  • See Also

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

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

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top