|Original author(s)||Salvatore Sanfilippo|
|Initial release||May 10, 2009|
5.0.5 / May 15, 2019
|Written in||ANSI C|
|Operating system||POSIX systems,|
|Type||Data structure store, key-value database|
Redis (//; Remote Dictionary Server) is an in-memory data structure project implementing a distributed, in-memory key-value database with optional durability. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, HyperLogLogs, bitmaps, streams, and spatial indexes. The project is mainly developed by Salvatore Sanfilippo and as of 2019[update], is sponsored by Redis Labs. It is open-source software released under a BSD 3-clause license.
The name Redis means REmote DIctionary Server. The Redis project began when Salvatore Sanfilippo, nicknamed antirez, the original developer of Redis, was trying to improve the scalability of his Italian startup, developing a real-time web log analyzer. After encountering significant problems in scaling some types of workloads using traditional database systems, Sanfilippo began to prototype a first proof of concept version of Redis in Tcl. Later Sanfilippo translated that prototype to the C language and implemented the first data type, that was the list. After a few weeks of using the project internally with success, Sanfilippo decided to open source it, announcing the project on Hacker News. The project began to get traction, more so among the Ruby community, with GitHub and Instagram being among the first companies adopting it.  
In October 2018 Redis 5.0 was released, introducing Redis Stream - a new data structure that allows storage of multiple fields and string values with an automatic, time-based sequence at a single key.
Differences with other database systems
Redis made popular the idea of a system that can be considered at the same time a store and a cache, using a design where data is always modified and read from the main computer memory, but also stored on disk in a format that is unsuitable for random access of data, but only to reconstruct the data back in memory once the system restarts. At the same time, Redis provides a data model that is very unusual compared to relational database management system (RDBMS), as user commands do not describe a query to be executed by the database engine, but specific operations that are performed on given abstract data types, hence data must be stored in a way which is suitable later for fast retrieval, without help from the database system in form of secondary indexes, aggregations or other common features of traditional RDBMS. The Redis implementation makes heavy use of the Fork (system call), to duplicate the process holding the data, so that the parent process continues to serve clients, while the child process creates a copy of the data on disk.
According to monthly DB-Engines rankings, Redis is often the most popular key-value database. Redis has also been ranked the #4 NoSQL database in user satisfaction and market presence based on user reviews, the most popular NoSQL database in containers, and the #1 NoSQL database of 2015 by ranking website stackshare.io. It was voted most loved database in the Stack Overflow Developer Survey in 2017, 2018 and 2019.
- Lists of strings
- Sets of strings (collections of non-repeating unsorted elements)
- Sorted sets of strings (collections of non-repeating elements ordered by a floating-point number called score)
- Hash tables where keys and values are strings
- HyperLogLogs used for approximated set cardinality size estimation, available since Redis 2.8.9 in April 2014.
- Stream of entries with consumer groups, allows you to store multiple fields and string values with an automatic, time-based sequence at a single key, available since Redis 5.0 in October 2018
- Geospatial data through the implementation of the geohash technique, available since Redis 3.2.
The type of a value determines what operations (called commands) are available for the value. Redis supports high-level, atomic, server-side operations like intersection, union, and difference between sets and sorting of lists, sets and sorted sets.
Redis typically holds the whole dataset in memory. Versions up to 2.4 could be configured to use what they refer to as virtual memory in which some of the dataset is stored on disk, but this feature is deprecated. Persistence is now achieved in two different ways: one is called snapshotting, and is a semi-persistent durability mode where the dataset is asynchronously transferred from memory to disk from time to time, written in RDB dump format. Since version 1.1 the safer alternative is an append-only file (AOF), a journal that is written as operations modifying the dataset in memory are processed. Redis can rewrite the append-only file in the background to avoid an indefinite growth of the journal.
By default, Redis writes data to a file system at least every 2 seconds, with more or less robust options available if needed. In the case of a complete system failure on default settings, only a few seconds of data would be lost.
Redis supports master-replica replication. Data from any Redis server can replicate to any number of replicas. A replica may be a master to another replica. This allows Redis to implement a single-rooted replication tree. Redis replicas can be configured to accept writes, permitting intentional and unintentional inconsistency between instances. The publish/subscribe feature is fully implemented, so a client of a replica may subscribe to a channel and receive a full feed of messages published to the master, anywhere up the replication tree. Replication is useful for read (but not write) scalability or data redundancy.
When the durability of data is not needed, the in-memory nature of Redis allows it to perform well compared to database systems that write every change to disk before considering a transaction committed. Redis operates as a single process and is single-threaded or double-threaded when it rewrites the AOF (append-only file). Thus, a single Redis instance cannot use parallel execution of tasks such as stored procedures.
Redis introduced clustering in April 2015 with the release of version 3.0. The cluster specification implements a subset of Redis commands: all single-key commands are available, multi-key operations (commands related to unions and intersections) are restricted to keys belonging to the same node, and commands related to database selection operations are unavailable. A Redis cluster can scale up to 1,000 nodes, achieve "acceptable" write safety and to continue operations when some nodes fail.
Due to the nature of the database design, typical use cases are session caching, full page cache, message queue applications, leaderboards and counting among others. Large companies such as Twitter are using Redis, Amazon Web Services is offering Redis in its portfolio, and Microsoft is offering the Redis Cache in Azure.
Some companies have used Redis and created commercial offerings around it:
- Redis Enterprise Software, from Redis Labs
- Redis Cloud Essentials, and Redis Cloud Pro, from Redis Labs
- ElastiCache, from Amazon Web Services
- Azure Cache, from Microsoft Azure
- Cloud Memorystore for Redis, from Google Cloud Platform
On August 22, 2018, Redis Labs relicensed some Redis Modules under a combination of the Apache License 2.0 and the Commons Clause, which is a source-available arrangement that prohibits users from selling the software. Redis Modules were formerly licensed under the Affero General Public License.
- Bernardi, Stefano (January 4, 2011). "An interview with Salvatore Sanfilippo, creator of Redis, working out of Sicily". EU-Startups. Menlo Media.
- Haber, Itamar (July 15, 2015). "Salvatore Sanfilippo: Welcome to Redis Labs". Redis Labs.
- Sanfilippo, Salvatore. "Redis 5.0 release notes". GitHub. Retrieved 2019-04-30.
- "Introduction to Redis".
Redis is written in ANSI C and works in most POSIX systems like Linux, *BSD, OS X without external dependencies.
- "Copying". GitHub.
- "FAQ: Redis". Redis.io.
- "Google Groups". groups.google.com.
- Kepes, Ben (July 15, 2015). "Redis Labs hires the creator of Redis, Salvatore Sanfilippo". Network World. Retrieved August 30, 2015.
- Sanfilippo, Salvatore (April 28, 2017). "Tcl prototype of Redis". GitHub Gist. Retrieved October 8, 2018.
- Wanstrath, Chris (November 3, 2009). "Introducing Resque". Blog. Retrieved October 8, 2018.
- Krieger, Mike (October 31, 2011). "Storing hundreds of millions of simple key-value pairs in Redis". Instagram Engineering Blog. Retrieved October 8, 2018.
- Shapira, Gwen (March 17, 2010). "VMware Hires Redis Key Developer – But Why?". Blog. Retrieved September 25, 2016.
- Sanfilippo, Salvatore (March 15, 2010). "VMware: the new Redis home". Blog. Retrieved September 25, 2016.
- Collison, Derek (March 15, 2010). "VMware: The Console: VMware hires key developer for Redis". VMware Blog. Archived from the original on March 22, 2010. Retrieved September 25, 2016.
- Sanfilippo, Salvatore. "Redis Sponsors". Redis.io. Redis Labs. Retrieved April 11, 2019.
- Sanfilippo, Salvatore (July 15, 2015). "Thanks Pivotal, Hello Redis Labs". <antirez>. Retrieved 2019-04-03.
- "DB-Engines Ranking - popularity ranking of key-value stores". DB-Engines.
- "Best NoSQL Databases: Fall 2015 Report from G2 Crowd". G2 Crowd.
- "8 Surprising Facts about Real Docker Adoption". Datadog.
- "Top 50 Developer Tools & Services of 2015 - StackShare". StackShare.
- "Developer Survey Results 2019: Most Loved, Dreaded, and Wanted Databases". Stack Overflow. Stack Exchange. Retrieved 2018-11-10.
- "EVAL – Redis". redis.io.
- "Redis". redis.io.
- Lewis, B. W. (5 July 2015). "rredis: "Redis" Key/Value Database Client". The Comprehensive R Archive Network. Retrieved 2019-04-03.
- "Redis 3.2 Release Notes". GitHub. Retrieved 2017-03-10.
- "ReJSON - a JSON data type for Redis". oss.redislabs.com.
- "Virtual Memory". Redis.io. Retrieved April 11, 2019.
- "Google Code Archive - Long-term storage for Google Code Project Hosting". code.google.com.
- "Redis on the Raspberry Pi: adventures in unaligned lands - <antirez>". antirez.com.
- "Redis 3.0 Release Notes". Retrieved 2017-03-10.
- "Cluster Spec". Retrieved 2017-03-10.
- "Cluster Spec". Retrieved 2017-03-10.
- "Cluster Tutorial". Retrieved 2017-03-10.
- "Top 5 Redis use cases - ObjectRocket". ObjectRocket. Rackspace. 7 November 2017.
- "How Twitter Uses Redis to Scale - 105TB RAM, 39MM QPS, 10,000+ Instances - High Scalability". Highscalability.com.
- "Azure Redis Cache - Redis cache cloud service - Microsoft Azure". azure.microsoft.com.
- "Memorystore: Google Cloud". cloud.google.com.
- "Commons Clause License". Commons Clause License. Retrieved 2018-08-24.
- Asay, Matt. "Why Redis Labs made a huge mistake when it changed its open source licensing strategy". TechRepublic. CBS Interactive. Retrieved 2018-08-24.
- Shoolman, Yiftach (5 July 2016). "Why Redis Labs' Modules are AGPL". Redis Labs. Retrieved 2018-08-24.
- Claburn, Thomas. "Redis has a license to kill: Open-source database maker takes some code proprietary". The Register. Retrieved 2018-08-24.
- Jeremy Zawodny, Redis: Lightweight key/value Store That Goes the Extra Mile, Linux Magazine, August 31, 2009
- Isabel Drost and Jan Lehnard (29 October 2009), Happenings: NoSQL Conference, Berlin, The H. Slides for the Redis presentation. Summary.
- Billy Newport (IBM): "Evolving the Key/Value Programming Model to a Higher Level" Qcon Conference 2009 San Francisco.
- A Mishra: "Install and configure Redis on Centos/ Fedora server".
- E. Mouzakitis: "Monitoring Redis Performance"