对于非分布式系统,使用NoSQL是否有意义? (试图了解最终的一致性) [英] Does using NoSQL make sense for a non-distributed system? (trying to understand eventual consistency)

查看:74
本文介绍了对于非分布式系统,使用NoSQL是否有意义? (试图了解最终的一致性)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的两天里,我一直在阅读和学习NoSQL和MongoDB,CouchDB等,但是我仍然无法确定这是否适合我.

I have been reading and learning about NoSQL and MongoDB, CouchDB, etc, for the last two days, but I still can't tell if this is the right kind of storage for me.

让我担心的是最终的一致性问题.这种一致性是否仅在使用集群时才发挥作用? (我将站点托管在单个专用服务器中,所以我不知道我是否可以从NoSQL中受益)对于哪种类型的应用程序来说,具有最终的一致性(而不是ACID)是可行的,对于哪种应用程序则是不可行的? ??能给我一些例子吗?在具有最终一致性的应用程序中,最糟糕的事情是什么?

What worries me is the eventual consistency thing. Does that type of consistency only kick in when using clusters? (I'm hosting my sites in a single dedicated server, so I don't know if I can benefit from NoSQL) For which kind of applications is OK to have eventual consistency (instead of ACID), and for which ones it isn't? Can you give me some examples? What's the worst thing that can happen in an application for which is OK to have eventual consistency?

我读到的另一件事是MongoDB在内存中保留了很多东西.在文档中,它说明了有关数据限制为2gb的32位系统的信息.那是因为32位系统的内存限制吗?

Another thing that I read is that MongoDB keeps a lot of things in memory. In the docs it says something about 32-bit systems having a 2gb limit of data. Is that because of the ram limitation for 32-bit systems?

推荐答案

  • 最近两天我一直在阅读和学习NoSQL和MongoDB,CouchDB等,但是我仍然无法确定这是否适合我.
    • I have been reading and learning about NoSQL and MongoDB, CouchDB, etc, for the last two days, but I still can't tell if this is the right kind of storage for me.
    • NoSQL数据库解决了一系列问题,这是传统RDMS难以解决的.如果您的任何问题出在NoSQL中,则NoSQL可以为the right storage for you.

      NoSQL databases solve a set of problems, that are hard(er) to solve with traditional RDMS. NoSQL can be the right storage for you if any of your problems are in that set.

      • 仅在使用群集时才会发挥最终一致性吗?

      当您可能读取与刚刚保留的数据不同/以前的版本时,最终的一致性将启动".例如:

      Eventual consistency "kicks in" when you might read back different/previous version of data from the one that was just persisted. For example:

      您将同一条数据持久保存到多于一个位置,比如说A和B.根据配置,持久化操作可能仅在持久化到A之后才返回(而不是仅仅持久化到B).然而 ).此后,您立即从尚未读取的B中读取该数据. 最终它会在那里,但不幸的是,当您读回它时,

      You persist the same piece of data into MORE THAN ONE location, let's say A and B. Depending on the configuration, a persist operation may return after only persisting to A ( and not to B just yet ). Right after that you read that data from B, which is not yet there. Eventually it will be there, but unfortunately not when you read it back

      • 对于哪种类型的应用程序,可以最终具有一致性(而不是ACID),对于哪种应用程序则不是?

      NOT OK =>您有一个家庭银行帐户,其中有$ 100可用.现在,您和您的配偶尝试同时(在不同的商店)以$ 100的价格购买商品.如果银行使用最终一致性"模型实施此操作,例如,在多个节点上,您的配偶在花完所有这些钱后可能要花几毫秒的100美元.对于银行而言,这绝对不是美好的一天.

      NOT OK => You have a family bank account which has a $100 available. Now you and your spouse try to buy something at the same time (at different stores) for $100. If the bank had this implemented with "eventual consistency" model, over more than one node for example, your spouse could have spent $100 a couple of milliseconds after you already spent all of it. Would not be exactly a good day for the bank.

      OK =>您在Twitter上有10000个关注者.您发了一条推文嘿,谁今晚想做些骇客?". 100%的一致性意味着所有这10000个人将同时收到您的邀请.但是,如果John在Mary看到2秒钟后看到您的推文,则不会发生任何不好的事情.

      OK => You have 10000 followers on Twitter. You tweeted "Hey who wants to do some hacking tonight?". 100% consistency would mean that ALL those 10000 would receive your invitation at the same time. But nothing bad would really happen, if John saw your tweet 2 seconds after Mary did.

      • 在可以最终实现一致性的应用程序中,最糟糕的事情是什么?

      例如,当节点A获取数据,而节点B获取相同的数据时[它们是同步的].如果NoSQL解决方案可靠,那将是最糟糕的事情.

      A huge latency between e.g. when node A gets the data, and node B gets the same data [they are in sync]. If NoSQL solution is any solid, that would be the worse thing that can happen.

      • 我读到的另一件事是MongoDB在内存中保留了很多东西.在文档中,它说明了有关数据限制为2gb的32位系统的信息.是因为32位系统的内存限制吗?

      来自MongoDB文档:

      from MongoDB docs:

      " MongoDB是在Linux,Windows和OS X上运行的服务器进程.它可以作为32位或64位应用程序运行.我们建议在64位模式下运行,因为Mongo限于在32位模式下,所有数据库的总数据量约为2GB."

      这篇关于对于非分布式系统,使用NoSQL是否有意义? (试图了解最终的一致性)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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