Skip to content

PGSync

PGSync PGSync

Coverage Package version Python versions GitHub stars

Real-time data synchronization from PostgreSQL, MySQL, and MariaDB to Elasticsearch and OpenSearch—continuously and transactionally.

Get Started GitHub PyPI Docker DigitalOcean Marketplace


What is PGSync?

PGSync is a lightweight middleware that captures changes from your relational database and writes structured, denormalized documents to your search cluster.

Define your document schema once in JSON, and PGSync handles change capture, ordering, and delivery automatically—no custom ETL code required.

  • Change Data Capture — Automatically captures INSERT, UPDATE, and DELETE using logical replication
  • Low Overhead — Minimal impact on database performance
  • Fault Tolerant — Resumes from last checkpoint after crashes
  • Nested Documents — Transform relational data into deeply nested JSON

Quick Start

pip install pgsync
{
  "database": "mydb",
  "index": "books",
  "nodes": {
    "table": "book",
    "children": [{ "table": "author" }]
  }
}
pgsync --config schema.json --daemon

PGSync is supported by DigitalOcean.

DigitalOcean