简体   繁体   English

澄清关于 MongoDB 的问题

[英]Clarifying questions about MongoDB

These are newb questions, I'm sure, so let's get this out of the way sooner rather than later: I'm new to MongoDB.我敢肯定,这些都是新手问题,所以让我们尽快解决这个问题:我是 MongoDB 的新手。

  1. Does MongoDB guarantee that an entry will be saved? MongoDB 是否保证将保存条目? Eg if I have a process load 1,000,000 objects into MongoDB, am I guaranteed that they will all load properly or at least retry / raise an error when an error occurs?例如,如果我有一个进程将 1,000,000 个对象加载到 MongoDB 中,我是否保证它们将全部正确加载或至少在发生错误时重试/引发错误?

  2. Is NumberLong only for integers? NumberLong 是否仅适用于整数? What if I wanted to use high precision decimals?如果我想使用高精度小数怎么办?

  3. I know V8 / SpiderMonkey can be just as fast as C, but has anyone done any benchmarks for calculations of data in MongoDB?我知道 V8 / SpiderMonkey 可以和 C 一样快,但是有没有人为 MongoDB 中的数据计算做过任何基准测试? For example, if I wanted to find the average over those 1,000,000 items I loaded in 1, I could probably do it in a map-reduce way with any programming language... have people run in to any trouble with using JavaScript with MongoDB?例如,如果我想找到我在 1 中加载的 1,000,000 个项目的平均值,我可能会使用任何编程语言以 map-reduce 的方式来完成它......人们在使用 JavaScript 和 MongoDB 时遇到任何问题吗? What do you think?你怎么看?

  1. Most Mongo drivers let you insert data with "safe-mode" which waits for an insert to complete sucessfully, or raises an error on failure.大多数 Mongo 驱动程序允许您使用“安全模式”插入数据,该模式等待插入成功完成,或在失败时引发错误。 This is done behind the scenes by calling the getLastError command immediately after the insert.这是通过在插入后立即调用getLastError命令在幕后完成的。
  2. MongoDB's underlying storage format BSON doesn't support high-percision decimals, only 64-bit floating point numbers. MongoDB 的底层存储格式BSON不支持高精度小数,只支持 64 位浮点数。
  3. JavaScript in MongoDB is single-threaded, and can be a bit slow. MongoDB 中的 JavaScript 是单线程的,可能会有点慢。 Hopefully the JavaScript engine will be upgraded to V8 which should speed things up.希望 JavaScript 引擎将升级到 V8 ,这应该会加快速度。
  1. MongoDB follows eventual consistency model, which is defined as: MongoDB 遵循最终一致性 model,其定义为:

The storage system guarantees that if no new updates are made to the object, eventually all accesses will return the last updated value.存储系统保证如果object没有新的更新,最终所有的访问都会返回最后更新的值。

Thanks谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM