pejrich
The short of what I want is a replicated cache that anytime a new node joins the cluster (via libcluster), data from the existing cache on another node is copied to the new node.
Example
Node A has the data.
Node B joins cluster.
Data is copied from A to B.
Node A leaves cluster.
Node C joins the cluster
Data is copied From B to C
Also if C joins before A leaves, I don’t really care if the data comes from A or B.
This is not mission critical data. It’s just caching a temporary check-out session, so I don’t need any crazy consistency.
Does this exist? What tools would be best to use?
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hi everyone.
My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
How Can I Optimise Compile Time Dependencies
I have been building an elixir application for about 2 years now. Many modules and files ha...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #ai
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming











Showing Posts 13 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
quatermain
redis and other tools are good, but cloud service where we have to run it have some issues. K8s works, let’s say works without huge issues. But other services has outages. And running own service in k8s is first expensive because you have to have bigger resources for k8s itself and it still doesn’t resolve whole issue.
Only one reason why we use k8s, we have 2 envs(prod, non-prod) and together we runs about 30-40 elixir apps there. So we use it only because of orchestrations. We use flux so gitops resolve a lot of issues for us. But I really hate it. We used docker swarm 4 years ago and it was bad. I’ve never used Nomad, so not sure about it. We don’t have own SysOps department so we use managed solution from IBM. IBM is only one allowed cloud provider by our regulator. We can order some SysOps company/contractor to create some infra but it has to be maintained and we don’t want to care about it. So looks like we don’t have another options. We can not use AWS btw.
dimitarvp
I agree that in-process cache (
:ets) is the super-performant solution. But I’m not sure how good the BEAM is if you want to have a distributed ETS cache. Hence why I proposed other programs.Redis is rock-solid, what problems did you have with it?
Additionally, be extremely careful with k8s. If you don’t have 10+ different apps and storage services with management of private networks and special-tailored infrastructure then the chances are 99% that you don’t need k8s.
You would likely be better served by Nomad or Docker Swarm.
quatermain
I’m talking about 4-6 apps, pods in k8s. Yes, 3rd party/external service for it good solution. But it has to be fast and also we have issues with these external services. For example my use case is about loosing dependency on DB(Postgres) so we can be fully (most important features) available even when DB is not available. We are preparing for new client who will use api and some web endpoints with rate about 300 r/s + other clients. So downtime a few seconds can be huge problem for us. But I don’t have budget to get some huge solution for it. Even, I don’t think I need black box solutions when we have power of BEAM.
dimitarvp
To be fair I’d just go for memcached or Redis and forget about it. They both serve this goal excellently.
If there is no distribution involved I’ll go 100% Elixir but when it gets to 3 or more machines my priorities change.
sb8244
FWIW, I used the Cachex + pg2 solution and had 0 issues with it in production since it shipped. I’ve since left that company, but my understanding is that it’s just churning along doing its thing.
So that’s a good endorsement for me, although it depends on your use case.
quatermain
hi, any new experience with this issue after 2 years? Or ideas about good solution for this kind of use case? Have you considered Mnesia? For example Memento is Elixir wrapper around Mnesia.
Did you use Cachex? Any feedback?
I have similar issue and I’m trying to get feedbacks/experience from users of these solutions.
dimitarvp
From the latest commit there:
stavro
I was following the work being done on FireNest (https://github.com/phoenixframework/firenest/pull/21) - with a branch having some work on seemingly generic state replication. Unfortunately that project has now been archived. Hopefully we’ll see some movement in the replication arena from the core team again.
sb8244
That feels like it would be a misuse of Phoenix.Tracker (you wouldn’t want presence in this case). Tracker is great for monitoring processes across the cluster and can accept metadata, but isn’t the best choice if you don’t need process tracking.
Presence uses CRDT which are available standalone as well, although they can have performance trade-offs so make sure to throw scenarios at it before committing.
Qqwy
So you only want to use this as an ephemeral cache?
It might be worth looking into Phoenix Prescence, because it also fills in this need somewhat.