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.

New · PGSync Pro

Real-time semantic & hybrid search on top of PGSync, vectors kept fresh by change data capture, re-embedded only when meaning changes. Explore PGSync Pro

New · PGSync ClickHouse

Stream PostgreSQL → ClickHouse in real time for analytics, mirror a table for free, or denormalize a whole relational tree into one wide table. Explore PGSync ClickHouse


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
---> 100%
Successfully installed pgsync

Define your schema in JSON:

{
  "database": "mydb",
  "index": "books",
  "nodes": {
    "table": "book",
    "children": [{ "table": "author" }]
  }
}

Then start syncing:

$ pgsync --config schema.json --daemon

The PGSync family

PGSync is free and open source. PGSync Pro adds real-time semantic & hybrid search; PGSync ClickHouse streams your data into ClickHouse for real-time analytics. Same schema.json, same CLI.

  • PGSync · Community


    Free & MIT. Real-time sync from PostgreSQL / MySQL / MariaDB to Elasticsearch / OpenSearch, change data capture, denormalized documents, and the Django integration.

    Get started

  • PGSync · Pro


    Everything in Community, plus semantic & hybrid search that re-embeds only when meaning changes, hosted embedding providers, and an MCP server for AI agents.

    Explore PGSync Pro

  • PGSync · ClickHouse


    Real-time PostgreSQL → ClickHouse for analytics. Mirror a table free, or denormalize a whole relational tree into one wide table (paid), on ReplacingMergeTree, always fresh.

    Explore PGSync ClickHouse


PGSync is supported by DigitalOcean.

DigitalOcean