使用nosql(比如mongodb)会提高开发效率吗?
目前,我每年使用 Hibernate 和 MySQL 开发 3 到 4 个 Spring Roo 应用程序。 Stackoverflow 已声明 关系数据库并不是典型的面向对象 Web 应用程序的最佳选择。
如果你的数据库是 3NF 并且你不做任何连接(你只是选择一堆表并将所有对象放在一起,这就是大多数人在 Web 应用程序中所做的事情),MongoDB 可能会踢屁股你。
造成这种情况的原因有多种。一是生产力,因为对象被映射到关系模式(“连接”等)。如果具有与 MySQL 相同的专业水平,使用 MongoDB 或 CouchDB 是否会提高开发效率?
I develop 3 to 4 Spring Roo applications a year currently with Hibernate and MySQL. It has been stated here at Stackoverflow that relational databases are not the best fit for a typical object oriented webapplication .
If your DB is 3NF and you don’t do any joins (you’re just selecting a bunch of tables and putting all the objects together, AKA what most people do in a web app), MongoDB would probably kick ass for you.
There are various reasons for this. One is productivity as objects are mapped to a relational schema ("joins" etc.). Would the use of MongoDB or CouchDB increase development productivity given the same level of expertise as with MySQL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这实际上取决于网络应用程序。非关系数据库 (NoSQL) 在您
NoSQL 绝对可以让你更容易更快地开始工作,因为你可以随心所欲地添加东西,但缺点是,随着事情变得更加复杂,有时你想要更强制的组织。外键是我在使用 Mongo 时非常怀念的东西,能够(使用 ORM)从一个对象跳转到相关的一个或一组对象就很棒了。 (是的,在许多 NoSQL 数据库中,您可以存储文档,但在某些点上,您需要使用单独的表来执行某些操作。)
我强烈推荐 NoSQL 用于小册子风格的网站,客户只需在其中输入文本字段或 Twitter 风格的网站,其中主要存储大量具有很少属性的一种类型的数据。但是,如果您要创建具有修订和工作流程等内容的 CMS,您将需要能够在 SQL 中建立显式关系。
这引出了我的答案:使用正确的工具来完成工作。训练有素的开发人员能够使用 SQL 使某些网站更快更好,而使用非关系数据库使其他网站更快更好。
但是尝试一下 MongoDB 或 CouchDB 并感受一下它,这样您就会对何时使用什么有更好的直觉。 (我们在工作中使用两者(不同时!),具体取决于项目)
I think it really depends on the web application. Non-relational databases (NoSQL) excel where you either
NoSQL can definitely make it easier to get off the ground faster, because you can just throw stuff in however you want, but on the downside as things get more complex sometimes you want a little more forced organization. Foreign keys are something I really miss when working with Mongo, just being able to (using an ORM) hop from one object to a related one or set of them is great. (Yes in many NoSQL dbs you can store documents, but at some point you need to use a separate table for something.)
I would highly recommend NoSQL for a brochure style website, where the client is just entering text fields, or a twitter-style site, where largely you are storing lots of one type of data with few attributes. But if you're going to be creating a CMS with revisions and workflow and such, you're going to want the ability to have explicit relations in SQL.
Which brings me to my answer: use the right tool for the job. A trained developer would be able to make some sites faster and better with SQL, and other sites faster and better with a non-relational database.
But try out MongoDB or CouchDB and get a feel for it, that way you'll have a better intuition on when to use what. (We use both at my job (not at the same time!) depending on the project)