cardboard icon indicating copy to clipboard operation
cardboard copied to clipboard

[wip] autogenerate numeric ids

Open rclark opened this issue 8 years ago • 4 comments

I might be overthinking this, but just stashing some ideas wrt #139.

rclark avatar Jun 09 '16 14:06 rclark

The idea here is that I can ask for my next auto id add set the feature's id to be that?

mcwhittemore avatar Jun 09 '16 15:06 mcwhittemore

Yeah the code is definitely not together yet, but the idea would be that every feature needs to be assigned a number that is unique in the dataset. In order to do that in a distributed system, that script in here is "reserving" a chunk of ids, then it would hand those out to new features. Once it runs out, it reserves another block of 1000 numbers.

rclark avatar Jun 09 '16 15:06 rclark

gotcha. So 0-999 goes to server a, 1000-1999 goes to server b. Than I either get 0 or 1000 when I request my first id.

What is the value of an auto incrementing id if you can't be sure id:0 is older than id:1000?

mcwhittemore avatar Jun 09 '16 15:06 mcwhittemore

What is the value of an auto incrementing

auto-incrementing is not actually the goal -- the goal is just uniqueness within a single dataset.

rclark avatar Jun 09 '16 16:06 rclark