wide-airport-5526
02/14/2025, 9:04 AMCACHE_STALE_TTL
seconds. So we will take load from the API instances. Assuming I leave the state TTL at one minute: even with hundreds of proxy instances running the API would only see that many requests per minute and I feel it should be able to handle that just fine?!
• The proxies are kept in sync. I browsed through the RedisCache
implementation and what I see is the following:
◦ If one of the instances notices the features JSON change for any of the SDK keys it will notify the other instances via Pub/Sub.
▪︎ Those instances will then immediately refresh their in-memory cache layer. That is nice, but I noticed that the in-memory cache layer, when using Redis, is only having a stale TTL of 1 second. So the maximum time the Redis notification would remove from “different proxy instance having different states” is that one second.
▪︎ They will also notify any clients connected via server send events so they can update immediately. I’m not sure we will be using SSE and I also see a potential downside: If you notify all clients simultaneously they will also all go a update their state at the same time, creating a bit of a thundering herd problem (unless there is an artificial jitter in the SEE implementation - I have not checked in detail)
Did I miss anything where Redis is used or did I make any mistakes in my analysis? Because if not I think I might not setup Redis for out deployment. One less piece of infrastructure to manage and monitor