Suggest an editImprove this articleRefine the answer for “Where does Redis store data by default?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)By default, Redis stores data in RAM, and for long-term persistence uses files on disk - but only as a backup copy of what's in memory, via RDB (snapshots, usually `dump.rdb`) or AOF (`appendonly.aof`, a log of every operation). **Key point:** Redis keeps its active data in the process's memory; by default it periodically snapshots that memory into a file inside `/var/lib/redis/`, and on restart it restores the data from that file back into memory.Shown above the full answer for quick recall.Answer (EN)ImageBy default, **Redis stores data in RAM**, and for **long-term persistence** it uses **files on disk**, but only as a *backup copy* of what's in memory. ### 1. The primary store is RAM Every key, value, and data structure lives **in the Redis process's memory**. That's exactly why Redis runs so fast: accessing RAM is instant, with no disk access needed. ### 2. Backup persistence Redis can save the contents of memory to disk in two ways: **(a) RDB (Redis Database File)** - creates *snapshots* of the data at set intervals; - the default file: ```javascript dump.rdb ``` - the default path: ```javascript /var/lib/redis/ ``` or (on Windows): ```javascript C:\Program Files\Redis\ ``` **(b) AOF (Append Only File)** - logs *every data-changing operation*; - the default file: ```javascript appendonly.aof ``` ### 3. Settings in the config file (`redis.conf`): ```javascript dir /var/lib/redis/ # the directory where files are stored dbfilename dump.rdb # the snapshot file's name appendonly yes # enable the AOF log (optional) ``` **Summary:** - Redis keeps its active data **in RAM**. - By default, it periodically **snapshots memory into a file**, `dump.rdb`, inside `/var/lib/redis/`. - On restart, Redis restores data from that file back into memory.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.