mongodb / specifications

Specifications related to MongoDB
http://specifications.readthedocs.io/en/latest
Other
389 stars 242 forks source link

ObjectId plans beyond 2106 #1440

Open midnight-wonderer opened 1 year ago

midnight-wonderer commented 1 year ago

Hi, we are probably dead by then, but I wonder what is the plan beyond 2106?

  As you may know, ObjectId will overflow on February 7, 2106; there are a couple of ways forward then.

  These impact how we design the schema now, as we can either:

  What do you say?

P.S. BTW, the specification is currently incorrect; the ObjectId will overflow in Feb, not in Jan.

mdbmes commented 2 days ago

I think we would be better off phasing out ObjectId entirely before then rather than extending it in an incremental way; the limit on counter size will become a problem too, possibly before the timestamp does.

midnight-wonderer commented 2 days ago

As I understand, the counter would only cause a collision if one of the following occurs.

As a mom-and-pop software shop, the counter size will be an issue in my wildest dreams; I will hire all of you guys by then.

mdbmes commented 2 days ago

A single process is utilizing 2^24 ObjectIDs within one second. (Around 16M)

Sure, plenty of space for typical needs; but I would want more headroom eventually to protect against software flaws that could be exposed deliberately by a collision.

ShaneHarvey commented 2 days ago

P.S. BTW, the specification is currently incorrect; the ObjectId will overflow in Feb, not in Jan.

We should at least confirm this and fix it in the spec.