newton-peixoto

newton-peixoto

Replicate state across nodes

Hello everyone! I`m currently trying to create a demo to learn more about distributed nodes and elixir libraries.

I created this repo and the goal is to create N nodes, make them all see each other, run 1 “cache” (genserver) process across the entire cluster, when the node that is parent of the said process dies, a new process is created inside other node and the last part would be to keep the state when the new process starts.

The cluster part and restart I was able to develop using horde and libcluster libraries but I dont see a way to keep the state across the nodes. Horde says something about handoff and save the state at redis, postgress or something like that… I`d like to develop this using only elixir / erlang. It also mentions delta crdt and other blog posts says something about mnesia but I dont get a way to make neither of them see the dynamic nodes once that all docs I read mentioned to set some pre known node list.

Here is the repo

Can someone please mention an alternative or solution to this problem?

PS: I`m also facing some latency when accessing the endpoint if u spot some problem that could be causing that it would help a lot THANKS :smiley:

Most Liked

tfwright

tfwright

So I don’t have experience with Horde, but it looks like that works pretty similar to what I described under the hood, viz. the data is replicated across all nodes, so you wouldn’t need anything else, you’d just use Horde to globalize your Genserver process and it will handle the details for you. Hopefully someone with more experience with the library will be able to confirm with more details, but you might want to include “Horde” in your title/tags.

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement