Redis is an in-memory database
In the field of databases there are some “NoSQL databases”. Redis – the abbreviation for Remote Dictionary Server – is a typical example, it is attributable to the key-value stores. Numerous databases – and Redis too – are now part of the growing “NoSQL group”. Although the available systems may differ on a theoretical basis, they are all similar in project requirements in terms of target scalability, distributed data storage and flexible storage modes for data content. NoSQL databases like Redis can be divided into four groups: on the one hand, key-value store and column oriented databases, and on the other document-oriented databases and graph databases.
The key-value stores represent the simplest forms that always store the data that needs to be saved only in the form of a key-value pair. The key references a value. The simplicity, which in principle is not too different than a shelf in an operating system files, and which has been available for years in embedded databases, can also be used with “stand alone” NoSQL databases.
If you would like to find out the application area for key value databases like Redis, then its best to gravitate towards the phrase ‘key-value’. When it comes to the storage and retrieval of data in the same form as always – namely ‘save a data set according to a specific ID’, such as ‘read exactly this data set to the respective ID’, which requires the data set to be connected with other data in a complex way – and the number of these operations can be high, users should use key-value databases. One example is session management in a web system. A key stores the current status of a web session, and can read and overwrite it for later access.
Redis is ideal for large amounts of data
The simplicity of the data models facilitates the scalability of these systems, so that large amounts of data create the main argument for the use of key-value databases.
Redis is an open source project that has been developed since 2010 by VMware, together with its “inventor” Salvatore Sanfilippo. Redis is a “single-threaded” in-memory database implemented in C. Redis is similar to the memory-caching system Memcached, but offers more than Memcached, not only storing strings, but also complex data types like lists, sets and hashes. As an in-memory database Redis keeps all data in the main memory, which is expandable via virtual memory, to which value-data sets that are not used as often can be outsourced.
This type of main memory storage runs the risk of data loss in case of a server crash. To minimise the risk, Redis offers different mechanisms for protection. Due to the simplicity of the data models, projects with complex data structures are not part of Redis’s target group. Instead, the Redis developers concentrate on the fast processing of simple structured data. Whoever would like to test the performance themselves will find benchmark scripts with Redis, which they can use to verify the values written on the website with their own computer configuration. Redis also has another special feature: writing operations are usually faster that reading operations in the database.