Sparta’s Dual Kingship and PostgreSQL Active-Active
Wednesday, October 23 at 14:00–14:50
With the improvements in logical replication released in PostgreSQL 16, there is an increasing interest in active-active clusters in PostgreSQL. We have observed new blog posts and conference talks on the subject discussing possible architectural configurations. Many projects want to move from vertical to horizontal scalability, enticed by the benefits of scaling out. But the illusion of a transparent active-active cluster is broken when faced with the challenges of having multiple writable database nodes.
In classical Greek government systems, we find the example of Sparta, having a Dual Kingship system. The motivation of such a system with two masters was not to scale-out the government, but to prevent absolutism. Despite the different motivation, there are several lessons we can take from Sparta’s system in order to build an active-active PostgreSQL cluster. When is consensus needed? When can rulers take autonomous decisions? When do rulers need a third party to resolve conflict? In fact, the Spartan’s Dual Kingship systems was able to scale-out in times of war, using a technique that can be seen as sharding, which is also useful for databases in times of heavy workloads.
In this talk we will learn about the possibilities and challenges of a PostgreSQL cluster when multiple writable nodes collaborate to a common goal, and how we can apply lessons from classical Greek government systems.