You are designing a distributed cache.
Q) How wil the services communicate with CacheService for insertion and deletion ?
A) I answered - "we will have REST APIs for Put and get in cache service. They will be called by the services." And the interviewer was not happy. Any other options ?
Q) Service A inserts some key into the distributed cache with the same value. Service B wants to insert a value with the same key. Here, the distrubuted cache is shared across the systems. There is nothing to disallow ServiceB from using the same key. How to achieve this?
Eg.. Service A could be some profileService ..which stores useraccountNumber->Profile object.. Service B could be some transaction related service which stores userAccountNumber->List of transactions. The account number is same but both entries should be allowed and be treated as separate entities.