Search code examples
aerospike

How to use aerospike to generate a unique auto-incrementing ID,like redis


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


Solution

  • 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:

    1. https://discuss.aerospike.com/t/auto-generate-an-id-for-a-particular-data-in-aerospike/5168
    2. How to auto generate an Aerospike primary key?