13.7. Postgres-XL's Global Transaction Management

The above sections described Postgres-XL's concurrency control and MVCC common to PostgreSQL. This section describes how Postgres-XL implements global concurrency control and MVCC among multiple Coordinators and Datanodes.

In conventional replication clusters, you can run read transactions concurrently in multiple standby, or slave servers. Replication servers provide read scalability. However, you cannot issue write transactions to standby servers because they don't have the means to propagate changes safely. They cannot maintain a consistent view of the database to applications for write operations, unless you issue write transactions to a single master server.

Postgres-XL is different.

As described in Section 1, Postgres-XL is composed of a GTM (Global Transaction Manager), Coordinators and Datanodes.

In Postgres-XL, any Coordinator can accept any transaction, regardless whether it is read only or read/write. Transaction integrity is enforced by the GTM (Global Transaction Manager). Because we have multiple Coordinators, each of them can handle incoming transactions and statements in parallel.

Analyzed statements are converted into internal plans, which include SQL statements targeted to Datanodes. Plans are sent on to each target Datanode, executed, and the result is sent back to the originating Coordinator where all the results from target Datanodes will be combined into the results to be sent back to the application.

Each table can be distributed or replicated as described in Section 1. If you design each table's distribution carefully, most of the statements may end up targeting just one Datanode, which is most effecient. In this way, Coordinators and Datanodes runs transactions in parallel which scales out both read and write operations.

More detailed internals about Postgres-XL's transaction management will be found in Chapter 50.