How to use aerospike to generate a unique auto-incrementing ID,like redis
i want to use aerospike to generate a unique auto-incrementing ID,like redis 。I don’t know how I can do it,Has anyone tried this?
For example: If I am saving some Person data in DB, Do I need to create a uid for the Person or it is auto generated by the database
2
Answers
Aerospike doesn’t support auto-incrementing ID due to its distributed nature.
Check out the following threads that describes it with more details.
Alternative suggestion might be to use a generated unique id as a primary key:
Check out using ULIDs perhaps, these can be generated client side and there are libraries for many programming languages.
Quoting from their spec:
We use these for client side ID generation in the Redis OM libraries.
https://github.com/ulid/spec