Auto-incrementing id

(Max McDonnell) #1

In comparing the record layer to a traditional relational database there is no mention of an incrementing id field. It seems like atomic operations on a counter are easily supported by foundationdb. Is this an anti-pattern? Could/should it be implemented using the record layer? It doesn’t seem to be mentioned in the docs and cloudkit uses a uuid for identifiers and relationships. Would be great to hear more about the downsides.

(Max McDonnell) #2

Ah, this clears it up for the most part: https://github.com/FoundationDB/fdb-record-layer/blob/master/docs/FAQ.md#are-record-types-tables

(Max McDonnell) #3

Aaaaaand right below that there’s an entire section about this question: https://github.com/FoundationDB/fdb-record-layer/blob/master/docs/FAQ.md#are-auto-incremented-primary-keys-supported

whoops

1 Like
(Alec Grieser) #4

Ah, nice. Happy to help if there are follow up questions from the answer in our FAQs.