{"id":51082990,"url":"https://github.com/kanutocd/cdc-parallel","last_synced_at":"2026-06-23T20:00:53.932Z","repository":{"id":362149047,"uuid":"1255096755","full_name":"kanutocd/cdc-parallel","owner":"kanutocd","description":"Optional Ractor-backed parallel execution for   `cdc-core`. It accelerates Change Data Capture (CDC) pipelines while preserving the simplicity and composability of the CDC Ecosystem","archived":false,"fork":false,"pushed_at":"2026-06-02T21:08:51.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-02T23:08:15.120Z","etag":null,"topics":["cdc","cdc-core","cdc-ecosystem","change-data-capture","event-processing","logical-replication","parallel-processing","postgresql","ractor","ruby","ruby4","stream-processing"],"latest_commit_sha":null,"homepage":"https://kanutocd.github.io/cdc-parallel/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kanutocd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-31T11:59:21.000Z","updated_at":"2026-06-02T21:08:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kanutocd/cdc-parallel","commit_stats":null,"previous_names":["kanutocd/cdc-parallel"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kanutocd/cdc-parallel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanutocd%2Fcdc-parallel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanutocd%2Fcdc-parallel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanutocd%2Fcdc-parallel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanutocd%2Fcdc-parallel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanutocd","download_url":"https://codeload.github.com/kanutocd/cdc-parallel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanutocd%2Fcdc-parallel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34704748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdc","cdc-core","cdc-ecosystem","change-data-capture","event-processing","logical-replication","parallel-processing","postgresql","ractor","ruby","ruby4","stream-processing"],"created_at":"2026-06-23T20:00:52.659Z","updated_at":"2026-06-23T20:00:53.927Z","avatar_url":"https://github.com/kanutocd.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cdc-parallel\n\n[![Gem Version](https://badge.fury.io/rb/cdc-parallel.svg)](https://badge.fury.io/rb/cdc-parallel)\n[![CI](https://github.com/kanutocd/cdc-parallel/workflows/CI/badge.svg)](https://github.com/kanutocd/cdc-parallel/actions)\n[![Ruby Version](https://img.shields.io/badge/ruby-%3E%3D%204.0-ruby.svg)](https://www.ruby-lang.org/en/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nOptional high-throughput Ractor runtime for `cdc-core`.\n\n`cdc-parallel` executes `CDC::Core::Processor` objects in Ractors when those processors explicitly declare themselves Ractor-safe.\n\n## Requirements\n\n- Ruby 4.0+\n- `cdc-core`\n- `parallel-pool`\n\nRuby 4.0+ is required because this gem targets the stabilized Ruby Ractor API.\n\n## Purpose\n\n```text\ncdc-core\n   │\n   ▼\ncdc-parallel\n   │\n   ▼\nparallel Parallel-aware processing\n```\n\n`cdc-parallel` is a runtime adapter. It does not define CDC events and does not parse database streams.\n\n## Installation\n\n```ruby\ngem \"cdc-parallel\"\n```\n\n## Usage\n\n```ruby\nrequire \"cdc/core\"\nrequire \"cdc/parallel\"\n\nclass MetricsProcessor \u003c CDC::Core::Processor\n  ractor_safe!\n\n  def process(event)\n    CDC::Core::ProcessorResult.success(\n      table: event.table,\n      operation: event.operation\n    )\n  end\nend\n\nruntime =\n  CDC::Parallel::Runtime.new(\n    processor: MetricsProcessor.new,\n    size: 4\n  )\n\nresult = runtime.process(event)\n\nruntime.shutdown\n```\n\n## Processor Safety\n\nOnly processors that declare `ractor_safe!` can run in this runtime.\n\n```ruby\nclass AnalyticsProcessor \u003c CDC::Core::Processor\n  ractor_safe!\nend\n```\n\nUnsafe processors raise:\n\n```ruby\nCDC::Parallel::UnsafeProcessorError\n```\n\n## Concurrency Contract\n\n`CDC::Parallel::ProcessorPool` accepts submissions from multiple Ruby threads.\nDispatch state is synchronized inside the pool, while processor execution occurs\ninside isolated Ruby 4 Ractors.\n\nWorkers own their `Ractor::Port` inboxes. The pool sends work to those inboxes,\nand workers send results back to a caller-owned reply port.\n\n```text\nCaller Thread A ─┐\nCaller Thread B ─┼─\u003e ProcessorPool\nCaller Thread C ─┘        │\n                          │ synchronized dispatch\n                          ▼\n                +-------------------+\n                | worker selection  |\n                +-------------------+\n                  │       │       │\n                  ▼       ▼       ▼\n            inbox port inbox port inbox port\n                  │       │       │\n                  ▼       ▼       ▼\n            Ractor 1  Ractor 2  Ractor 3\n                  │       │       │\n                  └───┬───┴───┬───┘\n                      ▼       ▼\n             caller-owned   reply port\n                      │\n                      ▼\n             ordered ProcessorResult[]\n```\n\n## What Belongs Here\n\n- Ractor processor execution\n- Transaction envelope processing\n- Processor safety validation\n- Graceful shutdown\n- Result normalization\n\n## What Does Not Belong Here\n\n- PostgreSQL connection handling\n- pgoutput parsing\n- pgoutput decoding\n- Rails integration\n- Audit persistence\n- Kafka/Redis/S3 publishing\n\n## Ecosystem Position\n\n```text\ncdc-parallel\n      │\n      ▼\npgoutput-parser\n      │\n      ▼\npgoutput-decoder\n      │\n      ▼\ncdc-core\n      │\n      ▼\ncdc-parallel\n      │\n      ▼\nwhodunit-chronicles\n```\n\n## Roadmap\n\n- Persistent worker pools using `parallel-pool`\n- Mixed `CompositeProcessor` routing\n- Ratomic-backed queues\n- Ratomic-backed metrics\n- Backpressure policies\n- Transaction ordering strategies\n\n\n## Test Organization\n\nThe test suite is grouped by intent so the same structure can be reused across CDC ecosystem gems.\n\n```text\ntest/unit/          focused class and branch coverage\ntest/integration/   component interaction and runtime integration\ntest/behavior/      ecosystem contracts and guardrails\ntest/performance/   opt-in smoke benchmarks\n```\n\nRun the default quality suite:\n\n```bash\nbundle exec rake test\n```\n\nRun a specific group:\n\n```bash\nbundle exec rake test:unit\nbundle exec rake test:integration\nbundle exec rake test:behavior\nbundle exec rake test:performance\n```\n\nThe default `test` task runs unit, integration, and behavior tests. Performance tests are intentionally separate because they are environment-sensitive.\n\n## License\n\nMIT.\n\n\n## Benchmarking\n\n`cdc-parallel` includes reproducible benchmarks that compare serial processor execution against the pre-warmed Ractor worker pool.\n\nThe benchmark focuses on three workload categories:\n\n| Workload | Purpose                                         |\n| -------- | ----------------------------------------------- |\n| tiny     | Measure dispatch overhead                       |\n| cpu      | Measure CPU-bound processing throughput         |\n| batch    | Measure batched CDC event processing throughput |\n\nSee [benchmark/README.md](benchmark/README.md) for the full benchmark methodology,\nconfiguration reference, report schema, and interpretation guidance.\n\n### Quick Start\n\nTiny workload:\n\n```bash\nBENCHMARK_WORKLOAD=tiny \\\nbundle exec rake benchmark:processor_pool\n```\n\nCPU-bound workload:\n\n```bash\nBENCHMARK_WORKLOAD=cpu \\\nBENCHMARK_CPU_ROUNDS=5000 \\\nbundle exec rake benchmark:processor_pool\n```\n\nBatch workload:\n\n```bash\nBENCHMARK_WORKLOAD=batch \\\nBENCHMARK_BATCH_SIZE=10000 \\\nbundle exec rake benchmark:processor_pool\n```\n\nWorker-count sweep:\n\n```bash\nBENCHMARK_WORKLOAD=cpu \\\nBENCHMARK_WORKER_COUNTS=1,2,4 \\\nbundle exec rake benchmark:processor_pool\n```\n\nCredibility controls:\n\n```bash\nBENCHMARK_TRIALS=7 \\\nBENCHMARK_MIN_DURATION=0.25 \\\nBENCHMARK_ITERATIONS=1000 \\\nbundle exec rake benchmark:processor_pool\n```\n\n### Benchmark Docker Image\n\nBuild and run the reusable Docker image:\n\n```bash\nbundle exec rake benchmark:docker_build\nbundle exec rake benchmark:docker_run\n```\n\nOr run the image directly after it is published to GitHub Container Registry:\n\n```bash\ndocker run --rm ghcr.io/kanutocd/cdc-parallel-benchmark:main\n```\n\nThe benchmark image is intended to become the shared performance validation\npattern across CDC Ecosystem gems, enabling reproducible benchmark execution\nlocally, in CI, and across different development environments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanutocd%2Fcdc-parallel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanutocd%2Fcdc-parallel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanutocd%2Fcdc-parallel/lists"}