PG-RAC: PostgreSQL-based Database with Shared Cache for Multi-write Transaction

Yujie Yin, Hao Shi, Zihao Fan, Huahui Zhou, Shengchi Liu, Huiqi Hu, Xing Wei, Hedui Chen, Yaofeng Tu, Peng Cai, Xuan Zhou · International Journal of Software and Informatics · 2025

Single-master is the mainstream architecture of cloud-native databases. In the cluster, the slave node can share the read-only requests of the master node, and the master node processes the write requests. To meet the demands of large-scale transaction processing, on this basis, some of the cloud databases attempt to further extend multi-write transactions. One way to implement a multi-write extension is to implement a shared cache among compute nodes and support cross-node data access. In database systems based on shared cache, the cost of cross-node remote access is much larger than that of local access, so the design of the cache protocol is the key factor affecting the system's performance and scalability. In this study, two innovative improvements to the cache protocol are proposed, and PG-RAC, a shared cache database supporting multi-write transaction processing, is implemented based on PostgreSQL. On the one hand, PG-RAC proposes a new distributed chained routing strategy to distribute routing information among compute nodes. The average transaction latency is reduced by about 20% compared to the routing strategy of single-point directory management. On the other hand, the replica invalidation mechanism is improved, and the invalidation operation is separated from the transaction path, reducing the latency of the critical path in transaction processing. On this basis, PG-RAC utilizes the characteristics of multi-version concurrency control (MVCC) to further propose to delay replica invalidation, effectively improving the cache utilization. The results of the TPC-C experiment show that in a cluster with four compute nodes, the throughput rate is nearly twice that of PostgreSQL and 1.5 times that of the distributed database Citus.

Read the paper · More papers on PaperTik