Redis
Redis is an open-source, in-memory data structure store, often used as a database, cache, and message broker, distinguished by its support for diverse data type...
Redis (Remote Dictionary Server) is an open-source, in-memory data structure store, used as a database, cache, and message broker. It supports various data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries, and streams. Redis is renowned for its speed, as it primarily operates in memory, allowing for sub-millisecond latency for read and write operations. Its persistence can be configured through different mechanisms: Snapshotting (RDB), which saves point-in-time snapshots of the dataset, and Append Only File (AOF), which logs every write operation received by the server. Redis also offers high availability and fault tolerance through Redis Sentinel, which provides monitoring, notification, and automatic failover, and Redis Cluster, which provides a way to run a Redis installation where data is sharded across multiple nodes, offering horizontal scalability and high availability. Its publish/subscribe capabilities make it suitable for real-time messaging systems and event-driven architectures. Redis is widely adopted for use cases like session management, real-time leaderboards, caching frequently accessed data, and message queuing.
graph LR
Center["Redis"]:::main
Pre_nosql["nosql"]:::pre --> Center
click Pre_nosql "/terms/nosql"
Rel_cache["cache"]:::related -.-> Center
click Rel_cache "/terms/cache"
Rel_nginx["nginx"]:::related -.-> Center
click Rel_nginx "/terms/nginx"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Простими словами
Redis — це як короткочасна пам'ять вашого комп'ютера, але для спільних даних. Він пам'ятає речі неймовірно швидко, тому що йому не потрібно записувати їх у постійний блокнот (жорсткий диск) кожного разу.
🤓 Expert Deep Dive
Redis є однопотоковим, що запобігає станам гонитви (race conditions), використовуючи неблокуючий I/O мультиплексування. Він підтримує Pub/Sub, Lua-скрипти та транзакції. Redis Cluster дозволяє автоматичне шардування.