Script Valley
Redis: Complete Course
Redis FundamentalsLesson 1.1

What is Redis and why use it instead of a database

in-memory data store, key-value model, Redis vs relational DB, Redis vs Memcached, use cases, persistence overview

What is Redis?

Redis (Remote Dictionary Server) is an open-source, in-memory data structure store. It holds data in RAM, which makes reads and writes orders of magnitude faster than disk-based databases — typical latency is under 1 ms.

Redis vs a relational database

A relational DB like PostgreSQL is optimised for complex queries, joins, and ACID transactions across structured data. Redis is optimised for speed. You reach for Redis when you need a counter, a cache, a queue, a leaderboard, or a session store — not when you need to run a multi-table JOIN.

Redis is not a replacement for your primary database. It is a layer that sits in front of it to absorb hot reads and fast writes.

Redis vs Memcached

Both are in-memory caches, but Redis ships with richer data types (lists, sets, sorted sets, hashes, streams), optional persistence to disk, replication, Lua scripting, and Pub/Sub. Memcached is simpler and slightly faster at pure string caching; Redis wins everywhere else.

Core use cases

Caching database query results, storing user sessions, rate limiting API endpoints, real-time leaderboards, job queues, and pub/sub messaging are the most common production uses.

# Confirm Redis is reachable
redis-cli ping
# → PONG

Up next

How to install Redis on Linux, macOS, and Docker

Sign in to track progress