Comments (4)
Right, currently the only adapter that offers data persistence is the Redis adapter, because of Redis itself, you know Redis provides support for persistence already, so I'd say more than the adapter is Redis, you can configure it for data persistence.
from nebulex.
This is a good/interesting question. The dump/load commands are mainly meant for running on-demand and be invoked from your application. For example, you may have a job/process/gen_server in your app that runs from time to time (or when there is a graceful shutdown you could dump the data before stopping the app) and calls the dump
command to take a snapshot of the cache, and another job/process/gen_server that runs when the app starts and tries to restore the cache from a file by calling the load
command. Certainly, this is a very naive approach that won't avoid losing data but at least will avoid losing everything. However, there may be situations you don't want to lose any data, in that case, the adapter should provide also persistence, like Redis for instance, you can configure it for persisting data, but this is on the adapter side. Let me know if that helps, I stay tuned, thanks!
from nebulex.
Hey,
Thanks for the response.
In this case the main goal is to achieve a sort of pass-over between deployments just to cover edge cases.
I did what you mentioned too, added a process that starts after the cache and upon shutdown it dumps the cache to a file and on startup it loads it. Seems to achieve what I was looking for here.
Thanks!
from nebulex.
How would I achieve data persistence? Which adapter offers that? Or you meant that for Redis only?
from nebulex.
Related Issues (20)
- `Nebulex.Cache` callbacks mention "Shared Options" section that do not exist
- Support for functions that can set TTL in Decorator similar to Match HOT 9
- random :erpc, :timeout with partitioned get HOT 2
- Is there any way to get the size of the cache? HOT 4
- Seeing Nebulex.RPCError during deployments with partitioned adapter HOT 4
- Nebulex.RegistryLookupError HOT 9
- Ambiguity regarding ttl and gc_interval relation. HOT 4
- Replicated adapter syncing during rolling deployment HOT 5
- Bug on Local adapter when using `delete_all` and keys are nested tuples: not a valid match specification HOT 3
- is allocated_memory param global on per node when using Nebulex.Adapters.Partitioned with :shards HOT 2
- Dangling reference on `cache_evict` when using referenced keys HOT 4
- Regression on decorated functions and Elixir 1.16 HOT 3
- Empty arguments list passed to `generate/3` in Elixir 1.16 HOT 3
- `Multilevel` inclusive cache doesn't duplicate entries backwards on `get_all/2` HOT 3
- Fix compatibility with Elixir 1.15 and 1.16 HOT 3
- Support cache refreshing in the background HOT 1
- Having a cache per user ID... HOT 4
- 2.6.2 is missing from tags and releases on github HOT 1
- Cache.all(nil, return: :value) with a partitioned cache gives incorrect results HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nebulex.