Create Cache
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 Open Source, Professional and Enterprise.
New-Cache cmdlet enables the user to create a new cache on one or more server nodes.
Replicated 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 more detail on this chapter, please refer to Replicated Cache section.
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.
Open Windows 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 Replicated
Partitioned 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 more detail on this chapter, please refer to Partitioned Cache section.
Open Windows PowerShell on your server machine and execute the following command to create a new partitioned cache named demoPartitionedCache 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 demoPartitionedCache -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.
Open Windows 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 Windows 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.