MCPcopy Index your code
hub / github.com/aws/pgactive

github.com/aws/pgactive @v2.1.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.1.7 ↗ · + Follow
4,471 symbols 13,001 edges 209 files 3,021 documented · 68%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Active-active Replication Extension for PostgreSQL (pgactive)

pgactive is a PostgreSQL replication extension for creating an active-active database.

Overview

Database replication is a method that copies changes between databases instances, and is a key component for use cases like high availability, reducing latency between an application and its source data, moving data between systems such as production and test, infrastructure migration, and others. Relational databases such as PostgreSQL typically support an active-standby model of replication, where one database instance accepts changes and makes them available to one or more read-only databases. Because changes in an active-standby cluster can only occur on a single instance, it’s more straightforward to build applications that work with this deployment topology because there is a single source of truth that contains all of the latest changes.

Sometimes it’s preferable to have a database cluster that uses an active-active replication topology, where it’s possible to write data on multiple instances in the same cluster. In an asynchronous active-active replication deployment, multiple databases in a cluster can accept changes and replicate them to other databases, but this means the database cluster doesn’t have a single source of truth. Use cases for this include running a Multi-Region high availability database cluster, reducing write latency between applications and databases, performing blue/green updates of applications, and migrating data between systems that must both be writable. Applications that work with active-active database clusters must be designed to handle situations that occur in this deployment topology, including conflicting changes, replication lag, and the lack of certain convenient database features such as incremental integer sequences.

A fundamental component of active-active replication is logical replication. Logical replication uses a data format that allows external systems to interpret changes before applying them to a target database. This lets the target system perform additional actions, such as detecting and resolving write conflicts or converting the statement into something that is supported in the target database software. PostgreSQL added native support for logical replication in PostgreSQL 10 in 2017, but still requires additional features to fully support an active-active replication topology. PostgreSQL’s design makes it possible to build the necessary components for supporting active-active replication in an extension while the development community continues to add it into the upstream project.

Security

See CONTRIBUTING for more information.

License

This project is licensed under this License.

Core symbols most depended-on inside this repo

fmtId
called by 193
src/compat/14/pg_dump/string_utils.c
fmtId
called by 192
src/compat/13/pg_dump/string_utils.c
fmtId
called by 187
src/compat/18/pg_dump/string_utils.c
fmtId
called by 183
src/compat/17/pg_dump/string_utils.c
fmtId
called by 181
src/compat/16/pg_dump/string_utils.c
fmtId
called by 181
src/compat/15/pg_dump/string_utils.c
ahprintf
called by 94
src/compat/18/pg_dump/pg_backup_archiver.c
ahprintf
called by 93
src/compat/17/pg_dump/pg_backup_archiver.c

Shape

Function 3,871
Class 541
Enum 59

Languages

C89%
C++11%

Modules by API surface

src/compat/18/pg_dump/pg_dump.c191 symbols
src/compat/17/pg_dump/pg_dump.c179 symbols
src/compat/16/pg_dump/pg_dump.c176 symbols
src/compat/15/pg_dump/pg_dump.c176 symbols
src/compat/14/pg_dump/pg_dump.c173 symbols
src/compat/13/pg_dump/pg_dump.c169 symbols
src/compat/16/pg_dump/pg_backup_archiver.c103 symbols
src/compat/15/pg_dump/pg_backup_archiver.c103 symbols
src/compat/14/pg_dump/pg_backup_archiver.c103 symbols
src/compat/13/pg_dump/pg_backup_archiver.c103 symbols
src/compat/18/pg_dump/pg_backup_archiver.c99 symbols
src/compat/17/pg_dump/pg_backup_archiver.c99 symbols

For agents

$ claude mcp add pgactive \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact