TAG
Redis
32 notes
- 1.1 Redishistorical
Redis is a K-V in-memory database. Compared with Memcached, it has two characteristics: rich data structures and persistence.
- 1.2 Redis Installationhistorical
These notes record Redis source download, build prerequisites, and installation commands from compilation to startup.
- 1.3 Redis Persistencehistorical
Redis Persistence: Redis data is stored in memory. Once it crashes, all data in memory is lost. Therefore, the data in memory needs to be persisted to disk so it can be recovered after a crash.
- 1.4 Redis Transactionshistorical
Redis transactions execute a group of commands in order. These notes examine command grouping, visibility to other clients, and related operations.
- 1.5 Redis Pipelinehistorical
Redis uses a request-response model in which sequential waits create repeated network round trips. These notes explain how pipelining batches commands.
- 1.6 Redis Pub/Subhistorical
Redis Pub/Sub delivers messages through channels from publishers to subscribers. Command examples illustrate the publishing and subscription relationship.
- 1.7 Redis Luahistorical
Redis can execute Lua scripts on the server. These notes use KEYS and ARGV examples to record script execution and debugging.
- 1.8 Analyzing Redis with Wiresharkhistorical
These notes select the local interface in Wireshark and filter by the Redis port to inspect client-server communication.
- 1.9 Redis Client Connection Handlinghistorical
After accepting a connection, Redis creates and configures client state. These notes trace the server's handling step by step.
- 1.10 Redis Signal Handlinghistorical
On a shutdown signal, Redis handles persistence subprocesses and data saving. These notes record graceful shutdown step by step.
- 1.11 Redis Benchmarkinghistorical
These notes record loading Lua through redis-cli and running load tests with redis-benchmark, including the relevant commands.
- 1.12 Cloud Redishistorical
Cloud Redis adds VIPs, load balancers, and proxies around a Redis cluster. These notes examine their roles in addressing, health checks, and request distribution.
- 2.1 Redis BloomFilterhistorical
Redis BitMaps can hold a Bloom filter's bit array. These notes examine expanding the structure after it reaches a capacity threshold.
- 2.2 Redis RateLimiterhistorical
These notes implement rate limiting with Redis, storing counts or state under keys and using parameters to decide whether requests can proceed.
- 2.3 Redis Data Structureshistorical
Redis uses dictionaries for database key-value storage and objects for concrete data types. These notes connect redisDb, dict, and redisObject.
- 2.4 Redis Asynchronous Queuehistorical
An asynchronous queue orders data first in, first out and buffers it between production and consumption. These notes record an implementation using Redis.
- 2.5 Redis Distributed Lockshistorical
Redis distributed locks coordinate instances through conditional writes and related operations. These notes begin with setting an absent key and examine acquisition and release.
- 2.6 Redis Key Design Tipshistorical
Redis keys can be organized by table, primary key, and value. Command examples record naming and storage approaches for different fields.
- 2.7 Redis Commandshistorical
Redis provides commands to find and manipulate keys. These notes begin with pattern matching in keys and record common commands and wildcards.
- 3.1 Redis Thread Modelhistorical
Redis organizes requests through sockets, I/O multiplexing, an event dispatcher, and handlers. These notes examine its threading model through those components.
- 3.2 Redis Concurrency Competitionhistorical
Two clients reading and updating the same value can race. These notes use concurrent price increments to examine unexpected update results.
- 3.3 Redis Slow Querieshistorical
Redis requests pass through sending, queuing, execution, and response stages. These notes distinguish their costs and the execution time tracked by slow queries.
- 3.4 Redis Blockinghistorical
Redis is blocked when it cannot respond to clients for an extended period. These notes examine blocking operations and troubleshooting through its command-execution thread.
- 3.5 Redis bigkeyhistorical
Big keys concern Redis values that occupy substantial space. These notes record identification methods and thresholds by data type.
- 3.6 Redis hotkeyhistorical
A single key can create a hotspot when its requests concentrate on one Redis instance. These notes examine hot-key detection and handling through QPS.
- 4.1 Redis Clusterhistorical
Redis Cluster distributes data to scale writes and uses replicas for failure handling. These notes introduce cluster structure through the limits of replication alone.
- 4.2 Redis Sentinelhistorical
Leader-follower replication alone does not perform automatic failover. Redis Sentinel monitors and coordinates switching to provide high availability.
- 4.3 Redis Replicationhistorical
Redis replication copies data to other machines. These notes use that foundation to connect leader-follower replication with high-availability mechanisms.
- 5.1 Redis Key Expiration Strategyhistorical
Setting a Redis key's expiry also raises the question of when data is actually removed. These notes examine expiry handling starting with the expire command.
- 5.2 Redis Memory Managementhistorical
Redis memory usage can be divided into process overhead, objects, and buffers. These notes organize observation and analysis around those components.
- 5.3 Redis Memory Eviction Strategyhistorical
When Redis reaches its configured memory limit, the selected policy determines what happens next. These notes examine the behavior of different eviction policies.
- 5.4 Redis Memory Optimizationhistorical
Redis selects encodings according to data size and content, affecting memory usage. These notes examine memory reduction through configuration and compact encodings.