1024programmer Java NOSQL learning one: Memcached, Redis, MongoDB differences

NOSQL learning one: Memcached, Redis, MongoDB differences

Redis is an open source (BSD licensed), in-memory data structure server that can be used as a database, cache, and message queue broker.

Memcached is a free and open source, high-performance, distributed memory object caching system.

MongoDB is a database based on distributed file storage, a document-type non-relational database, which is different from the above two.

1. Performance: Performance is excellent, right down to the details, because
Redis only uses a single core, and Memcached can use multiple cores, so on average Redis on each core has higher performance than
Memcached when storing small data. In the data of 100k or more, the performance of Memcached is higher than that of Redis. Although Redis has recently been optimized for the performance of storing big data, it is still slightly inferior to Memcached. The performance of the first two is similar, greater than Mongodb. 2. Memory space and data size: MemCached can modify the maximum memory and adopts the LRU algorithm. Redis adds VM features and breaks through the limitations of physical memory. MongoDB is suitable for the storage of large amounts of data. It relies on the operating system VM for memory management and is also powerful in consuming memory. The service should not be combined with other services. 3. Operation convenience: MemCached has a single data structure and is only used to cache data, while Redis supports Richer data types can also be used to directly perform rich operations on the data on the server side, which can reduce the number of network IO times and data volume. Mongodb supports rich data expression and indexing, is most similar to a relational database, and supports a wide range of query languages. 4. Reliability: MemCached does not support data persistence. Data disappears after a power outage or restart, but its stability is guaranteed. Redis supports data persistence and data recovery, allowing single points of failure, but it also pays a performance price. Starting from version 1.8, MongoDB uses binlog to support persistence reliability. 5. Application scenarios: Memcached: Reduce database load and improve performance in dynamic systems; cache, suitable for more reading, less writing, and large amounts of data (such as Renren querying a large amount of user information, friend information, article information, etc.). Redis: It is suitable for systems that require high reading and writing efficiency, complex data processing business and high security requirements (such as Sina Weibo’s counting and Weibo publishing systems, which have high requirements for data security, reading and writing). high). MongoDB: Mainly solves the problem of access efficiency of massive data.
Parts that need careful consideration
1. Memcached has a limited size of a single key-value. One value only supports a maximum of 1MB, while Redis supports a maximum of 512MB 2 .Memcached is just a memory cache and has no requirements for reliability; while Redis prefers an in-memory database, so it has higher requirements for reliability. 3.
Essentially, Memcached is just a single key- value memory Cache; and Redis is a data structure memory database that supports five data types. Therefore, in addition to its simple caching function, Redis can also handle some simple logical operations. Redis can not only cache, but also serve as a The database uses 4. The new version (3.0) of Redis refers to cluster distribution, which means that the cluster itself balances client requests, each node can communicate, can be expanded, and maintainability is more powerful.

5. MongoDB does not support transactions.

Reference:

Memcache, Redis, MongoDB (data caching system) solution comparison and analysis

Caching technology PK: Choose Memcached or Redis?

The difference between Redis and Memcached

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/nosql-learning-one-memcached-redis-mongodb-differences/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索