|
Memcached |
Redis |
| Persistence of |
Not supported |
Support |
| Distributed |
Support |
Support Master-Slave Involves complex operations that may require a distributed lock to support
|
| Thread |
Multithreading |
Single thread avoids unnecessary context switching and race conditions Thread closure concept, the task of shutting down a thread, naturally avoiding the problem of thread safety , but locks are still required for composite operations that rely on multiple redis operations, And it could be a distributed lock.
|
| Key-value |
Support |
Support |
| Complex data types |
Not supported |
Support |
| Storage direction |
Memory Cache |
Memory Cache |
| Disaster preparedness |
Requires a good disaster preparedness plan, otherwise the pump will cause Loss of data in memory, resulting in an unpredictable loss
|
By supporting persistent storage, you only need to configure the master Can form a good plan for disaster preparedness.
|
| Speed |
Pure memory Operations (non-general speed) |
The vast majority of requests are purely memory operations (very fast) |
Memcached and Redis comparison