When using the cache API to store record (e.g. a booking), I have this situation in which a booking has a primary key called id and also a unique 6-character locator (a hash), and a booking can be looked up via either of them (i.e. there is a Get service and a Locate service in the booking module).
In other scenarios (users, rooms, guests, etc.), since I do not have this duplicity, I have always created cache keys based on the id, ala id-1. Should we use UUID instead of id, the same pattern would/could be followed.
So in this case I am using get_by_prefix and get_by_suffix methods to find a key such as id-1-locator-a783er, as per this article on the blog, although I have not been able to find it in the Zato 3.0 Public API. There is also a get_by_regexp method.
And I was wondering if this is the recommended way to go or whether some sort of key aliases (e.g. id-1 having aliases locator-a783er and, maybe, uuid-53cf06187b6f45e7a79ad1c6ca748de7) would be a better, and possible, way.
Or maybe this situation is not really that common?