Create Cache in Professional Edition
NCache Professional edition allows you to create the following caches:
- Partitioned Cache
- Replicated Cache
- Local Cache (meaning a standalone cache)
For other caching topologies, please download and use NCache Enterprise. See more details on edition comparison between NCache Professional and Enterprise.
Clustered Cache
A cache cluster is a set of interconnected server nodes forming a cluster of servers which behave as a single cache unit from the outside.
For clustered caches, you can have a single server if you want to test on your own machine. You can add more than two servers if you need to.
Using NCache Web Manager
Launch NCache Web Manager by browsing to
http://localhost:8251
(Windows) or<server-ip>:8251
(Windows + Linux).In the left navigation bar, click on Clustered Caches. This opens up the Clustered Caches page at
<server-ip>:8251/ClusteredCaches/
. The page shows any existing clustered caches on your machine and additional details like Topology, Servers and Server Platform.To create a new clustered cache, click on New.
- Specify the cache name and serialization (Binary or JSON). Click Next. If a cache by that name exists, you are prompted accordingly.
Note
It is recommended that you use JSON serialization if you are using ASP.NET 5.0 and above. For more details click here.
- Select the caching topology and any advanced options like Operation Timeout and Statistic Replication Level. Click Next.
- Specify Maximum Size of the cache, if required. You can also add cache nodes to the cluster by specifying the node IP address and clicking on +. To add more nodes, click +. Click Next once all the required nodes are added.
Warning
If a node is already registered on that cache, notification is prompted.
- Change the Cluster Port and Port Range if required. Click Next.
In Advanced Options page, you can configure the following settings:
You can change the Eviction percentage; items will be evicted from the cache using this percentage value.
You can change the Clean interval value. Default is 15 seconds.
This cache can be started automatically upon the completion of this process if you have checked the Start this cache on Finish checkbox on this dialog box.
You can make the cache start itself automatically after service restart by checking the checkbox Auto start this cache on service startup.
- Click Finish. Created cache will appear in Clustered Caches page with the server nodes and their status and a success notification will be received in the notification panel.
Using PowerShell
The New-Cache cmdlet enable the user to create a new cache on one or more server nodes.
Open PowerShell on your server machine and execute the following command to create a new replicated cache named demoReplicatedCache on server 20.200.20.38, with default configurations.
Warning
Cache with the specified name should not exist on the server; otherwise you get an error message that this cache already exists on this server.
New-Cache -Name demoReplicatedCache -Server 20.200.20.38 -Size 1024 -Topology Partitioned
Local Cache
NCache supports a standalone (non-clustered) cache which resides on a single node. Note that as it is a single server cache, you can not increase its span to multiple servers to raise its transactional capacity. For more detail on Local Caches, refer to the chapter Local Cache.
Using NCache Web Manager
Launch NCache Web Manager by browsing to
http://localhost:8251
(Windows) or<server-ip>:8251
(Windows + Linux).In the left navigation bar, click on Local Caches. This opens up the Local Caches page at
<server-ip>:8251/LocalCaches/
. The page shows any existing local caches on your machine and additional details like Server and Server Platform.To create a new local cache, click on New.
- Specify the Server Node IP and click Next.
- Specify the cache name, isolation level and serialization (Binary or JSON). Click Next. If a cache by that name exists, you are prompted accordingly.
Note
It is recommended that you use JSON serialization if you are using ASP.NET 5.0 and above. For more details click here.
- Change the cache size if required and click Next.
In Advanced Options page, you can configure the following settings:
You can change the Eviction percentage; items will be evicted from the cache using this percentage.
You can change the Clean interval value. Default is 15 seconds.
This cache can be started automatically upon the completion of this process if you have checked the Start this cache on Finish checkbox on this dialog box.
You can make the cache start itself automatically after service restart by checking the checkbox Auto start this cache on service startup.
- Click Finish. Created cache will appear in Local Caches page and a success notification will be received in the notification panel.
Using PowerShell
Open PowerShell on your local machine and execute the following command to create a new local cache named demoLocalCache on server 20.200.20.38, with default configurations.
Warning
Cache with the specified name should not exist on the server; otherwise you get an error message that this cache already exists on this server.
New-Cache -Name demoLocalCache -Server 20.200.20.38 -Size 1024
Verify Cache Creation
To verify successful creation of the cache, open PowerShell and use Get-Caches cmdlet (shipped with NCache) with -Detail
parameter which gives a detailed status of all caches registered on the cache server. For example, for Partitioned cache, you should see that demoPartitionedCache has a Cluster-size of 1 with IP address of the cache server listed with it. The output also displays the Item Count, which at this stage should be 0.
Get-Caches -Detail
Next Steps
You can now proceed to add more servers to the clustered caches.
In order to add a local or remote client to your newly created cache, please refer to Add Client to Cache.