Couchbase Alternatives Open Source Distributed Cache

The database tier based on traditional RDBMS has proven to be the biggest bottleneck in the way of achieving competitive response times for applications. This has forced the application vendors to look for alternatives that can provide improved performance. One such alternative is storing data in a distributed cache.

From the available cache technologies you need to pick one that answers most if not all of the major questions asked in this domain. Going forward I will be comparing two products in this arena, Couchbase and NCache – Open Source Distributed Cache.

1 – ASP.NET Sessions

ASP.NET Session State caching has come a long way starting from keeping the session information in-memory on the Web server (default), to having it on a State server, to storing it on a SQL server. All of these have one limitation in common and that is the Single Point of Failure. Session state is lost if any of the following happens: Web server goes down, the State server goes down or the SQL server goes down.

To answer all these concerns NCache provides a solution by saving session state in its Open Source Distributed Cache. Since it’s distributed there is no single point of failure. Despite its importance Couchbase does not support saving ASP.NET sessions.

2 – ASP.NET View State

ASP.NET uses View State to store pages, controls and custom values between multiple HTTP requests. In some cases where we have complex controls on a page e.g. Data Grid Control, the string representing the View State grows very large. In such a case you would be using extra bandwidth to pass this string back and forth without any real benefit, in addition you are opening up a loop hole with regards to security.

What are the ways to address these issues ? All we need to have is a distributed cache that can store the View State text and pass back an identifier that can be used to retrieve our View State from the store. NCache provides this exact functionality in form of ASP.NET View State Caching whereas Couchbase does not.

3 – Memcached Smart Wrapper

NCache provides support to integrate with Memcached in a transparent way using Memcached integration.

Let me just say a few words about Memcached, it is a popular distributed cache that is being used in the market but offers very basic caching features. It does not provide any support for high availability, data replication, cache elasticity, and ease of management.

Couchbase does not provide any such integration, so to be able to adapt to Couchbase for someone using Memcached there is only one way; Rewrite your code from scratch!

4 – Security & Encryption

One of the fundamental requirements of applications needing fast response times is that the data be secured. This makes security and encryption must haves for providers of distributed caching.

NCache is well equipped to provide support for both of these features in a comprehensive manner, Couchbase on the other hand fails to provide support for data encryption and active directory/ LDAP authentication. Read more on NCache encryption here.

5 – Read-through & Write-through

Read-through means that your application always asks the cache for data and the cache gets it from your data source if it doesn’t have it and caches this data for future accesses. This simplifies your application code greatly because cache API is very simple to use in comparison to the database.

Similarly write-through allows your application to write to the cache and the cache then writes the same data to the database either synchronously or asynchronously. Both these features facilitate you to have the cache as your enterprise data store and have all applications read from it and write to it.

NCache provides full support for both Read-through and Write-through but Couchbase fails to do so and hence lags behind NCache here as well. More on Read-through & Write through.

Further Reading

For feature by feature comparison of Couchbase with NCache please take a look at the following link:

Couchbase vs. NCache

Avatar for Umer Ahmed

Leave a Reply

Your email address will not be published. Required fields are marked *