The same and different points of Mongodb and Redis

Source: Internet
Author: User

Both MongoDB and Redis are NoSQL, using structured data storage. There is a certain difference in the use of the scene, which is mainly due to
In the process of memory mapping, the processing method of persistence is different. MongoDB recommends cluster deployment, more considering the cluster scenario, Redis
More emphasis is on process sequential writes, although cluster support is also limited to master-slave mode.

Indicators MongoDB (v2.4.9) Redis (v2.4.17) Comparison notes
Implementation language C++ C + + -
Agreement BSON, Custom Binary Class Telnet -
Performance Memory dependent, higher TPS Memory dependent, TPS very high Redis is better than MongoDB
operability Rich data expression, index, most similar to relational database, support rich query language Data-rich, less IO MongoDB is better than Redis
Memory and Storage Suitable for large data volume storage, relying on system virtual memory management, using image file storage, memory share is high, the official recommendation is independently deployed in 64-bit system (32 bits have the maximum 2.5G file limit, 64 bit no change limit) After Redis2.0, the virtual memory feature is added to break the physical memory limit; Data can be set to timeliness, similar to Memcache Different application point of view, each has advantages
Availability of Support Master-slave,replicaset (internal use of Paxos election algorithm, automatic fault recovery), auto sharding mechanism, blocking the failover and segmentation mechanism to the client Rely on the client to implement the distributed read and write, master-slave replication, every time from the node reconnect to the primary node to rely on the entire snapshot, no incremental replication, automatic sharding is not supported, requires a dependent program to set the consistent hash mechanism MongoDB is better than Redis; On a single point problem, MongoDB application is simple, relative user transparent, Redis is more complex, need the client to actively solve. (MongoDB is typically combined with replica sets and sharding features, replica sets focuses on high availability and high reliability, while Sharding focuses on performance, easy scalability)
Reliability From the 1.8 release, the binlog approach (MySQL is also used in this way) supports persistence, increasing reliability relies on snapshots for persistence, aof enhances reliability, and improves reliability while impacting access performance MongoDB is better than Redis
Consistency Do not support things, by the client's own assurance To support things, weaker, only to ensure that the operations of things in order to execute Redis is better than MongoDB
Data analysis Built-in data analysis capabilities (MapReduce) Not supported MongoDB is better than Redis
Application Scenarios Increased access efficiency for massive data Performance and operation of smaller data volumes MongoDB is better than Redis

The same and different points of Mongodb and Redis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.