The name Redis stands for Remote Dictionary Server. This type of server is designed for high-speed data storage. As a database management system (DBMS), Redis offers both an in-memory database and a key-value store.
- In-memory database: In these databases, the DBMS stores all data directly in the memory. This results in very fast access times, even for large amounts of unstructured data.
- Key-value store: Key-value databases are also impressive with their high performance and easy scalability due to their simple structure. A key is created for each entry which can then be used to retrieve the information.
So, all the data in a Redis server is not stored on the hard drive but in the memory instead. As a result, Redis is both a cache and a memory: it makes no difference for Redis whether the information is stored permanently in the database or only for a short time.
Every entry in the database is assigned a key. Using these keys, data can be easily retrieved. Entries are not linked to one another and thus do not need to be requested across multiple tables. The information is directly available.
Storing data in the memory also means that there is a risk of losing all the data if the server crashes. To safeguard against this eventuality, Redis can either copy all the data regularly to a backup hard drive or save all the commands needed for reconstruction in a log file.
Strings are the common data structure forRedis (i.e. simple character strings). Even keys (part of the key-value store) are strings. However, this system can also handle other data structures:
- Strings: a string of characters with a maximum size of 512 MB
- Hashes: an entry with multiple fields
- Lists: a collection of strings sorted based on the order they were entered
- Sets: an unsorted collection of strings
- Sorted sets: a user-sorted collection of strings
- Bitmaps: a collection of bit-level operations
- HyperLogLogs: an estimation based on unique values
- Streams: a list of strings or key-value pairs
Since Redis is open source, many developers are working on extensions for this DBMS. These modules add more functionality to the otherwise very simple database and adapt the software for specific applications.