Athena

Athena CDC Crate

What belongs in crates/athena-cdc and what still stays in athena_rs or the later athena-wss slice.

crates/athena-cdc is the reusable change-data-capture seam for Athena. The first slice focuses on the portable Postgres/Sequin replay engine and leaves websocket transport, connection handling, and /wss HTTP surfaces for the later athena-wss extraction.

What Lives Here Today

  • Sequin event parsing and normalization.
  • CDC state persistence and table-config loading.
  • SQL generation helpers for replaying INSERT, UPDATE, and DELETE mutations.
  • Portable executor and audit-sink traits for replay backends.
  • Canonical CDC audit payload building.

What Still Stays In athena_rs

  • AthenaClient adapters that implement the portable CDC traits.
  • CLI wiring for --cdc-only, CSV backfill, and stream commands.
  • Websocket broadcast, connection, and route/server code under src/cdc/websocket.
  • /wss/* route registration and WSS OpenAPI hosting.

Current Extraction Rule

Use athena-cdc when code is about replaying captured changes, tracking CDC state, or building backend-agnostic CDC payloads.

Keep code in athena_rs when it needs:

  • AthenaClient
  • CLI/runtime bootstrap wiring
  • websocket transport or /wss endpoints
  • Actix or Axum server startup

Near-Term Direction

The next realtime slices should keep following this split:

  1. Keep portable CDC core in athena-cdc.
  2. Move websocket transport and server concerns into athena-wss.
  3. Leave backend-specific driver execution for the later athena-driver split.