Redis is a data store that keeps everything in memory and looks it up by key, so it answers in a fraction of the time a database query takes.
It is fast because it skips the disk on every read, which is why so many apps put it between their code and their main database.
What Redis is
Redis is a server that holds a big dictionary in RAM. You send it a key, it sends back the value. There are no tables, no joins and no query planner working out how to fetch your data: a lookup by key goes straight to the value.
That design is where the speed comes from. Reading from memory is far quicker than reading from disk, and a key lookup does very little work. A relational database such as PostgreSQL is built for different jobs: storing data safely on disk, enforcing relationships and answering flexible questions with SQL. Redis gives up most of that flexibility in exchange for speed.
You talk to Redis with short commands. Here they are sent from the shell with redis-cli, the command-line client that ships with Redis:
redis-cli SET stock:tuna 5
redis-cli GET stock:tuna # "5"
redis-cli INCR stock:tuna # 6
redis-cli DEL stock:tunaThe stock:tuna name is just a convention. Redis has no folders, so teams use colons to group related keys, such as or .
Wondering how this was made? How we make these