Is there a NO KEY or auto increment strategy that i can Use for unique keys?

We are trying to implement a logging or statistics implementation with Aerospike. We have users logged in and Anonymus users making querys to our main database and we want to store every request that it’s made.

Our best approach so far is to store Records with the UserID as a Key, and the query keywords as a List like this:

    Key: 'alacret'
        searches: [
            "something to search 1",
            "something to search 2",
            "something to search 3",

As the application Architect, reviewing this, I come to several performance/design pitfalls :

  1. Retrieving and storing are two operations, getting all the list, append, and then put again seems inefficient or suboptimal
  2. By doing two operations means that I have to do both in a transaction, to prevent raise conditions, that I think would kill the Aerospike performance
  3. The documentation states that the List are data structures to sized-bounded data, so if I understand correctly is not gonna scale pretty well, especially for anonymous users who would increase the size of the list exponentially.

As an alternative, I’m proposing to move the userID as Bin, and generate a Key that prevents raises conditions and keep the save operation as a single operation, and not several in a transaction.

So, what I’m looking for is opinions and validations.


Cross-posted and responded to on StackOverflo.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.