原因和对移动从SQL服务器的MongoDB [英] Reasons for and against moving from SQL server to MongoDB

查看:105
本文介绍了原因和对移动从SQL服务器的MongoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个很大的问题,它不是一个yes或no的答案,但我们开发的Web应用程序,并正在研究使用MongoDB的为我们的持久性解决方案。与定额对象存储结合的Mon​​goDB。

I know this is a big question and it's not a yes or no answer but we develop web apps and are looking into using MongoDB for our persistence solution. Combining MongoDB with NoRM for object storage.

我想问的是什么陷阱你从SQL切换到蒙戈经历?如果是蒙戈根本就不是正确的解决方案,是MongoDB的优势足以让SQL提前移动发展?

What I want to ask is what pitfalls have you experienced with switching from SQL to mongo? When is mongo simply not the right solution and is mongodb's advantages enough to move development from SQL?

非常感谢您提出的任何建议。

Many thanks in advance for any advice you may have.

推荐答案

在我看来选择一个存储后端时,数据的格式应该是首要关注的问题。你是否有数据,在本质上是关系?如果是这样,可以把它和它是一个好主意,在文档中的数据模型?数据建模是在文档数据库在关系数据库一样重要,它只是做不同的。有多少类型的对象,你有和他们是如何相关?在DBREFS MongoDB中可以做的伎俩,否则你会错过外键与其说它会很痛苦?什么是数据的访问模式?你只是取由一个字段值过滤一种类型的数据,或者你有复杂的抓取模式?

In my opinion the format of your data should be the primary concern when choosing a storage backend. Do you have data that is relational in nature? If so, can it and is it a good idea to model the data in documents? Data modeling is as important in a document database as in an relational database, it just done differently. How many types of objects do you have and how are they related? Can DBrefs in Mongodb do the trick or will you miss foreign keys so much it will be painful? What are your access patterns for the data? Are you just fetching data of one type filtered by a field value, or do you have intricate fetching modes?

你需要ACID事务完整性?请问域名执行了大量的数据限制?你需要一个文档数据库的可扩展性的因素或者是,只是一个酷的事情有哪些?

Do you need ACID transactional integrity? Does the domain enforce a lot of constraints on the data? Do you need the scalability factor of a document database or is that just a "cool" thing to have?

什么是你的一致性和数据完整性的要求?一些NoSQL的解决方案和MongoDB特别是在写一致性相当宽松,以获得性能。 NoSQL的是没有统一的景观及其他产品,例如CouchDB的在这个部门等特点。有些是可调的了。

What are your consistency and data integrity requirements? Some NoSQL solutions and MongoDB in particular are quite loose on the write consistency in order to get performance. NoSQL is no uniform landscape and other products, e.g. CouchDB has other characteristics in this department. Some are tunable too.

这些都是应该进入存储的选择所有问题。

These are all questions that should go into the choice of storage.

的几点经验


  • 做广泛的报告上使用MongoDB的或任何文件数据库时,还有一些用例已结合RDBMS和文档DB为此目的存储的数据也很难。

  • (非常)不同的查询模式。 MongoDB的不同于其他文件-DBS了。

  • 灵活的开发过程中,改变数据格式/模式

  • 未知的领域

  • 在驱动程序和框架不同成熟度

  • 快速

  • 简单(在很多方面)的产品和管理工具(相比,许多RDBMS产品)

  • 没有更多的阻抗失配。存储拟合数据,而不是周围的其他方法。

  • 少摩擦,更直接的访问数据。

  • 域更依赖于持久性(根据规范的ORM级别,多少它抽象掉后端。我没有使用规范,所以我不能回答这个问题。 )

  • Doing extensive reporting on the stored data can be harder when using MongoDB or any document database and some use cases have been combining RDBMS and document-db for that purpose.
  • (Very) Different query model. MongoDB differs from other document-dbs too.
  • Flexible to change data format/schema during development
  • Unknown territory
  • varying degree of maturity in drivers and frameworks
  • Fast
  • Simpler (in many ways) product and management tools (compared to many RDBMS products)
  • No more impedance mismatch. The storage fits the data, not the other way around.
  • Less friction and more direct access to data.
  • Domain more tied to persistence (depending on the ORM "level" of NoRM, on how much it abstract away the backend. I haven't used NoRM so I can't answer that.)

这篇关于原因和对移动从SQL服务器的MongoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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