-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plans for an IDistributedCache
implementation?
#85
Comments
IDistributedCache
implementation?IDistributedCache
implementation?
Thanks @jodydonetti - great spot! I don't know anything about the Garnet side of things (I'm involved in caching on behalf of the asp.net team); I'm going to assume no immediate changes to Garnet to support Lua or something like redis "modules" (i.e. loadable server-side commands) is possible; happy to be corrected. But building on that assumption: I think this is more of a question for me, over in https://github.com/dotnet/aspnetcore; IMO what we should do here is ... (reads the code)... you know, reading that code, there's nothing there that needs Lua; the "get and extend sliding" would have been a good fit for Lua, but: we don't use Lua for that - we only use it for the set path, with code that doesn't actually depend on the existing DB state; frankly, we could just multi/exec or F+F pipeline the On unrelated Garnet-ish : I've been speaking to the FASTER folks about whether we should also have a FASTER cache for disk-based (non-server) local cache via |
I've created a ticket "over there ^^^" - can someone confirm whether Garnet has |
Quickly looking at the code: yes, it support |
Garnet supports C# server side transactional stored procedures which are way superior to Lua scripting, plus thread scalable. Will be easy if we could make ASP.NET use that. Stored procs are accessed via custom commands - DB.Execute in SE.Redis. And yes, we have MULTI/EXEC as well. That should be thread-scalable too. Maybe a tad bit slower. Would be interesting to compare performance. |
More info here: https://microsoft.github.io/garnet/docs/extensions/transactions |
I ended up just switching it to pipeline (no In theory I'm fine with a custom stored proc approach, but it creates fun new places to fail:
By contrast, when simply pipelining, the exact same code should JustWork™ everywhere |
My 2 cents on the overall approach: if by slightly changing the standard Redis impl to avoid using LUA scripts leads to better perf "this is the way". If that in turn also leads to be compatible with Garnet, even better. On top of that, if (and only if) it makes sense to better use specific features of Garnet and get even more perf (and maybe also add some extra features on the concrete impl?) then a Garnet-specific impl of Users can then either:
|
@mgravell |
Already done in dotnet/aspnetcore#54689; should work from preview4 onwards, and yes that includes backport to older TFMs - we target ".NET current" (so: .NET 9 in preview 4), net462 and ns2.0 |
Related to #550 |
Sounds like this is already done, so closing. |
Hi all, are you planning on creating an
IDistributedCache
implementation anytime soon?Since Garnet has been announced as being protocol-compatible with Redis I thought it would've worked right away by using the standard Redis implementation (see here), but after actually playing with it I discovered that Garnet does not currently support LUA scripting:
LUA scripting is what has been used in the aforementioned impl (see here) and therefore without it it's not possible to use Garnet this way.
Having a working impl of
IDistributedCache
for Garnet would drive the adoption a lot, since that is the standard way of using a distributed cache in .NET.Also, that would unlock other great possibilities like being able to use Garnet in projects that use
IDistributedCache
as a "lingua franca", like FusionCache (mine) which is compatible with any impl of such interface (here for more).All in all I think that, if the effort for such impl is not huge, that is something that you should consider to skyrocket the usage.
Thoughts?
ps: maybe @mgravell can give us some hints about such approach? Are there any hidden pitfalls that should be looked at?
The text was updated successfully, but these errors were encountered: