What it does
When an operator switches sinks on and supplies the settings for a target, KynetraDB mirrors every entity upsert and delete to it. Thirteen targets are implemented. Mirroring is a background call made after the write is acknowledged, with no retry and no backfill, so a target that is down misses writes.
How it works
Sinks are off unless KYNETRA_ENABLE_SINKS is true. At start-up the server checks each target for its settings and registers the ones whose settings are all present; the rest are skipped without a message. If the switch is on and nothing is configured, a warning says nothing will be mirrored. GET /admin/sinks lists the registered sinks and POST /admin/sinks/ping tests each one. Neither route changes configuration.
Every write path that publishes a realtime event also hands the entity to the sink registry on a detached task: entity writes and deletes, transactions, collection record create, update and delete, and the REST layer. The task calls each sink in turn. A sink error is logged as a warning and dropped. One failing sink does not stop the others and does not fail the write.
The targets are a PostgREST-style endpoint, Supabase, the MongoDB Atlas Data API, Amazon DynamoDB, Google BigQuery, Google Firestore, Cloudflare D1, Workers KV, R2 and Vectorize, Upstash Redis, Pinecone, and PlanetScale or another MySQL-compatible table. Most store a row or document with the fields id, kind, attrs, embedding, created_at and updated_at. The BigQuery sink streams rows with a deleted flag and never removes them. The Pinecone and Vectorize sinks mirror entities that have an embedding and skip the rest. The R2 sink writes one JSON object per entity under its kind, and the Redis sink writes the entity JSON as the value.
Each target is configured by environment variables, for example KYNETRA_SUPABASE_URL, KYNETRA_SUPABASE_SERVICE_KEY and KYNETRA_SUPABASE_TABLE. The BigQuery and Firestore sinks take a prepared access token in KYNETRA_GCP_TOKEN and do not refresh it. The DynamoDB and R2 sinks sign their requests with AWS Signature Version 4, implemented in the sink crate.
Where you reach it
- Config
KYNETRA_ENABLE_SINKS=true (switches mirroring on) - Config
Per-target KYNETRA_* settings, for example KYNETRA_SUPABASE_URL, KYNETRA_SUPABASE_SERVICE_KEY, KYNETRA_SUPABASE_TABLE - HTTP
GET /admin/sinks - HTTP
POST /admin/sinks/ping
Limits
- Fire-and-forget. There is no queue, retry or backlog. A write that cannot be mirrored is lost to that target, and a restart drops anything in flight. This edition has no backfill for data that existed before a sink was added.
- A failed mirror shows up as a warning in the server log (sink upsert failed or sink delete failed). The metrics output declares per-sink counters, but nothing in the server updates them in this edition, so do not alert on them.
- Each write is mirrored on its own background task, so two quick writes to one record can arrive at a target in either order.
- Sinks are configured when the server starts and apply to the whole deployment; configure them as an operator.
- Five targets have request-shape tests against a mock server: the PostgREST-style endpoint, Supabase, the MongoDB Atlas Data API, Upstash Redis and Pinecone. The others, whose endpoints are fixed in code, have a configuration test and no request-shape test.
- The MongoDB sink uses the Atlas Data API. Confirm that your MongoDB deployment still offers it before you rely on this target.
- The BigQuery and Firestore sinks take a prepared access token from the environment and do not refresh it. Replace the token and restart when it expires.
- The Redis sink puts the entity JSON in the request path, which makes large entities impractical.
- The flow is one-way. Nothing is read back from a target and conflicts are not detected. The per-target list is on the migration page.
Evidence
- On this siteDocumentation hub: database sinks
- On this siteMigration and sink targets
- TestsCovered in the engine repository by 11 request-shape tests against a mock server for five targets, one test of the Vectorize skip rule, and a configuration test in each of the 13 sink modules
Test coverage is listed as present in the engine repository at this edition. This page does not report test results.
KynetraDB is in private preview
Request a preview to talk through the limits above against your own workload.