Codersee
Kotlin on the backend
Codersee
Kotlin on the backend
After reading this article, you will know precisely what exactly Redis database is, its advantages, disadvantages, as well as use-cases.
As the first article in a series explaining the top most popular databases, let’s take a closer look at the Redis database.
Redis is an open-source in-memory data structure store, widely used as a cache, key-value database, and message broker. Moreover, it is oftentimes ranked as the most popular key-value database and one of the top NoSQL databases.
Below you can check an explainer video for this post.
If you find this content useful, please leave a thumb up, or a sub. This way you can help me so that I can help you 😉
Before we dive into the Redis database details, let’s take a minute to learn more about its history.
Redis was created in 2009 by Salvatore Sanfilippo, also known as antirez. Its name comes from the Remote Dictionary Server and was created when antirez was working on a web logs analyzer for his startup. Initially, the prototype was written in the Tcl programming language and was later converted to C. After a couple of weeks, Salvatore open-sourced the project, which quickly gained popularity due to its speed, flexibility, and ease of use.
In 2015, Sanfilippo founded Redis Labs, a company that provides support, services, and products for Redis. Nevertheless, at the moment of writing, antirez is not a maintainer anymore and the company itself is called simply Redis.
With all of that being said, let’s learn how Redis works and what makes it different.
So, as mentioned above, Redis stores data in memory which makes it much faster than most DBMSs (which persist data to disk). But, does it really mean that the data are lost if the server running Redis restarts or goes down? Not exactly.
Redis was designed to combine ultra-fast data access and modification using in-memory storage with data persistence to disk. To prevent data loss, Redis supports writing data to disk using different storage options such as:
So, if the server restarts, the data are simply restored to memory from the disk space.
It’s worth mentioning, that although the Redis database comes with support for plenty of different data structures, it does not have support for queries known from other databases. It is a key-value store and, the commands (like GET or SCAN) are rather direct instructions than queries, which leverage indexes, etc.
Nextly, let’s take a look at a couple of Redis advantages:
So, with all of the benefits being covered, let’s take a look at the Redis disadvantages:
At this point, we know what are Redis advantages and drawbacks, so let’s take a look at what can it be used for:
As the last thing, let’s take a look at a couple of known companies, which use the Redis database.
When we look at the list of the most popular companies, that were the first to adopt Redis in their technology stack, we will see GitHub and Instagram.
Nowadays, when Redis database has a well-established position in the market and proved for many years that it can be trusted and can bring value to almost any project, it can be found on the backend of companies, like:
And that’s all for this article explaining what exactly the Redis database is. Together, we’ve learned more about Redis history, use cases, and advantages, as well as the disadvantages and the companies using it to deliver their products.
I hope you enjoy this series covering the most popular databases of 2022. If you enjoyed the content, please leave a comment in the section below.
Have a great day!