Redis

Redis1 is an in-memory key-value data store. It is widely applied in situations where low latency is key, such as caches, but can also be used as a document database or message broker. By just using keys for accessing data, and holding the entire store in memory, Redis can offer constant-time lookups and changes. Although memory is the primary data source, options for persistence are provided, which offer varying amounts of data protection.

Comparison

Each of the requirements is scored on a scale from 1 (very poor) to 5 (very good).

Data integrity

Score: 2. Persistency is not neccessarily ensured due to the memory-nature of the store. Transactions in Redis offer limited guarantees for data integrity. In addition, there is no support for relations, meaning that consistency between items has to be managed by the application.

Handling necessary data

Score: 2. As Redis is an in-memory store, the amount of data is constrained by the memory size, which tends to be much smaller than the disk size. Depending on the amount of data stored per picture, it would be able to handle the amounts, but the machine would need plenty of memory and would not be able to expand much beyond that.

JavaScript support

Score: 3. There are a few third-party clients2 available that support Redis’ feature-set (including some addons). Other libraries generally have a heavy focus on caching and session storage.

Performance

Score: 5. Since all data is stored in memory and Redis only supports basic access patterns, the store can be extremely quick.

Query support

Score: 2. As a key-value store, Redis prioritises simplicity and speed. It has features for getting and settings values using their key, but does not support searching, relationships, or separating items into collections. There are, however, addons that do provide additional functionality close to what regular databases would offer.

Scalability

Score: 3. Data can be kept in a cluster, in which it is automatically split between multiple instances of Redis. However, applications do need to connect to all nodes individually, and overall capacity remains limited due to the database being stored in memory.