r/DistributedComputing • • Feb 12 '23

How does high availability and strong consistency coexist for a website like say hotels.com which needs both?

Hi folks, I’ve recently been learning about the different replication models such as single leader and multi-leader. For a high volume website like hotels.com, you would need both:

  1. High availability, redundancy etc while serving a global customer base which points to the need for multi-data center, multi-leader replication model
  2. Strong read-after-write consistency so that the same room is not double booked and each user sees a consistent and latest view of the system.

How do the two coexist? What replication model is used in such cases?

2 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/Sartorialie Feb 12 '23

I’m seeing the concept of quorum being mentioned only in the context of leaderless replication though. I think single leader replication and quorum (for acknowledging successful reads) is not a thing. The only time quorums feature in the context of single leader replication is when electing a new leader.

2

u/Legal-Flower-9612 Feb 12 '23

I was talking about quorum in the context of achieving strong consistency through replication. Eg if you have 3 replicas you can have a write quorum of 2 and read quorum of 2. There’s one leader and 2 followers

1

u/Legal-Flower-9612 Feb 13 '23

Thinking more about multi leader. You don’t really need it for availability because as long as you have replication across data centers which are not too far from each other (3 replicate are usually enough), you have availability. For eg. At AWS each Region has a few data centers 100 miles apart. You can have a replica in a few data center.

You might argue that you need it for latency - takes a while for a request from india to reach your data center in Virginia. But you can create regionalized websites like amazon does (amazon.in, Amazon.de, etc).

Legit applications of multi leader are collaborative editing (google docs) and syncing your Evernote to all your devices.

Basically multi leader seems overkill for a use case of a global website. But happy to learn more and be proven wrong.