MongoDB的利弊? [英] Pros and cons of MongoDB?

查看:130
本文介绍了MongoDB的利弊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我什么是mongodb的利弊,特别是与关系数据库?包括ACID,可扩展性,吞吐量,主内存使用,插入/查询性能和索引大小等。

Could anybody tell me what is the pros and cons of mongodb, especially comparing with the relational database? including ACID, scalability, throughput, main memory usage, insert/query performance and index size etc.

推荐答案

MongoDB

优点:


  • 无架构。如果你有一个灵活的模式,这是一个文档存储如
    MongoDB的理想选择。这难以在RDBMS

  • 轻松扩展中以高性能的方式实现。使用副本集缩放读取。使用分片(自动平衡)缩放写入。只是启动另一台机器,离开你去。添加更多计算机=添加更多RAM以分配工作集。

  • 费用。取决于当前哪个RDBMS,但是MongoDB是免费的,并且可以在Linux上运行,非常适合在更便宜的商品套件上运行。

  • 您可以根据需要选择什么级别的一致性数据(例如,更快的性能=火灾和忘记插入到MongoDB,性能更慢=等待插入已经被复制到多个节点,然后返回)

  • schema-less. If you have a flexible schema, this is ideal for a document store like MongoDB. This is difficult to implement in a performant manner in RDBMS
  • ease of scale-out. Scale reads by using replica sets. Scale writes by using sharding (auto balancing). Just fire up another machine and away you go. Adding more machines = adding more RAM over which to distribute your working set.
  • cost. Depends on which RDBMS of course, but MongoDB is free and can run on Linux, ideal for running on cheaper commodity kit.
  • you can choose what level of consistency you want depending on the value of the data (e.g. faster performance = fire and forget inserts to MongoDB, slower performance = wait til insert has been replicated to multiple nodes before returning)

缺点:


  • MongoDB中的数据大小通常较高,

  • 不支持事务 - 支持某些原子操作,在单个文档级别

  • 在当前Map / Reduce(例如进行聚合/数据分析)是可以的,但不是很快的。因此,如果需要,可能需要将类似Hadoop的内容添加到混合

  • 减少最新信息/快速发展的产品

  • Data size in MongoDB is typically higher due to e.g. each document has field names stored it
  • less flexibity with querying (e.g. no JOINs)
  • no support for transactions - certain atomic operations are supported, at a single document level
  • at the moment Map/Reduce (e.g. to do aggregations/data analysis) is OK, but not blisteringly fast. So if that's required, something like Hadoop may need to be added into the mix
  • less up to date information available/fast evolving product

我最近在MongoDB上记录了我的想法,因为有人来自SQL Server后台,因此您可能对此感兴趣(上面只是一些要点)。

I recently blogged my thoughts on MongoDB as someone coming from SQL Server background, so you might be interested in that (above are just some of the main points).

如果你正在寻找一个MongoDB比RDBMS更好的答案 - 那么IMHO有没有答案。 NoSQL技术(如MongoDB)提供了一种替代方案,它补充了RDBMS技术。一个人可能更适合于某个特定的目的,而不是另一个,所以它是所有关于什么是最适合你的一个给定的要求。

If you're looking for a "Is MongoDB better than RDBMS" answer - then IMHO there is no answer. NoSQL technologies like MongoDB provide an alternative, that complements RDBMS technologies. One may be better suited to a particular purpose than the other, so it's all about making a call on what is best for you for a given requirement.

这篇关于MongoDB的利弊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆