3 ms·
> It is trivial to have an app request From where? If the counter for this pool of IDs lives in the database being rolled back, it is vulnerable in the same wa
by twic 9y ago
> It is trivial to have an app request
From where? If the counter for this pool of IDs lives in the database being rolled back, it is vulnerable in the same way as auto-incrementing IDs. If it doesn't, it isn't - but the safety you're getting comes simply from the fact that it doesn't get rolled back, not the rest of the machinery. It would be enough to make sure you don't roll back autoincrement counters when rolling back the rest of the database.
That said, i am a fan of the approach you outline. I learned it from the IdGenerator in ATG Dynamo (c. 2500 - 2200 BC):
https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0908idgenerators01.html https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuid...
- manigandham 9y agoYou're right, it's an external system. Left it out since a key/value db is super simple to operate and very cheap by just using dynamo/cosmos db/cloud datastore to maintain it globally. All the benefits help offset the extra dependency and make database backups much simpler, especially since every row has a unique id.