Using UUIDs instead of ObjectIDs in MongoDB

后端 未结 5 424
误落风尘
误落风尘 2021-01-30 03:32

We are migrating a database from MySQL to MongoDB for performance reasons and considering what to use for IDs of the MongoDB documents. We are debating between using ObjectIDs,

5条回答
  •  时光取名叫无心
    2021-01-30 04:29

    I found these Benchmarks sometime ago when I had the same question. They basically show that using a Guid instead of ObjectId causes Index Performance drop.

    I would anyways recommend that you customize the Benchmarks to imitate your specific real life scenario and see how the numbers look like, one cannot rely 100% on generic Benchmarks.

提交回复
热议问题