15 Interesting Facts About Redis

15 Interesting Facts About Redis
15 Interesting Facts About Redis

We all know Redis is a popular tool used across the world. Let me take you on a small trip of tips & facts in the midst of your hectic corporate schedule to tell you more about this ever-popular caching tool.

What is Redis?

By default, Redis is a cache which has been called upon as a database for use. It utilizes volatile memory and can provide users full-fledged options for persistency & support to additional data types.

15 Interesting Facts about Redis

  1. Persistence allows you to treat Redis as a legitimate database rather than an unstable and temporary cache. If you reboot a similar tool — ‘Memcached’ it loses its information. But Redis data stays intact and maintains entirety.
  2. Redis has database capabilities. Even when combined with caches’ advantages, it performs remarkably well. In fact, if we don’t want persistence, it can be turned off for solely using it to cache, temporarily.
  3. Redis displays much of its performance to the point that the data always resides in-memory. It fascinates developers with the its ability of its Read/Write operations to outpace the capabilities of regular databases.
  4. The release of Redis version 2.0 featured capability to diffuse data, utilizing the Subscribe/Publish messaging protocol aka the ‘pub-sub’ model.
  5. CPU performace seldom becomes a bottleneck with Redis, since Redis is either Memory or Network bound. However, should such a scenario come about, horizontal/vertical scaling can help overcome any CPU related bottlenecks.
  6. Many industry leading companies you might have heard of use Redis. Some of these include: Twitter, Pinterest, and Github who has been an early adopter of the Redis project, like us at DLT Labs.
  7. Unlike traditional DBs like MongoDB, Redis allows transactions.
  8. Redis Persistence and RDB
    Point-In-Time snapshots your dataset at specified intervals (Data backup) in AOF fashion, logging every write operation received by the server.
    The result? Greater durability!
  9. Redis’ policy of snapshot / Redis background saving process is forked only when the server has no following execution for the command(s), thus guaranteeing any command that is reported as atomic in RAM is also atomic from a disk snapshot point of view.
  10. If you prefer using Java, ‘Jedis’ can be used which is a java client. Use this to connect your Java application with Redis.
    Please note: A single Jedis instance is not threadsafe! Hence to dodge these problems, ‘JedisPool’ is the option, which is a threadsafe pool of network connections with a default max connection pool size of 8.
  11. Redis stores data as key-value pairs, where certain types of data structures act as a key. Additionally, it allows objects’ cap their key and value at 512 Megabytes. This system of hashing keys, that is used in storing key-value pairs is known as Redis hash.
  12. Redis can handle up to 2³² keys and be tested in practice to handle a minimum of 250 million keys per instance. In other words, the limit to using Redis is likely the available memory in your machine/infrastructure.
  13. Every possible data structure for Redis can hold 2³² elements i.e. hash, list, set, and sorted sets can hit the peak with 2³² elements.
  14. Redis has client APIs developed in all popular languages — C, Ruby, Java, JavaScript, and Python.
  15. Nonetheless, Redis is by far the second easiest thing to set up, well don’t ask what’s the first one!

A Bonus Tip About Redis

To make Linux perform using a more efficient allocation manner (this is ideally what you want for Redis): Set overcommit_memory to 1.

Thanks for reading!

If you are unfamiliar with the topic of caching with Redis, you can read more about it here:

Author — Aman Gupta, DLT Labs

About the Author: Aman is part of the core DevOps & Infrastructure team at DLT Labs and is skilled in AWS, C++, DS-A, and open-source tools. He loves playing Badminton and enjoys e-gaming.

Written by

DLT Labs is a global leader in Distributed Ledger Technology and Enterprise Products. To know more, head over to: https://www.dltlabs.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store