What are in-memory data stores
Redis and Memcached opensource in-memory caches that are often used in combination with Drupal.
In-memory data stores are also called in-memory caches or object caches.
These tools store cache data in the server's Random Access Memory (RAM), which is much, much faster than storing information on disk, such as in a database.
Each of Drupal's internal caches can be set to a different cache back-end. As a site builder you can configure one or more of the internal caches to use an in-memory cache back-end, which should speed up page loads significantly.
Other than specifying which Drupal cache should use an in-memory back-end, no further Drupal configuration is necessary, and no other parts of your Drupal solution should need to change.
Of course, Redis and Memcached themselves have their own configuration options you may need to fine-tune for your specific scenario.
Advantages
Read/write operations to memory are much faster than read/write operations to disk.
Redis and Memcached support clustered environments, so you can spread the requests for cached data over multiple servers.
Disadvantages
Data stored in Random Access Memory (RAM) does not survive (persist after) server reboots. As a result, each reboot will be the same as manually clearing some of your Drupal caches.
However, Redis and Memcached have features that let you save in-memory data to disk before a reboot, and reading it back into memory afterwards.
A cache warming strategy (see Drupal caches) can also be useful to automatically repopulate in-memory caches after they're cleared, to avoid sudden performance problems on busy sites.
Summary
- Redis and Memcached are in-memory data stores.
- In-memory data stores store their data in the server's memory (RAM).
- Read/write operations to memory are much faster than read/write operations to disk.
- Configuring Drupal to use an in-memory cache back-end is straightforward.
- In-memory data does not survive server reboots.