If I run a query that increments a counter, then selects from that counter is that atomic?
I am wanting to generate smaller (integer) numbers using Cassandra.
The usage will likely be generating fewer than 1000 Ids/day, but definitely needs to be non-conflicting, and would prefer minimal chance of waste (unused blocks of numbers).
I've considered the following option(s)
- I know I can do conditional
read+update
until I get a successful result. - Similar to #1, but updating with a block of 10 or 100, then using that block to issue new ids in a separate service.
- Using a separate service altogether (sql backed?) for this purpose.
I'm also using UUIDs for records on creation, I'm only wanting to use the sequential numbers for records that are publicly published, and will be part of a URL.