Hacker News new | ask | show | jobs
by zuzululu 31 days ago
was expecting a bit more substance but always interesting to read different approaches.

but I do wonder if BEAM is a bit of an overkill, even fly.io (known among developer threads to be very unreliable uptime) wouldn't be my first pick.

Cloudflare Durable Objects really is generous, not often can you get replicated database and realtime sync for such low barrier in cost and implementation.

I do wonder tho what Cloudflare's ultimate game is, as I'd imagine once they corner the market and practically everything is running off it, wouldn't be hard to say raise the $5/month to something higher.

4 comments

> Cloudflare Durable Objects really is generous, not often can you get replicated database and realtime sync for such low barrier in cost and implementation.

BEAM gives it to you for free, and you don't rely on an Internet-scale monopoly to run it.

I love the BEAM and programmed on it for many years, but it really does not provide anything like durable objects.

1) It's very difficult to ensure globally serialized ownership with strong consistency in a distributed Erlang cluster when nodes are allowed to fail. Stuff like Horde will let you do some rough "run an instance of this process somewhere in the cluster", but it's eventually consistent (you may have multiple instances at times) and doesn't deal with netsplits well.

2) Mnesia is fine to replicate state within a network switch or very reliable LAN, but not over WLAN/Internet. It can enter split brain conditions and require external reconciliation. RabbitMQ suffered from Mnesia problems for many years and ended up replacing it with their own DB implementation using the Raft protocol.

Chris McCord just recently released a library trying to solve for this https://github.com/phoenixframework/durable_server
See these are things I did not know. This is why I said I was 'not qualified', in the post, haha. I do use Horde for the matchmaking. I have 2 hosts in the cluster.
BEAM is rarely overkill. It’s fairly simple, once you grasp the concepts. It’s just from the outside people may think it’s rocket science.
> but I do wonder if BEAM is a bit of an overkill...

Why would it matter if something's overkill? If it's not much more work, and it runs on the systems you're targeting, it's better to start with something that's more reliable than you might strictly need than to start with something that you believe to be "proper kill", only to discover that you underestimated the amount of "kill" required. Retrofitting things like proper supervision and data/crash isolation can be a huge, huge pain in the ass.

Yeah I could've been more technical. Maybe in another post. On the fly issue, I love an underdog story. I know people have complained a lot about their uptime. I suspect they are grinding very hard on that. I've not really had any issues. They also seem to be a popular elixir host so I thought why not. Deploying is heroku style, "fly deploy".