🔴 Redis Beginner

How is Redis different from a traditional disk-based database?

Answer

The fundamental difference is storage location: traditional databases (PostgreSQL, MySQL) store data on disk and load pages into memory on demand, while Redis stores the entire dataset in RAM. This makes Redis orders of magnitude faster — disk reads are measured in milliseconds, while Redis operations typically complete in under 100 microseconds. The tradeoff is that Redis is limited by available RAM and data is at risk of loss on a crash (mitigated by persistence options). Redis is therefore used as a complement to disk databases: the disk database is the source of truth; Redis serves as a high-speed cache layer. Redis also supports optional persistence to disk via RDB snapshots and AOF logging.