0

I want to store two records in a set only when those records have different values in a specified bin. For example, in a set containing 3 bins of (CS, P, Fees), I tried to store 3 different records:

Record1(CS1, P1, Fees1)
Record2(CS2, P1, Fees2)
Record3(CS3, P2, Fees2) 

Only Record1 and Record3 are allowed and Record2 is not allowed.

How can I make a bin unique in Aerospike?

honk
  • 9,137
  • 11
  • 75
  • 83
  • 2
    What do you mean by 'not allowed'? Aerospike is a KV system, and your record operations are completely independent of the data in other records. No coordination or lookup between them at all. If they have a unique 3-tuple of (namespace, set, PK) there is no connection between them at all. – Ronen Botzer Jun 17 '16 at 20:24

1 Answers1

0

As far as I know, you can't achieve that by aerospike (at least by community edition).
What you are looking for is what we call 'unique index', which make sure that the indexed field not store duplicate value.
'unique index' is not supported by aerospike, or rethinkdb.

If you want to know more (please don't mark this as irrelevant, just a hint for the author) :
You can try mongodb to use unique index. However, pay more attentions, you have to do the tradeoff and give up the advantages which aerospike can provide.

sel-fish
  • 4,308
  • 2
  • 20
  • 39