LLMpediaThe first transparent, open encyclopedia generated by LLMs

Redis

Generated by DeepSeek V3.2
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Graviton (processor) Hop 4
Expansion Funnel Raw 38 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted38
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
Redis
NameRedis
DeveloperRedis Ltd.
Released10 May 2009
Operating systemCross-platform
GenreIn-memory database, data structure store
LicenseRedis Source Available License (RSALv2) / Server Side Public License (SSPLv1)

Redis. Redis is an open-source, in-memory data structure store, used as a database, cache, message broker, and streaming engine. Created by Salvatore Sanfilippo and initially released in 2009, it supports various data structures such as strings, hashes, lists, sets, and sorted sets. The project is primarily developed and maintained by Redis Ltd., and it is renowned for its high performance, flexibility, and wide adoption in the technology industry.

Overview

Redis operates primarily as an in-memory key-value database, offering optional persistence to disk. It is often categorized as a NoSQL database and is written in the C (programming language). The system is designed for speed, storing its dataset in RAM to enable low-latency data access, which makes it exceptionally suitable for use cases requiring real-time performance. Its architecture is single-threaded, which simplifies implementation while leveraging efficient I/O multiplexing and an event-driven model. Redis is commonly deployed as a distributed cache to accelerate applications, a role in which it frequently complements traditional relational databases like MySQL or PostgreSQL. Major technology companies, including Twitter, GitHub, and Snapchat, have integrated Redis into their infrastructure to handle high-throughput scenarios.

Data structures

Unlike simple key-value stores, Redis provides a rich set of data structures, which gives it significant versatility. The fundamental types include strings, which can hold text, JSON, or binary data; lists, which are ordered collections implemented as linked lists; and sets, which are unordered collections of unique strings. Redis also supports hashes, which are maps between string fields and values, and sorted sets, where each member is associated with a score for ordering. Additional advanced structures include bitmaps for bit-level operations, HyperLogLog for probabilistic cardinality estimation, and streams for append-only log data. These structures are exposed through a comprehensive command set, allowing for atomic operations like appending to a list, incrementing a hash value, or performing set intersections, which reduces the need for complex application-side logic.

Persistence

While Redis keeps data in memory for speed, it offers mechanisms to persist datasets to non-volatile storage to prevent data loss. The primary method is snapshotting, where the entire dataset is asynchronously written to a binary file on disk, known as an RDB (Redis Database) file, at configured intervals. An alternative is append-only file (AOF) persistence, which logs every write operation received by the server in a durable log file, providing finer granularity and stronger durability guarantees. These persistence options can be used independently or combined, allowing administrators to trade off between performance and data safety according to application requirements. The persistence model is a key differentiator from purely ephemeral caches like Memcached.

Replication and clustering

Redis supports master-replica replication to provide data redundancy and improve read scalability. In this model, a primary node handles all write operations, which are then asynchronously propagated to one or more replica nodes. Replicas can serve read requests, offloading the master, and can be promoted to master in case of failure. For horizontal scaling and automatic partitioning of data across multiple nodes, Redis employs Redis Cluster, a distributed implementation that shards data across up to 16384 slots. Redis Cluster provides high availability through automatic failover, managed by a consensus protocol, and does not require external coordination services like Apache ZooKeeper. Additional tools for management and scaling are provided by projects like Redis Sentinel for monitoring and failover, and by commercial offerings from Redis Ltd..

Performance and use cases

Benchmarks often show Redis capable of handling hundreds of thousands of operations per second on modest hardware, with latency typically under a millisecond. This performance profile makes it ideal for session storage in web applications, real-time analytics, leaderboard systems using sorted sets, and job queueing with its list and pub/sub capabilities. It is frequently used as a caching layer in front of slower storage systems, a pattern popularized by frameworks like Ruby on Rails and Django (web framework). In microservices architectures, Redis Streams can facilitate event-driven communication. Its speed also enables use in geospatial indexing and querying through dedicated commands.

Licensing and development

Originally released under the permissive BSD 3-clause license, Redis transitioned to a dual-license model in 2024. The new licenses are the Redis Source Available License (RSALv2) and the Server Side Public License (SSPLv1), which are more restrictive than open-source licenses approved by the Open Source Initiative. This change, led by Redis Ltd., was motivated by commercial considerations and affects cloud provider offerings. The core development is steered by the company, with significant contributions from the open-source community. The project's evolution continues to add features like TLS encryption, ACLs for security, and enhanced modules system for extensibility, maintaining its position as a critical infrastructure component.

Category:Database management systems Category:NoSQL Category:Free software programmed in C