# toluaina/pgsync

Postgres, MySQL, or MariaDB  to Elasticsearch/OpenSearch sync

Repository: https://github.com/toluaina/pgsync
Canonical: https://ross.abutalabs.com/products/toluaina-pgsync
Homepage: https://pgsync.com
Language: Python
License: MIT
License Family: permissive
Topics: elasticsearch, elasticsearch-sync, postgresql, change-data-capture, sql, opensearch, python, etl, kibana, mariadb, mysql, mysql-database, psycopg2, pymysql
Last push: 2026-08-24T23:19:08+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 97, longevity 100
- inputs: {"age_days": 2573, "days_push": 9, "days_rel": 20, "gap_med": 21, "n_releases_24m": 20}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1415, forks 210 (observed 2026-08-28T04:04:39.729312+00:00)

## What it is
PGSync is an open-source (MIT) change data capture tool that syncs PostgreSQL, MySQL, or MariaDB data to Elasticsearch or OpenSearch in real time via logical replication. Document schemas are defined declaratively in JSON, producing denormalized nested documents with no custom ETL code.

## Use cases
- keep elasticsearch in sync with postgres in real time
- sync mysql database to opensearch
- build denormalized search documents from relational tables
- change data capture from postgres wal to search engine
- index nested related tables into elasticsearch without custom code
- resume elasticsearch indexing after crashes without data loss

## When to choose
- you need real-time, transactionally consistent search indexing from a relational database
- you want declarative JSON schema-driven denormalization of nested relationships
- you need fault-tolerant CDC that resumes from checkpoints
- you prefer self-hosted sync middleware with no custom ETL code

## When to avoid
- you need semantic/vector search out of the box - that requires the paid PGSync Pro tier
- you want to sync to ClickHouse - that is a separate paid product (free only for single-table mirror)
- your source database does not support logical replication or you cannot grant superuser/replication privileges
- you need a fully managed hosted sync service

## Facets
- artifact type: service
- maturity: active
- function: etl, search-engine, database, streaming, cli
- domain: databases, developer-tools
- platform: python, self-hosted, cli
- tags: change-data-capture, elasticsearch, opensearch, postgresql, mysql, mariadb, logical-replication, denormalization, open-core, search, data-engineering, docker, linux, macos

## Member repositories
- toluaina/pgsync (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:39.729312+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:38:10.418760+00:00, confidence not recorded.
  - readme: https://github.com/toluaina/pgsync (fetched 2026-08-28T04:04:39.729312+00:00, sha 243702c8e6ab)
  - homepage: https://pgsync.com (fetched 2026-08-29T11:51:19.355472+00:00, sha fe1483e0243f)
  - site_page: https://pgsync.com/features (fetched 2026-08-29T11:51:19.359039+00:00, sha 425ca1d9f3d0)
  - site_page: https://pgsync.com/getting-started/setup (fetched 2026-08-29T11:51:19.370721+00:00, sha ce5c38962257)
  - site_page: https://pgsync.com/getting-started/installation (fetched 2026-08-29T11:51:19.372536+00:00, sha 6c3d154dd6aa)
  - registry_pypi: https://pypi.org/pypi/pgsync/json (fetched 2026-08-29T11:51:19.374616+00:00, sha a623c9efdb00)
  - site_page: https://pgsync.com/pricing (fetched 2026-08-29T11:51:19.360688+00:00, sha c1ba7396d55d)
  - site_page: https://pgsync.com/pro/pricing (fetched 2026-08-29T11:51:19.362171+00:00, sha 1559cc6fc3d9)
  - site_page: https://pgsync.com/pro/faq (fetched 2026-08-29T11:51:19.364319+00:00, sha 2e485422f2a4)
  - site_page: https://pgsync.com/clickhouse/pricing (fetched 2026-08-29T11:51:19.366446+00:00, sha 7c9f107f3b44)
- Data as of 2026-08-30T08:39:29.467469+00:00.
