Sequential identifier

Are there any implications by enabling sequential identifier on all object classes? is there any reason to avoid this, other than it being slightly less optimized?

Hi!

There are certain limitations you should be aware of with the sequential identifier:

  • The value cannot be generated on the client.
  • It does not automatically populate values on existing objects.
  • Be cautious when using these in URLs and other use cases where there is a direct reference to an object. It is relatively easy to guess identifiers for other objects when using integers

Another implication to be aware of is that it requires more operations towards the database for each creation of objects, as auto-increment is not directly supported by MongoDB.

Hence, we recommend considering the purpose of this carefully rather than placing it everywhere simply because it’s easier to read a number.

1 Like