Redis: open-source In-Memory Database
Redis is an open source in-memory data structure store, used as a database, cache and message broker that supports many types of data structures.
It is considered being one of the fastest in-memory key-value database.
Redis is a popular choice for caching, session management, gaming, leaderboards, real-time analytics, geospatial, ride-hailing, chat/messaging, media streaming, and pub/sub apps.
- Redis can deliver sub-millisecond response times enabling millions of requests per second for real-time applications.
- A typical Redis instance running on a low end, untuned box usually provides good enough performance for most applications.
- Being single-threaded, Redis favors fast CPUs with large caches and not many cores.
- Redis employs a primary-replica architecture and supports asynchronous replication where data can be replicated to multiple replica servers.
- Redis supports various data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams.
- It has built-in replication, LRU eviction and different levels of on-disk persistence.
- Other features include:
- Lua scripting
- Keys with a limited time-to-live
Project Design and Security
- Redis supports atomic operations on data types, like appending to a string; incrementing the value in a hash; pushing an element to a list; computing set intersection, union and difference; or getting the member with highest ranking in a sorted set.
- It works with an in-memory dataset that can persists by dumping the dataset to disk.
- All Redis data resides in-memory, in contrast to databases that store data on disk or SSDs.
- By eliminating the need to access disks, in-memory data stores such as Redis avoid seek time delays and can access data in microseconds.
- The redis syslog offers a very good logging facility with all the necessary information to run daily or debug
## Sample Configuration for Redis @ /etc/redis/redis.conf
save 900 1
save 300 10
save 60 10000
# appendfsync always
# appendfsync no
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60