舫摘

知人者智 自知者明 胜人者有力 自胜者强

0%

Why is Redis so fast?

The diagram below shows 3 main reasons:

  • Redis is RAM-based. Access to RAM is at least 1000 times faster than access to random disks. Redis can be used as a cache to improve application responsiveness and reduce database load when used as a cache.

  • Redis implements IO multiplexing and single-threaded execution.

  • A number of efficient lower-level data structures are leveraged by Redis. By keeping these data structures in memory, serialization and deserialization costs are reduced.

SortedSet, for example, makes the implementation of leaderboards so simple and efficient. On the other hand, a bitmap can be used to aggregate month-over-month login statuses.