Comments (9)
@tlvenn distribution has actually been removed in the 2.x branch because it was causing issues with the introduction of new features. Can Phoenix Presence be using without depending on the entire Phoenix framework?
from cachex.
Yes, only need Phoenix.PubSub project: https://github.com/phoenixframework/phoenix_pubsub and it is rock solid.
from cachex.
@tlvenn even so, distribution has been removed from core Cachex. The intent is to fork out a new project which provides distribution but with some features removed (e.g. the LRU caching introduced in v2.x cannot be supported on distributed tables).
I will leave this open for now, but with the disclaimer that it very likely won't live inside this repo (unless I solve the consistency issues with LRU across nodes).
from cachex.
Ha oky, I wasnt aware of that..
from cachex.
Could the distribution be added just using hooks with some kind of plugin system so that we could add cachex.distributed package to provide the feature without forking the whole project ?
from cachex.
@tlvenn it only happened recently, see discussion inside #49.
And per your suggestion, that is something I've tried to figure out. My intent for a while was to have interchangeable backends for a cache, so it could be ETS, could be Mnesia, could be Redis, etc.
This would work, but the big catch is that there are some features which simply do not work in a distributed state. It could be that this repo lives on as a distributed cache implementation and I fork out the non-distributed version into a new repo (which actually makes a fair bit of sense now I think about it).
How familiar are you with Presence? Do you know if it's possible to have a "master" node? This is the only thing I need to keep distribution - if there's a master node it's trivial to implement things that are currently local-only (i.e. LRW caches) because all the cleanup processes would happen on the master and just replicate out - as it stands there's no way to determine this and so it becomes near impossible to implement correctly.
from cachex.
@tlvenn FWIW I'm looking into Presence - doesn't seem like a good fit just because the sync interval is so high (default is recommended to be 1500ms).
It also appears that it doesn't actually do discovery - you have to instruct it as to which nodes to work with.
from cachex.
@tlvenn I'm going to close this because of the distribution being stripped out. I'm planning on building up a new project aimed at being a distributed implementation in future so I'll drop a link here when that's up.
Cachex being distributed really doesn't make much sense due to the consistency issues as well as trying to be fast. My intent is to build something which is distributed at its core to improve the resiliency there.
If you have any other suggestions please feel free to let me know, but for now it looks like distribution is dying in the v1.x branch.
from cachex.
No problem @zackehh, thanks for the discussion.
from cachex.
Related Issues (20)
- Supervisor.spec deprecated and how to use multiple caches without using workers HOT 1
- Cachex Warmers Issue with 3.4.0 Elixir 1.12.3 and OTP 24.0.6 HOT 12
- Feature Request: Cache Warmer that doesn't block startup HOT 4
- Can the expire function return an :error ? HOT 4
- The `:ttl` option is not supported by the `fetch` function HOT 1
- fetch executes fallback if cached value is nil HOT 3
- Issue with specific cache key HOT 5
- Set TTL in fallback read-through cache HOT 5
- Only one call to fetch should return :commit
- Restructure around latest tooling and standards
- `Cachex.Spec.expiration` is underspecified in documentation
- What's the default expiration value when using Cachex.put? HOT 1
- Manually trigger cache warmers HOT 4
- Potential memory issues with LRW policy HOT 3
- Transactions not permitting parallel execution HOT 2
- Add a simple eviction policy to enforce limits with low memory overhead
- fetch and expire not setting TTL HOT 29
- Add a very basic LRU cache clear implementation HOT 3
- Does `Cachex.fetch` accept `ttl` option? HOT 4
- Supervisor.start_link/2 HOT 2
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 cachex.