3 ms·
How does this shared cache work? and how does it solve the throttling problem?
by vlab_mech 7y ago
How does this shared cache work? and how does it solve the throttling problem?
- QueensGambit 7y agoThe shared cache stores Amazon data in our database. Subsequently, when any user makes a request, it will hit Amazon only if there is a cache miss. Lets say, user 1 makes an API call to our server to fetch browse node: 1000 (Books). The first time such request is made, our server will make an API call to Amazon using user 1's AWS key. Once we get the response back, we will cache the result and send back the result to user 1. When user 2 makes the request for the same browse node 1000 (Books), we will not hit Amazon server again. Instead, we will get the cached data from our database and send it back to the user 2 without using his/her AWS key. This way the number of API calls made will be less than one per second for a user and avoids the throttling problem.
- mooreds 7y agoHow do you deal with stale data?
- QueensGambit 7y agoI have set the cache expiry to 24 hours. If the cached data is more than 24 hours, it will fetch fresh data from Amazon.