IDC

Community

Databases that push messages to each other, with no polling: a transactional outbox, signed delivery that retries until it lands, and exactly-once apply on the other side. Rust and C# speak it too.

    npm i @pogly/spacetimedb-idc

    Inter-database communication for SpacetimeDB, until native IDC ships. Your database sends a message from any reducer, and it's pushed to the other database right after your transaction commits. The receiver applies it in a transaction of its own and can reply the same way, so both sides are event-driven with no polling.

    Delivery is reliable: no message without its commit and no commit without its message. Retries back off from 500 ms to 60 s, each peer's messages stay in order, and every message is applied exactly once. It also includes signed RPC and SQL calls to peers, and handoffs that move an entity (say, a character) to another database without ever duplicating or losing it.

    • Any setup with more than one database that need to react to each other: a shop and a warehouse, game world shards passing players between them, a central account database feeding per-region game databases, or splitting a large module into services.
    • It replaces calling another database's HTTP API from a procedure, with a hand-maintained table of tokens on one side, a table of known callers on the other, and polling for changes.

    Mount it with schema({ ..., idc }), pass the config from environment variables (IDC_SELF, IDC_SECRET, IDC_PEERS, IDC_TRANSPORT) into idc.configure in init, and add the inbox and pairing HTTP routes.

    idc.send(ctx.as.idc, 'warehouse', 'reserve', {...}) writes the message to an outbox table in the same transaction as your change, and a scheduled procedure POSTs it, HMAC-signed, right after the commit. On the other side, your onMessage callback runs inside the transaction that also records the message id, so a retried delivery is never applied twice.

    It waits until commits are durable before sending and before forgetting, and a crash test checks this in CI. TypeScript, Rust and C# versions speak the same protocol, so the databases can be written in different languages.

    Related submodules

    Webhooks

    Verified inbound webhooks (GitHub, Twitch EventSub, Stripe, Discord, Standard Webhooks) handled exactly once, and signed outbound webhooks from a transactional outbox with retries.

    Lethalchip0/wkCommunity

    Authz

    Roles, scopes and grants for multi-user modules: wildcard permissions, role inheritance, scope trees, expiring grants, invite links, an audit log and row-level security, with no privilege escalation.

    Lethalchip0/wkCommunity

    Cron

    Schedules recurring tasks in a SpacetimeDB module using calendar expressions or fixed intervals. Supports time zones, per-job arguments, failure limits, and runtime schedule changes.

    SpacetimeDB0/wk
    Submodule

    Edit details

    One short paragraph describing the submodule.

    A few bullets for scenarios where this is a good fit.

    A few short paragraphs at the conceptual level.