Building a High-Availability System with Unreliable Free VPS as a Broke Indie Developer
TL;DR Run two or more unreliable free VPS as multi-master peers: WAL records writes, multiple nodes confirm persistence, logs replicate, deterministic conflict rules apply — data survives, and the service keeps running when one node dies.
I’ve written a few posts before about free resources for indie developers, including free VPS, free frontend and backend resources, and how to build an app for yourself in the shortest time.
Now let’s get into the details.
The biggest worry about free resources is instability. Say you build an app, slowly accumulate a lot of data, and then one day the provider shuts down your server for no reason — and all your data is gone.
Today I want to talk about exactly that. It is entirely possible to build a high-availability system out of multiple unreliable free VPS. That is the core idea of distributed system design: build a reliable system out of unreliable nodes.
First, let’s narrow down the problem.
The system we want to build should be small — for personal use or a tiny number of users, where you can’t justify the cost of a server. If you have a lot of users, stop trying to save on server costs.
Second, you need at least two servers. We talked about this not long ago: there are many platforms offering free servers these days. At the scale of a small personal system, the smallest free tier on each platform is more than enough, so getting two free VPS is not hard.
Third, the core goal of reliability is to make sure data is never lost — and while at it, to avoid duplication or mess caused by backups. On top of that, it would be nice if the system keeps running normally when any one server dies.
In short, we want a dual-master (or multi-master) mutually backing-up distributed system. The system keeps working when any node goes down, and a human can step in quickly to bring up a replacement node.
Of course, if all your servers go down at the same time, you’re just unlucky. You can also add another layer of protection with a free database like Neon or local data to handle that extremely unlikely case, but I won’t go into it here.
To make good use of multiple servers, a key question is how to keep data in sync across them. Imagine two servers writing data at the same moment, and those two servers then have to sync with each other — how do you ensure both end up complete and correct? Sounds like a headache, right? With three servers or more, the sync logic only gets more complex and completely unmanageable.
By the way, why don’t we use an active-standby setup, with only one primary serving requests and data flowing one way from primary to backup, and instead use multi-master mutual backup? This comes down to another problem broke developers face: the network conditions of these free servers are out of our control. You might get a machine in the US, or one in Australia, and latency can be huge when using them. That’s why we want every machine to serve requests, so the frontend can pick a relatively fast node to talk to.
Now, how do we achieve consistency across multiple masters? This is a classic problem in distributed systems, and there are classic design patterns to solve it.
The Write-Ahead Log (WAL) pattern, for example, can greatly reduce the complexity of syncing data across multi-master nodes. (This introduction is taken from my earlier post Common Patterns in Distributed System Design.)
The idea of WAL is simple: the server stores each state change as a command in an append-only file on disk. Because appends are sequential disk writes, they are very fast and barely affect performance; when the server crashes and restarts, replaying the log rebuilds the in-memory state.
In other words, you persist the data at a small cost first, and then between nodes you only need to sync the WAL, and each node replays it to regenerate the business data.
Based on the WAL pattern, we can design the main flow for syncing data across nodes:
- Log first, work second: when a client write request reaches any node, the node first appends the request verbatim to its own WAL and commits it to disk, then runs the actual business logic.
- Writes carry identity: each write request carries two IDs — one marks “which thing I’m changing” (
client_id), the other marks “which attempt this is” (op_id). A retry reuses the sameop_id; a later edit of the same thing uses a new one. This way, replaying the same log any number of times yields the same result. - A successful write follows the durability rule: after committing the log locally and running the business logic, the node does not return success immediately. It waits until at least
Fother nodes have committed the same log to disk (F=1by default — finding one peer is enough) before telling the client “write succeeded”. An acknowledged write therefore lives on at least two disks, and losing one machine won’t lose it. - Whoever has the log relays it: every node holding the log is responsible for relaying it to nodes that don’t have it. So even if the node that first accepted the request dies, the others can still fill in the gaps.
- Replay takes the same path: nodes that receive the log don’t update a field directly — they feed the original request through the exact same business handler used locally. That avoids the mismatch of “one logic on the master, different logic on the backups”.
- Conflicts follow a deterministic rule: when two nodes change the same thing at once, each version gets a
rev(revision); the higherrevwins, and if they are equal, the higher node name string wins. The rule is fixed, so each machine computes the same result on its own — no need for anyone to arbitrate. - Replay in order: logs from the same node carry a sequence number (
seq) and must be replayed in order. A higher sequence that arrives early can be stored, but if there is a gap in front of it, it cannot jump ahead — it waits until the gap is filled.
See, the whole thing is much simpler now?
At the end of the day, the unpredictability of free VPS can’t be eliminated: machines can be reclaimed, rebooted, and networks can act up at any time. What we can do is not hope that one machine stays alive forever, but accept that every machine is unreliable and use a mechanism to ensure “acknowledged writes are never lost, and the service keeps running when any single node dies”. This is the path distributed systems have validated over and over — except what used to be a game for big companies with hundreds of machines is now something we can build for ourselves with a couple of free machines.
I’ve packaged this whole workflow into a skill: high-availability-with-freevps-skill. It breaks everything described above into executable steps — how to assign node identity, how to design the WAL tables, how to log a write before replaying it, why success requires confirmation from F nodes, how conflicts are resolved by a deterministic rule, and how to recover after a crash — plus a checklist of failure tests that must pass first. If you want to build this system, you don’t have to rediscover the pitfalls yourself: just hand the skill to an AI and let it follow the steps.
Two or three free machines are enough to safely cover “data not lost, service not interrupted”. For a small personal system, that’s more than enough.








