cabol / nebulex

In-memory and distributed caching toolkit for Elixir.
https://hexdocs.pm/nebulex
MIT License
1.25k stars 74 forks source link

Adapter for Mnesia #29

Open cabol opened 5 years ago

cabol commented 5 years ago

The idea with this adapter is to provide another backend and be able to support different distributed topologies (replicated topology is a must).

sheharyarn commented 4 years ago

Was wondering if there has been any activity on this front? We recently felt the need for persistence in our cache layer and was wondering how easy would it be to get Mnesia working with Nebulex.

And thank you for the amazing package. I absolutely love Nebulex!

cabol commented 4 years ago

Hey @sheharyarn, glad to hear that, thanks a lot :) !!

On the other hand, about the Mnesia adapter ...

Was wondering if there has been any activity on this front?

Right now it is kind of stuck, there have been other priorities, so a raw estimation to get it done could be 2-3 months. But this is on the top of the coming features for Nebulex along with the instrumentation via Telemetry.

We recently felt the need for persistence in our cache layer and was wondering how easy would it be to get Mnesia working with Nebulex.

I'd say it is easy, at least it shouldn't be that hard, there are a lot of examples of adapters that you can check and get a better idea. Also, I think this can be useful too: https://github.com/cabol/nebulex/issues/51. It was the latest adapter, and within that issue history, you will find the suggestions, etc.

For me, the "hardest" part is the eviction algorithm, which is what defines a cache, e.g.: LRU, LFU, or the generational cache implemented by the local adapter. For the first draft, you can just skip that part and do something simpler, only implementing: Read-through and Read-through

So, if you want to implement it and contribute, it would be awesome, and I can help you with any questions or guidance you may need. Stay tuned!