当可伸缩性无关紧要时,NoSQL 与 SQL [英] NoSQL vs. SQL when scalability is irrelevant

查看:22
本文介绍了当可伸缩性无关紧要时,NoSQL 与 SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我阅读了很多关于不同 NoSQL 数据库以及它们如何被一些主要网站有效部署的文章.我正在开始一个项目,我认为 MongoDB 等数据库的无模式特性将非常有用.我读过的所有内容似乎都表明 NoSQL 数据库的主要优势是可扩展性.为无模式设计选择 NoSQL 数据库与可扩展性设计决策一样合理吗?

Recently I have read a lot about different NoSQL databases and how they are being effectively deployed by some major websites out there. I'm starting a project in which I think the schema-free nature of a database such as MongoDB would be tremendously useful. Everything I have read though seems to indicate that the main advantage of a NoSQL database is scalability. Is choosing a NoSQL database for the schema-free design just as legitimate a design decision as that of scalability?

推荐答案

是的,有时 RDBMS 不是最好的解决方案,尽管有一些方法可以容纳用户定义的字段(参见 XML 数据类型、EAV 设计模式,或者只是有备用的通用列)有时无模式数据库是一个不错的选择.

Yes, sometimes RDBMS are not the best solution, although there are ways to accomodate user defined fields (see XML Datatype, EAV design pattern, or just have spare generic columns) sometimes a schema free database is a good choice.

但是,在选择使用文档数据库之前,您需要确定您的要求,因为您可能会失去很多您可能习惯使用关系模型的功能

However, you need to nail down your requirements before choosing to go with a document database, as you will loose a lot of the power you may be used to with the relational model

例如...

如果您的 RDBMS 数据库中有多个表,则需要研究 MongoDB 为您提供满足这些需求的功能.

If you would otherwise have multiple tables in your RDBMS database, you will need to research the features MongoDB affords you to accomodate these needs.

如果您需要以特定方式查询数据,那么您需要再次研究 MongoDB 为您提供的功能.

If you will need to query the data in specific ways, again you need to research what MongoDB offers you.

我不会将 NoSQL 视为 RDBMS 的替代品,而是一种略有不同的工具,它带来了自己的优点和缺点,使其比其他项目更适合某些项目.

I wouldnt think of NoSQL as replacement for RDBMS, rather a slightly different tool that brings its own sets of advantages and disadvantages making it more suitable for some projects than others.

(在某些情况下可能会使用这两种数据库.另外,如果您决定走下可能使用 MongoDB 的路线,一旦您研究了那里的网站并有更具体的问题,您可以访问 Freenode IRC #mongodb 频道)

(Both databases may be used in some circumstances. Also if you decide to go down the route of possibly using MongoDB, once you have researched the websites out there and have more specific questions, you can visit Freenode IRC #mongodb channel)

这篇关于当可伸缩性无关紧要时,NoSQL 与 SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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