redis overview
TRANSCRIPT
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
Problem
With a 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
The Creation of Redis
Solution● In-memory data store
● Storing lists as a native data type
● Implementing using C language
● Adding fork-based persistence feature
10
The Creation of 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!
24
RDB (Redis Database)
Advantages● Perfect for backup and transfer● Maximum performance
- Child process: Persist on disk
- Parent process: No I/O
25
RDB (Redis Database)
Disadvantages● Cannot minimize the chance of data loss● fork() can be time consuming if the dataset is big
27
AOF (Append Only File)
● Logs every write operation received by the server● Plays again operation at server startup to reconstruct
the original dataset
28
AOF (Append Only File)
Advantages● Durability (sync every second, every query)● No seek is required● Automatically rewrite AOF in background when it
gets too big
29
AOF (Append Only File)
Disadvantages● Files are usually bigger than RDB files.● Can be slower than RDB● Rare bugs in specific commands
31
References
T NG QUAN V REDIS Ổ Ề http://tech.blog.framgia.com/vn/?p=3365
@dinhhoanglong91