Horizontal Scaling

We have two physical servers running Ubuntu VMs. We set up Nominatim on one Ubuntu VM. We’d like to set up the second physical server to provide reliability. Both are located in the same physical location for now.

What’s the best way to set this up? Should I set up Postgres as a cluster and run the Nominatim services on the second VM? We were thinking of setting up K3/K8. We would probably have a separate load balancer. Or is it better to just install everything in parallel, including parallel non-clustered Postgres on each physical machine?

Technically, this setup will provide you availability, not reliability.

It’s certainly easier to just install the full stack separately on each machine. Setting up a postgres cluster might simplify the update procedure, so that may depend on how often you intend to update.

Not that familiar with Kubernetes, so no comment on that.

The OSMF Nominatim servers used to be set up as a cluster for a while with one master server and the others being replication clients. The advantage of this setup is that you are guaranteed to get consistent responses from the servers and the servers running as replication clients can get away with less powerful hardware. The disadvantage is that the setup adds quite a bit of overhead for system administration.

Nowadays, we just run parallel independent installations on the servers. It’s just easier to maintain. You will get slightly different responses. In particular, the place_id, the unique ID assigned to each object, will be different on the two machines. Most users will never notice any difference. Still, it will be a good idea to configure your load balancer in a way that the same user usually ends up at the same machine.