Redis vs Infinispan vs Memcached
By: Thenusan Santhirakumar
Tags: Memcached, Infinispan, Redis, Database, NoSQL

Redis Episode -4

Redis vs Infinispan vs Memcached

Photo by Raquel Martínez on Unsplash

We have already discussed the Redis introduction, data persistence, availability in previous articles. I want to discuss the comparison of the Redis with some of the other similar technologies here such as the Infinispan and Memcached. As we know already, Redis is an in-memory database. All three are some data storing technologies, purely open-sourced and mainly used to improve performance and availability in software systems. The Redis introduction part is written in an article separately. You may read that to get a basic idea about the Redis.

Photo by Brett Jordan on Unsplash

Infinispan is an in-memory, distributed, key-value store and available under Apache 2.0 licencing. The Infisipan was written on top of the JAVA. It is often used as a distributed cache system in front of the primary database but can be used as a storage for temporal data, like user session data. One of the main advantages of being in-memory storage is the performance factor. Infinspan is also extremely performant like the Redis. Data persistence is also available in the Infinispan. In case any server failure, whole data can be restored.

Infinispan uses masterless peer to peer architecture between nodes. Peer to peer methodology helps to scale vertically and horizontally quickly. If one of the peers fails, there is no major issue in the whole system. It increases availability and scalability. The multi-threaded design ensures software to gain the full performance of multi-core of systems. Infinispan has clients for widely-used programming languages such as Java, Python, Node JS etc. Clustering support is available for the Infinispan. Traditional user ID password mechanism, certificate methods, Kerberos, token-based security(OAuth) are available in Infinispan in terms of the security perspective. The Infinispan can be integrated with AWS, Azure, Google Cloud and Kubernetes.

Memcached is an open-source, high-performance, distributed memory object caching system. Memcached is also a key-value data store. It is perfectly efficient for websites with high database load. Memcached does not support for richer data structures, unlike the Redis. Redis only uses single cores, while Memcached utilises multiple cores. Most of the times, Redis performs higher than Memcached in small size data when measured in terms of cores. Memcached performs well than Redis for storing big size data. However, Redis also has made some optimising alterations for storing big data.

Cluster support increases the availability in Memcached. Automatic failover facility is not available with the Memcached up to now. Memcached is not capable of data persistence. If the whole server fails once, all the stored data will be lost. Memcached has clients for widely-used programming languages such as Java, Python, C++. Memcached implementation of access control has some capabilities than Redis and Infinispan.

What and Where

Photo by Brendan Church on Unsplash

Memcached and Infinispan have an advantage in scaling than Redis. They are easily scaled up by giving more computational sources as both of them are multi-threaded. You may use Memcached or Infinispan can be used in the system where scalability is the essential feature. Memcached could be used in caching small static data. Memcached must not be used in scenarios where persistence is critical.

Redis is an auto choice when performance and persistence are crucial than other features. Redis is used sometimes for its rich data structures. In modern data analytics purposes, Redis is the right choice when considering performance. Redis works well in large data sets also. Infinispan is also very similar to Redis. The main difference between them is single-threaded and multi-threaded. Peer to peer architecture helps more in scalability than the master-slave setup. Infinispan could be used to manage a high workload in the multi-core systems.

Redis, Infinispan, Memcached all are reasonable database-related solutions. One can outperform others in different circumstances. We must select one solution concerning our purpose and goals. What to use and where to use are critical questions before picking one technology.

I believe that you understand the topic discussed today well. If you have any concerns feel free and put them in the comments section, I will reply as soon as possible. Thank you for spending your precious time to read this article.

References