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'
Bins:{
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 :
- Retrieving and storing are two operations, getting all the list, append, and then put again seems inefficient or suboptimal
- 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
- 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.
Greetings