A feature that is currently planned for this year is expanding the predicate filter functionality to other aerospike operations like get/put which would enable this functionality not only on generation but also on a counter within a record or other in-memory record metadata such as ‘last-update-time’. A bin counter would have the advantage of changing as a developer would expect but would be at a performance disadvantage since it would require a storage access and a slight space disadvantage since it would require space for the counter in storage.
Cons for using generation:
- The maximum value for a generation is 65535 in AP and 1023 in SC.
- If you recreate a record that had been previously durably deleted the generation continues from the previously deleted version (+1 for the durable delete change).
- The generation doesn’t necessarily change as the programmer may expect. Currently in AP the only exception is durable delete, but in SC there are scenarios where the server will increase the generation (such as re-replications). Typically these are rare.
Knowing these limitations/caveats, are you still be interested in using generation for this purpose.