Because RAM is volatile, Redis offers two ways to survive a restart. RDB takes point-in-time snapshots of the whole dataset on a schedule, which is compact and fast to load but can lose the writes since the last snapshot. AOF (append-only file) logs every write command and replays it on startup, which loses less data but produces larger files. Many production setups run both.
Single-key atomicity covers simple cases, but Redis also gives you MULTI/EXEC transactions and Lua scripts that run server-side as one atomic block. Scripts are the common way to do read-then-write logic, like a rate limiter or a leaderboard update, without a race between two clients.
For scale and availability, Redis replicates from a primary to one or more read replicas asynchronously. Redis Sentinel watches the primary and promotes a replica if it dies. Redis Cluster goes further by sharding the keyspace across 16,384 hash slots spread over multiple primaries, so the dataset can outgrow a single machine's memory.
Keys can carry a TTL. Set a key to expire in 60 seconds and Redis removes it for you, which is how it behaves as a cache. When memory fills up, an eviction policy such as allkeys-lru or volatile-ttl decides what to drop.