[Circuit Breaker] Can this component be used in an environment with mutltiple front ends?

Forge Component
Published on 26 May by Carlos Sousa
0 votes
Published on 26 May by Carlos Sousa

Hello Carlos,

Regarding the usage of ASP.Net memory cache for circuit breaker persistence.

Am I stating correctly that this component does not take into consideration environments with multiple front ends? 

Also, in your article (nice read btw), you mention the implementation using ASP.Net cache, but the extension uses MemoryCache which is similar(better) but not the same as ASP.Net cache.



Hi Daniël,

I'm glad you find the article useful.

You are correct. I'm using the MemoryCache object (System.Runtime.Caching) and not the HttpRuntime.Chache (System.Web.Caching).

The way I refer it in the article is meant to indicate the type of persistence (in memory cache) in use, not be that specific regarding the actual implementation, since many of the readers may not have as much detail. Still I will rephrase it so it doesn't induce any error. Thanks for pointing that out.

You're also correct in the part where the cache state is not maintained across frontends. As I mention in the article this is a simplified implementation and may need some tweaking to fit your purpose.

Still I find this implementation pragmatic enough to collect a lot of benefits in an extremely simple way of using it. while I agree it's not as good as it could be.

If keeping state across FEs is relevant for a use case, then we'd need to use some kind of external persistent system, in which case, an in memory database like Redis (or similar) would be a good fit.