Home›Learn›Redis 4: running it as a DBRE
Redis · Chapter 4

Running Redis as a DBRE

What do I look at first?

The few numbers I watch, the settings that change behavior, and the commands I use.

Chapter 4 · Running it

What I watch on Redis

Memoryused vs maxmemoryalert at 80%
Hit ratiomisses hit the databasewatch the trend
Slow commandsone thread for allany new SLOWLOG entry
Replicaslink up, offset closealert if a link is down

Example dashboard: the thresholds are starting points I would tune per system, and the colors are made up for the picture.

SignalWhy I watch itWhere it comes from
Memory used vs maxmemoryPast maxmemory Redis evicts or refuses writes, depending on the policy.INFO memory
Evicted keysA rising count means the cache is too small for the working set.INFO stats evicted_keys
Hit ratioMisses go to the main database. A falling ratio is load moving onto it.keyspace_hits and keyspace_misses
Slow commandsOne thread runs every command. One slow KEYS or big DEL stalls everyone.SLOWLOG GET
Replication linkA replica that is down or far behind is a failover that loses more.INFO replication
Last save statusA failed background save means a restart loses more than you think.rdb_last_bgsave_status
The settings that matter

Six settings decide what Redis is safe for

SettingDefaultWhat it trades
appendonlynoOff: only snapshots, so a crash loses everything since the last one. On: every write is logged.
appendfsynceverysecalways: a disk flush per write, safest and slowest. everysec: up to about a second of loss. no: the operating system decides, often about 30 seconds.
save3600 1 300 100 60 10000When RDB snapshots run: after an hour if 1 key changed, 5 minutes if 100, a minute if 10,000.
maxmemory0, no limitAlways set it, below the machine's memory, leaving room for the fork during a save.
maxmemory-policynoevictionFor a cache: allkeys-lru or allkeys-lfu. For data you must keep: noeviction, and an alert on memory.
WAIT and min-replicas-to-writenot usedWAIT makes one client wait until replicas have a write; min-replicas-to-write makes a primary refuse writes without replicas. Both narrow the loss window; neither makes Redis strongly consistent.
Check it yourself

The commands I run first

redis-cli INFO memory           # used_memory, maxmemory, mem_fragmentation_ratio
redis-cli INFO persistence      # rdb_last_bgsave_status, aof_enabled, aof_delayed_fsync, latest_fork_usec
redis-cli INFO replication      # role, connected replicas, offsets
redis-cli CONFIG GET appendfsync
redis-cli --bigkeys             # the biggest key of each type, by sampling
redis-cli MEMORY USAGE cart:42  # bytes for one key
redis-cli SLOWLOG GET 10        # the slowest recent commands
redis-cli LATENCY DOCTOR        # what caused recent latency spikes
Measured on this site

Notebooks 7 and 9, Redis 7.4.12, one client on the same machine

Versions and licences. Redis 7.4 moved to source-available licences (RSALv2 or SSPLv1). Valkey forked from 7.2.4 under the BSD licence in 2024, at the Linux Foundation, and AWS and Google Cloud offer managed Valkey. Redis 8 (2025) added AGPLv3 as an option, bundles JSON, search, time series and probabilistic types, and adds a vector set type. The current line is Redis 8.12 (November 2026). Everything on this page about memory, persistence and replication works the same in Valkey.

Next · chapter 5When it breaksPlaybooks, from the symptom to the fix← Chapter 3: High availability
Part 1 of 4 · Learn · 56 pagesAll pages

How do databases actually work? From one row on disk to transactions: the words you need, PostgreSQL, MySQL and MongoDB from the files up, then Redis, Cassandra and vector search, side by side, and the query and concurrency traps.

Start 1: the basicsStart 2: ten conceptsStart 3: how a query travelsStart 4: napkin mathThe courseShort videosPostgreSQL 1: why PostgreSQLPostgreSQL 2: how it stores your dataPostgreSQL 3: what happens on every writePostgreSQL 4: high availability with PatroniPostgreSQL 5: running it as a DBREPostgreSQL 6: when it breaksPostgreSQL on Kubernetes: CloudNativePGMySQL 1: why MySQLMySQL 2: how it stores your dataMySQL 3: what happens on every writeMySQL 4: high availability with InnoDB ClusterMySQL 5: running it as a DBREMySQL 6: when it breaksMySQL failover with OrchestratorMySQL on Kubernetes: the Percona operatorsMongoDB 1: why MongoDBMongoDB 2: how it stores your dataMongoDB 3: what happens on every writeMongoDB 4: high availability with replica setsMongoDB 5: running it as a DBREMongoDB 6: when it breaksMongoDB on Kubernetes: the Percona operatorB-tree and LSM treeRedis 1: why RedisRedis 2: how it stores your dataRedis 3: high availabilityRedis 4: running it as a DBRERedis 5: when it breaksCassandra 1: why CassandraCassandra 2: how it stores your dataCassandra 3: high availabilityCassandra 4: running it as a DBRECassandra 5: when it breaksVector databases 1: why vector searchVector databases 2: how it stores your dataVector databases 3: high availabilityVector databases 4: running it as a DBREVector databases 5: when it breaksDatabase familiesEngines side by sideQueries that look fine and are notLost updates and write skewMany servers 1: keep a copy runningMany servers 2: who is the leaderMany servers 3: CAP as settingsMany servers 4: unique IDsMany servers 5: split the dataMany servers 6: across servicesMany servers 7: a thousand databasesStaff path, zero to architect