Skip to content
CAI
Software that uses CAICheck a score

shayonj/pg_easy_replicate

52.5

Adequate · 6 November 2026

1.8k

lines of production code

Ruby

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

PgEasyReplicate is a Ruby-based command-line tool designed to manage logical database replication and facilitate switchover between PostgreSQL instances. It provides capabilities for group-based replication orchestration, schema copying, and the tracking and application of DDL changes during data synchronization. The system also includes features for index optimization, status notifications, and comprehensive configuration validation to ensure reliable data consistency.

Features

Introduce DDL tracking, index optimization, and notification capabilities

PgEasyReplicate now supports tracking and applying DDL changes (schema modifications) during replication via the new \--track-ddl\ bootstrap option and \ddl\_audit\ module, allowing structural changes to be synchronized alongside data. The tool also adds an option to drop and recreate non-primary indices post-copy to reduce I/O and speed up data transfer, and introduces a \notify\ command to send replication status updates to a specified URL. Additionally, the CLI now supports AWS and GCP special superuser roles, allows excluding specific tables from sync, and provides a \--skip-vacuum-analyze\ flag for the switchover process.

_lib/pg\_easy\replicate · high confidence

New e2e-bootstrap and e2e-start scripts for testing pg\_easy\_replicate

Added \scripts/e2e-bootstrap.sh\ and \scripts/e2e-start.sh\ to automate end-to-end testing of the replication tool. The bootstrap script initializes a \pgbench\ database and runs \config\_check\ with the \--copy-schema\ flag. The start script orchestrates a full replication lifecycle: bootstrapping a cluster, starting sync with \--recreate-indices-post-copy\ and \--track-ddl\, applying a sample DDL change via \apply\_ddl\_change\, and performing a switchover. A \scripts/release.sh\ script was also added to build and push the gem to RubyGems and GitHub.

scripts · high confidence

Behavioural changes

Major refactoring of core replication logic and configuration validation

The library has been significantly restructured to improve reliability and feature support. The internal database communication layer has been migrated from the 'Secure' module to Sequel ORM, and the 'lockbox' dependency has been removed. Configuration validation is now more robust, explicitly checking for superuser privileges on both source and target databases and verifying that tables have appropriate replica identities. New capabilities include support for special user roles, the ability to copy schemas via pg\_dump, and the introduction of group-based management for replication tasks, alongside new modules for index management, orchestration, and DDL auditing.

lib · high confidence

Renamed console script and removed setup script

The bin/console script has been renamed to bin/pg\_easy\_replicate\_console to better reflect its purpose. Additionally, the bin/setup script has been removed entirely, eliminating the automated bundle install and other setup steps it previously performed.

bin · high confidence

Ruby 3.4 upgrade, Docker image rebuild, and CLI documentation overhaul

The tool now requires Ruby 3.0+ (with the Docker image and .ruby-version updated to 3.4.4) and uses a rebuilt Dockerfile that installs the gem via apt-based PostgreSQL client dependencies. The README has been significantly expanded to document new CLI capabilities including group-based replication, DDL change management, stats/notify commands, and special user roles for AWS/GCP, while the CHANGELOG.md file has been removed from the repository.

(repo-wide) · high confidence

Test coverage

Added comprehensive test coverage for pg\_easy\_replicate core components; Expanded test suite for smoke testing, configuration validation, and role management.

Dependencies

Major dependency overhaul and Ruby version bump

The gem has been upgraded to version 0.4.0, requiring Ruby 3.0 or higher. This release removes the \lockbox\ dependency and introduces \pg\_query\ and \Sequel\ as new runtime dependencies, while updating \pg\, \thor\, and \ougai\ to newer versions. Development dependencies for \rake\, \rspec\, and \rubocop\ have been relaxed to allow broader version ranges, and the gem's description has been updated to reflect its focus on logical replication and switchover capabilities.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 53 → 53 (-0.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 67 → 67 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 43 → 49 (+5.9)
  • Readiness 48 → 48 (+0.0)
  • Security 73 → 51 (-22.3)

Resolved (6)

  • Documentation: no architecture or design documentation
  • Duplicate intent for DDL tracking initialization. 'DDLManager.setup_ddl_tracking' and 'DDLAudit.setup' appear to initialize the same underlying DDL audit/tracking infrastructure, but with different signatures and responsibilities.
  • Inconsistent naming convention for CRUD operations. 'Group.find' uses 'find', while 'Group.delete' uses 'delete'. Other methods use 'create', 'update', 'drop'. 'find' is often associated with returning a single object, while 'delete' is an action. 'drop' is used for 'Group.drop()', suggesting a database-centric terminology.
  • Inconsistent parameter exposure between CLI and Orchestrate layers. 'CLI.start_sync' takes no arguments (likely reading from config), while 'Orchestrate.start_sync' takes 'options'. Similarly, 'CLI.stop_sync' takes no args, but 'Orchestrate.stop_sync' requires explicit connection strings. This forces CLI users to rely on implicit config while direct API users must provide explicit details.
  • Redundant configuration methods with identical signatures. 'config' and 'assert_config' likely perform the same validation or setup logic, creating confusion about which to call.
  • Semantic overlap between CLI entry point and internal module method. 'CLI.config_check' likely delegates to or duplicates the logic of 'PgEasyReplicate.assert_config', exposing internal implementation details through the CLI interface while also exposing the raw method.

New (8)

  • High secret: WD-SECRET-0005 (docker-compose.yml)
  • High secret: WD-SECRET-0005 (scripts/e2e-bootstrap.sh)
  • High secret: WD-SECRET-0005 (scripts/e2e-bootstrap.sh)
  • High secret: WD-SECRET-0005 (scripts/e2e-bootstrap.sh)
  • High secret: WD-SECRET-0005 (scripts/e2e-start.sh)
  • High secret: WD-SECRET-0005 (scripts/e2e-start.sh)
  • High secret: WD-SECRET-0005 (scripts/e2e-start.sh)
  • Rotate the exposed credentials — git history can't be un-committed

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

shayonj/pg_easy_replicate was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit d725ab2e6afd21a0bab1dd405f5fbefeab0a01b1 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.