educative.io

How KGS will handle load from multiple Application Servers

In the solution it has been mentioned that KGS may work in Active Passive mode. KGS may also store some keys into memory from DB so that it can quickly server the requesting Application Servers from memory.
Question: How the KGS will handle the load in case multiple request comes to it directly? What kind of DS will be used so that we can avoid locking and provide the keys directly to the AS. Also, we provide lets say 100 keys per request to AS. When 10 AS request 100 keys simultaneously how the KGS work ?

Well, I think you first fill the cache and you keep updating your cache every x time, then it is a matter your cache never gets empty. If your cache is empty you could make all those request to wait fill the cache and continue.