Hi, I have an object which has map inside it.
e.g Person - > Map (city_visited,counter_for_number_of_times_city_visited). I am trying to design this use case in aerospike so that i can do CRUD in single transactions. Below are the things that i tried.
- Storing map directly as a bin - But issue in this case is I have to take out map and iterate over the map to get the counter and in mean time someone can update the set.
- Storing city_visited as different bins - But in this case we have many bins and it grows as the city_visited increases and there is no way to maintain the counter.
- Take 2 set one for person and other for counter like below:
Persons (bin) - personId (PK), personName, person_description. Counter (bin) - personId|city_visited (PK), counter, personId(Secondary Index).
Here it would be possible to query counter and also counter statistics.
Just wanted an opinion is there any other good way of doing it?. Also if we add secondary index then i believe it should not be done at runtime due to performance hit. I am trying to use aerospike as a cache in my application.