This document provides an overview of Redis, including its creation, features, and persistence methods. Redis is an open-source, in-memory key-value store that was created by Salvatore Sanfilippo to solve the problem of storing real-time page view data from multiple websites. It features different data types that can be stored as keys, master-slave replication for availability, and two persistence methods: RDB, which takes periodic snapshots of the dataset, and AOF, which logs all write operations to reconstruct the dataset from disk on startup.
6
The Creationof Redis
The story of Salvatore Sanfilippo (antirez)
Creator of Redis
7.
7
Business
●Receiving a stream of page views from multiple websites.
● Storing the latest n page views for every site
● Show latest page views in real time to users
● Maintaining history
8.
8
Problem
Witha peak load of a few thousand page views per second
● Whatever the database schema was
● Whatever trade-offs is
→ No way for storing by SQL
9.
9
The Creationof Redis
Solution
● In-memory data store
● Storing lists as a native data type
● Implementing using C language
● Adding fork-based persistence feature
10.
10
The Creationof Redis
Solution
● In-memory data store
● Storing lists as a native data type
● Implementing using C language
● Adding fork-based persistence feature
→ Finally, Redis was born!
11.
11
Redis Features
● Data Model
● Master/Slave Replication
● In-memory
27
AOF (AppendOnly File)
● Logs every write operation received by the server
● Plays again operation at server startup to reconstruct
the original dataset
28.
28
AOF (AppendOnly File)
Advantages
● Durability (sync every second, every query)
● No seek is required
● Automatically rewrite AOF in background when it
gets too big
29.
29
AOF (AppendOnly File)
Disadvantages
● Files are usually bigger than RDB files.
● Can be slower than RDB
● Rare bugs in specific commands