What is NCache Playground and How to Use It?

Introduction

As software developers, we may come across different requirements that require us to try and work with different technologies and frameworks. But this comes with its own learning curve - installing tech, learning the nuances, and then adapting to work with the new tech.

Each technology/framework we may decide to work on generally has its own unique set of features or installation processes that might take some time to get comfortable with. Sometimes, we wish we could get a practical hands-on with the technology/tool before actually sitting down and working with it - kind of a test simulation, so that we can quickly get an experience of how it will be to work with it.

For example, say you are a .NET developer and looking to pick up Python as your technology for your next project - that means you need to go through all the things a beginner would do - installing Python, learning the scripts, and then actually start working on it.

This is where coding playgrounds shine - a coding playground helps you get acquainted with the technology and its experience without having to go through all the setup and configuration prerequisites.

What is this NCache Playground?

NCache Playground is an interesting simulation environment where you can get a first-hand experience of how the cache works and how you can integrate it with your application without having to install a copy in your system.

It is an online tool where you can access a simple 2-node cache cluster and play around with the features. It also contains code samples for 8 of its popular features in .NET and Java, which you can execute and even experiment with.

In this article, let us briefly look into what we have in store with the NCache Playground and the features we can try out.

Accessing the NCache Playground

To access the playground, go to the NCache homepage (https://www.alachisoft.com/ncache/) and click on the try playground option on the top right.

It will take you to the playground homepage, where there are two options to choose from - Basic and Sandbox session.

NCache Playground options

Accessing the Basic Cache Mode

In Basic mode, you'll be taken to a console where a single node NCache cluster is running. You can run some default sample programs and see how the cache behaves.

The limitation here is that you can’t access the underlying cache manager or can edit the sample code. Also, the code is limited to .NET, so other languages aren’t there in this mode. But you can still view the 8 feature demos even in this mode.

NCache playground

The interesting part is the Sandbox Session option. Clicking on this will take you to a login page with a dynamically generated username and password shown above the inputs.

Playground login

Accessing the Sandbox Cache Cluster

Enter them, and you will be taken to the management page, where you can access the complete NCache manager for 30 minutes.

You are provided an NCache cluster with 2 nodes and replicas.

NCache cluster

You can try to access all of the cache management things, like stopping starting cache nodes, stress tests, and monitoring the caches. I tried adding new nodes, but it seems the playground is set to 2 nodes.

Nodes

Another great feature is the ability to run sample programs that can access this NCache cluster.

Accessing the Demo Cache and Running Code

There are 8 sample programs that feature the different capabilities of NCache. You can execute the default code block as it is, or you can make changes to try and see how the cache adds, updates, or deletes items.

The interesting part here is that as we try to tweak the code to work with the cache, the cache manager displays live information about all the changes that are happening in the cache cluster.

I tried invoking multiple sample code snippets that add and retrieve from the cache, and I could see the spike go up simultaneously in the cache manager.

As mentioned before, in this limited Session, we can even run our own custom code that interacts with the cache and see how the cache behaves. I tried tweaking the cache sample code to do some bulk CRUD operations on the cache, and it was fun.

CRUD Operations

This helps us get a real experience of how it is to work with the cluster for a real-world application.

Conclusion and Final Thoughts

Overall, this is an interesting and intuitive playground console that nicely demos the features of the cache offering.

I think this playground helps in 3 ways.

  1. It helps us understand how the cache works and what you can do with it
  2. It gives you a clear try before you use simulation - that helps in clear evaluation
  3. The code samples cover the major use cases for which you may want to use a cache component - which clearly demonstrates how to use it.

I think it is a really interesting and innovative idea to have a cache playground for users, which is something quite rare for a cache solution.

What do you think of this? Do let me know.