The difference between redis and memcached
Thread
- memcached multithreading, redis single threading ( multithreading after 6.0, but the official website is still 5.0.8 stable version )
Read and write
- Redis can not only handle high-traffic reads, but also handle frequent writes
performance
Both are higher, memcached is better, and both are higher than MongoDB in TPS
operating
There are more redis data types (list, set, hash, etc.)
memcached can store pictures, videos, etc.
RAM
Redis has its own VM features, breaking through physical limitations
Expiry strategy
memcached is specified when using set, redis sets expire
Data Security
Memcached hangs up the data, and redis can periodically persist
redis disaster recovery can be recovered through AOF. Also supports data backup.
Application scenario
In addition to being used as a NoSQL database, Redis can also be used as a message queue (using list to implement message queue, lpush, rpop or rpush, lpop), data stack, and data cache;
Memcached is suitable for caching SQL statements, data sets, and user temporary Data, delayed query data, session, etc.