31 articles
Knowledge Base
Redis
31 articles in the Redis category · page 1 of 2.
- Redis persistence — RDB vs AOF tradeoffs Choose the right Redis persistence setup by weighing how much data you can lose in a crash against how fast Redis must restart. For a primary data store the answer is usually to run RDB snapshots and the AOF log together, and the article shows how to configure, test and back up that setup.
- Redis TTL patterns: expiration, eviction and their traps Choose the right Redis TTL pattern for each kind of key, add jitter so keys do not expire together, and see why eviction policy is a separate decision.
- Redis Stack — what is bundled and when to choose it over OSS Redis Learn what Redis Stack gives you beyond plain Redis, how to install it on Ubuntu, and when Redis OSS or the Valkey fork is the better choice. This guide covers the four bundled modules and what the 2024 licence change means for your deployment.
- Redis ACLs — users, roles, and least-privilege access control Learn how to set up Redis ACLs so every application logs in as its own user with only the commands and keys it needs. This guide covers creating those users, saving them to an aclfile, and rotating a password safely.
- Redis Pub/Sub vs Streams — choosing between fire-and-forget and durable logs Learn when Redis Pub/Sub is the right choice and when Redis Streams is, so you can pick the mode that matches how your service handles messages. You will also see how to move from Pub/Sub to Streams without dropping messages.
- WordPress Site Health: "You should use a persistent object cache" What the WordPress persistent object cache notice actually checks, when ignoring it is the correct answer, and how to satisfy it properly with Redis without breaking the site.
- Redis memory fragmentation: reading INFO memory and using activedefrag How to tell real Redis memory fragmentation apart from swapping, copy-on-write during BGSAVE, and client buffer growth, then roll out activedefrag safely or fail over and restart instead.
- Redis keyspace notifications and expired events — how to configure them and where they stop being reliable Composing the notify-keyspace-events flag string, subscribing to the keyspace and keyevent channel families, why an expired event lags the TTL, what replication and Cluster change, and when to reach for a Stream consumer group instead.
- Why MONITOR ruins production — and what to use instead Understand why redis-cli MONITOR degrades a busy Redis to a crawl, when it is safe to use, and which tools (slowlog, latency, INFO commandstats) belong in your toolkit instead.
- Redis Sentinel deep dive — automatic failover end to end How Sentinel detects master failure, runs leader election, promotes a replica, reconfigures the topology, and notifies clients — with the timing knobs that actually matter.
- Setting up Redis Cluster mode with sharding and replication Bootstrap a six-node Redis Cluster, understand the 16384 hash-slot model, configure replicas per master, and verify cluster health before any traffic is routed.
- Installing Redis on Ubuntu with persistence and authentication Install Redis 7 on Ubuntu, choose between apt and source builds, configure password auth and bind interfaces, and verify with redis-cli before going live.
- Redis Lua scripting with EVAL and EVALSHA Write atomic Lua scripts for Redis, load with EVAL/SCRIPT LOAD, pass KEYS and ARGV correctly, and avoid the blocking and replication pitfalls in production.
- Testing Redis Sentinel failover without breaking production Build a regular failover-drill routine for Sentinel-managed Redis: planned failover, kill-the-master tests, client-side validation, and the metrics to watch.
- Redis Functions — server-side libraries that replace EVAL scripting Use Redis 7 Functions to register named libraries of Lua functions that persist across restarts, replicate cleanly, and replace the EVALSHA reload dance.
- Tuning Redis replication — buffers, backlog, and partial sync Size the replication backlog, tune client-output-buffer-limit replica, understand PSYNC vs FULLSYNC, and avoid the cascade of full resyncs on a saturated link.
- RedisGraph — what it did, why it was deprecated, and migration paths Understand RedisGraph (the property-graph module), its Cypher-compatible query model, why Redis Inc. ended support in 2023, and how to migrate to a supported graph database.
- Deploying Redis 7 with Sentinel for automatic failover on Ubuntu 22.04 Stand up a hardened Redis 7 cluster with 1 primary + 2 replicas + 3 Sentinels on Ubuntu 22.04 — AOF persistence, ACL, TLS, automatic failover under quorum.
- Redis eviction policies — choosing between LRU, LFU, TTL and noeviction Compare allkeys-lru, allkeys-lfu, volatile-lru, volatile-ttl, and noeviction with the workload signatures each fits and the failure modes when the wrong one is chosen.
- Redis persistence — RDB and AOF, configured for the workload Understand RDB snapshots vs AOF append-only files, the durability trade-offs, the fsync policies, and the production combination that gets you both fast restore and minimal data loss.
- Redis Sentinel — high availability for single-shard Redis Configure a three-node Sentinel deployment that monitors a primary-replica Redis pair, performs automatic failover, and lets clients discover the current primary.
- Redis memory tuning — sizing maxmemory, fragmentation, and overhead Size maxmemory correctly by accounting for COW, TLS buffers, replication overhead and fragmentation; read INFO memory; tune jemalloc and active defrag.
- Redis TLS encryption for client and replication traffic Issue certificates, configure tls-port and tls-cert-file, enable replication and cluster bus TLS, and connect clients with redis-cli --tls and a CA bundle.
- Debugging the BUSY error from a long-running Redis Lua script Diagnose and recover from BUSY Redis is busy running a script: SCRIPT KILL, SHUTDOWN NOSAVE, busy-script-timeout, and the patterns that prevent recurrence.