ZiggyCreatures / FusionCache

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.
MIT License
1.92k stars 97 forks source link

Distributed counter #336

Closed viniciusvarzea closed 10 hours ago

viniciusvarzea commented 4 days ago

Hello @jodydonetti, I am wondering, is there any way to implement a counter using the fusion cache + redis + backplane ?

the application runs on multiple nodes and have a high concurrency (about 200rps for a single counter).

Thank you bro, I am looking at the changes for the new 2.0 version and it looks amazing, you are doing a great job…

jodydonetti commented 3 days ago

Hi @viniciusvarzea

Hello @jodydonetti, I am wondering, is there any way to implement a counter using the fusion cache + redis + backplane ?

Nope, and to be honest I don't think it's the right place to have it in a generic .NET cache with multiple implementations which can have different features available (eg: Redis, MongoDB, etc).

My suggestion is to directly use the StackExchange Redis library to do that and, as a nice extra optimization, share the same IConnectionMultiplexer to save on connnections. You can do this via the ConnectionMultiplexerFactory in the RedisBackplaneOptions class.

Thank you bro, I am looking at the changes for the new 2.0 version and it looks amazing, you are doing a great job…

Thanks, I really appreciate that 😬

I'm working hard on it and a new preview will be out soon.