On this page
Understanding the difference between Redis and Memcached on Kualo
Redis and Memcached are both in-memory data stores that can dramatically speed up your website by reducing the number of database queries your server has to run. If you are not sure which one to use - or what either of them actually does - this guide explains the difference in plain language and helps you decide before you follow the setup guides.
Redis and Memcached are both in-memory data stores that can dramatically speed up your website by reducing the number of database queries your server has to run. If you are not sure which one to use - or what either of them actually does - this guide explains the difference in plain language and helps you decide before you follow the setup guides.
Plan availability. On shared hosting, Redis and Memcached are available on our Performance plan and above. On reseller hosting, both are included on the Agency plan, or can be added to other reseller plans with a Boost Addon.
What is caching and why does it matter?
Every time someone visits a page on a dynamic website - a WordPress blog, a Magento store, a Moodle course - your server runs database queries to build that page from scratch. Under light traffic this is fine, but as visitor numbers grow, those repeated queries add up and slow things down.
Caching solves this by storing the result of a query or a computed value in fast memory (RAM), so the next request can grab it instantly rather than hitting the database again. The difference in speed between reading from RAM and reading from a database can be several orders of magnitude.
Both Redis and Memcached do this job, but they approach it differently.
What is Memcached?
Memcached is a simple, fast, distributed memory cache. It stores data as key-value pairs - you give it a key (a name) and a value (some data), and it holds that in RAM until the data expires or the server restarts.
Memcached is deliberately minimal. It does one thing - transient object caching - and it does it very quickly. There are no complex data structures, no persistence to disk, and no built-in support for replication. When the server restarts, everything in Memcached is gone.
Memcached is a good fit when:
- Your application needs simple, high-speed caching of database query results or rendered HTML fragments.
- The cached data is truly throwaway - losing it on a restart causes no harm beyond a temporary slowdown.
- Your application explicitly supports Memcached and you have no need for the extra features Redis provides.
What is Redis?
Redis is a more capable in-memory data store. Like Memcached it stores key-value pairs in RAM, but it supports a much richer set of data types - strings, lists, sets, sorted sets, hashes, and more. It can also persist data to disk, so cached data survives a server restart.
Because of this, Redis is used for a wider range of tasks beyond simple caching.
Redis is a good fit for:
- Object caching - storing the results of expensive database queries, just like Memcached.
- Session storage - keeping user login sessions in memory rather than in the database, which is faster and reduces database load significantly on busy sites.
- Queues and pub/sub messaging - applications that need to pass jobs or messages between processes (for example, background email sending or job queues in Laravel).
- Persistent caching - situations where you want cached data to survive a restart rather than rebuilding it from scratch.
- Rate limiting and leaderboards - Redis sorted sets make these patterns straightforward to implement.
Key differences at a glance
- Data types. Memcached supports strings only. Redis supports strings, lists, sets, sorted sets, hashes, bitmaps, and more.
- Persistence. Memcached is purely in-memory; a restart wipes everything. Redis can write data to disk and reload it on startup.
- Sessions. Redis is well suited to storing PHP or application sessions. Memcached is not designed for this.
- Queues. Redis supports list-based queues natively. Memcached does not.
- Complexity. Memcached is simpler to reason about. Redis has more moving parts but far more capability.
- Performance. Both are extremely fast for simple key-value reads and writes. For that specific use case, the difference in practice is negligible.
Which should you choose?
We recommend Redis in most cases. If your application supports both, Redis gives you everything Memcached does plus persistence, richer data structures, and session support. You are unlikely to need to switch later.
Choose Memcached only if your application explicitly requires it, or if you are running a very simple caching layer and want the most straightforward possible setup.
The table below lists common applications that support Redis or Memcached, along with notes on how each tool is used. In some cases - such as WordPress with LiteSpeed Cache - Redis acts as an object cache that complements a separate full-page cache (FPC). In others, LiteMage is the recommended FPC solution on our LiteSpeed-powered platform.
| Application | Recommended | Redis role | Memcached support | Notes / guide |
|---|---|---|---|---|
| WordPress | Redis | Object cache (complements LiteSpeed Cache FPC) | Yes (via Memcached object cache plugins) | How to integrate Redis into WordPress |
| Magento | Redis | Object cache + session storage | Yes (object cache only) | For full-page caching on our platform, LiteMage is the recommended approach. How to integrate Redis into Magento v2 |
| Moodle | Redis | Session cache and application cache | Yes | How to enable Redis Cache via Unix Socket on Moodle |
| HumHub | Redis | Object and session cache | No | How to enable Redis cache via Unix socket on HumHub |
| Joomla | Redis | Object cache (complements LiteSpeed Cache FPC) | Yes | Redis support via Joomla's built-in cache framework |
| Drupal | Redis | Object cache (complements LiteSpeed Cache FPC) | Yes | Redis support via the Redis module on Drupal.org |
| PrestaShop | Redis | Object cache (complements LiteSpeed Cache FPC) | Yes | Redis support via PrestaShop's cache configuration |
| Laravel (custom apps) | Redis | Object cache, session storage, queues, pub/sub | Yes | Native support via Laravel's cache and queue drivers |
| WHMCS | Redis | Object cache | Yes | Redis support via WHMCS cache configuration |
| phpBB | Redis | Object cache | Yes | Redis support via phpBB's cache driver |
| MediaWiki | Redis | Object cache and session storage | Yes | Redis support via MediaWiki's object cache configuration |
| Simple PHP apps or legacy apps that only support Memcached | Memcached | - | Yes | Use Memcached if Redis is not supported |
If you are unsure whether your application supports Redis, check its documentation or search for a Redis cache plugin or adapter. Most modern PHP frameworks and CMS platforms have Redis support built in or available as an extension.
How they connect on Kualo hosting
On our hosting platform, both Redis and Memcached run per-account and connect via a Unix socket rather than a TCP port. This is faster and more secure than a network connection, and it means your cache is isolated to your own account.
You do not need to know the technical details right now - the setup guides walk you through the connection string. What matters at this stage is choosing the right tool.
Next steps
Once you have decided which to use, follow the relevant setup guide:
For a broader look at how caching fits into overall site performance, our guide on optimising your website is a good starting point.