Cơ BảnRedis iconRedis

Redis là gì và tại sao nó có tốc độ cực nhanh?

Redis (Remote Dictionary Server) là in-memory data structure store, thường được dùng làm cache, message broker, và session store.

  • Redis nhanh vì toàn bộ data được lưu trong RAM — tốc độ đọc/ghi RAM nhanh hơn disk hàng nghìn lần.
  • Ngoài ra, Redis dùng I/O multiplexing (epoll/kqueue) với event loop tương tự Node.js, tránh được overhead của context switching và lock contention.
  • Command execution vẫn single-threaded để đảm bảo atomicity.
  • Redis 7.x dùng multi-threaded I/O theo mặc định cho network (đọc/ghi socket), vẫn single-threaded cho command execution để tránh race condition.
  • Benchmark thông thường: Redis đạt 100,000-1,000,000 ops/giây tùy loại operation và hardware.

Xem toàn bộ Redis cùng filter theo level & chủ đề con.

Mở danh sách Redis