I want to store in Aerospike the maps of profiles(profileId(int type) → string) by some string keys (these keys count not limited). In other words - hash tables inside hash table:
map[string]map[int]string.
And I have two use cases:
Fast find all profiles by string key
Fast find concrete profile by profileId key and string key
I found the next solution: store all in one record. Every bin will have the following form:
So for question 1:
We just create a query statement with filter equal to that bin we already indexed, response will be very fast as it only search in memory ( remember no expression operation here )
For question 2:
Just get directly record by key combined from your key string and profile id
Hope that help. ( sorry if it feel aggressive as my english is not good so i just write it straigth what i thought )