feat: multi-cell support — trigger once, run in every cell - #28
Draft
rogercampos wants to merge 1 commit into
Draft
feat: multi-cell support — trigger once, run in every cell#28rogercampos wants to merge 1 commit into
rogercampos wants to merge 1 commit into
Conversation
DataDrip can now coordinate the same backfill or script across several
independent deployments ("cells"). The cell whose UI created the run is
the coordinator: it saves its own local run, records one CellDispatch
per target cell, and a background job delivers each one to that cell's
new machine-to-machine Cell API, where an independent copy of the run
is created and executes on that cell's own queue against its own data.
Everything is opt-in: with DataDrip.current_cell_id / cell_transport
unset (the defaults), behavior is exactly as before. The new columns
are nullable and the Cell API rejects all requests until tokens are
configured, so hosts can upgrade and migrate with zero change.
- Config: current_cell_id, cell_ids, cell_transport, cell_api_tokens,
cell_ui_url (values or callables), plus a built-in HTTPS transport
(DataDrip::CellTransport::Http) and client (DataDrip::CellClient).
- Cell API: separate engine (DataDrip::CellApi::Engine) so hosts can
mount it outside their staff/admin gate; bearer-token auth with
constant-time compare, target-cell echo check (421 on misrouting),
idempotent creation per (group_uuid, cell_id) backed by a unique
index, group status snapshots, and stop / retry / delete endpoints
that re-apply the owner-only and history-preservation rules.
- Dispatch: GroupCreator freezes the payload per dispatch;
CellDispatcherJob marks failures visibly (422 waits for a human via
"Retry dispatch"; 5xx and network errors also raise so the queue
retries).
- UI: "Where to run" targeting on the new-run forms, origin/cell badges
in the lists, per-cell cards on the show pages with live status,
progress, errors and script output fetched from each cell on every
poll (unreachable cells render as such and never block), fan-out of
stop/delete, and per-cell retry of failed batches.
- Identity: runs snapshot backfiller_name (now also on script runs);
remote cells store the coordinator's backfiller_id verbatim without
requiring a local record (ids are assumed globally unique).
- Schema: group_uuid/cell_id/origin/origin_cell_id on both run tables,
data_drip_cell_dispatches, a data_drip:add_multi_cell upgrade
generator, and updated install templates.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
rogercampos
force-pushed
the
multi-cell-support
branch
from
July 31, 2026 14:41
3452776 to
7c46dd4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
DataDrip can now coordinate the same backfill or script across several independent deployments ("cells"): a developer triggers it once, from any cell's UI, and DataDrip creates and executes an independent copy of the run in every cell — with the UI honestly reflecting that results differ per cell.
Fully opt-in and backwards compatible: with
DataDrip.current_cell_id/cell_transportunset (the defaults), behavior is exactly as today. New columns are nullable, the new table starts empty, and the Cell API rejects everything until tokens are configured — hosts can bump the gem and run the migrations with zero behavior change, then enable multi-cell purely via configuration.How it works
group_uuid; creation is idempotent per(group_uuid, cell_id)(unique index + find-or-return), so dispatch retries and duplicate deliveries are safe.Changes
Config & transport (
lib/)DataDrip.current_cell_id,cell_ids,cell_transport,cell_api_tokens,cell_ui_url— plain values or callables;DataDrip.multi_cell?gates every new code path.DataDrip::CellTransport::Http— dependency-free HTTPS/JSON transport (configurableurl/query/headers, network errors wrapped so callers can tell "cell said no" from "cell unreachable"); any object with the samecallcontract can replace it.DataDrip::CellClient— thin wrapper that knows the Cell API paths and always sends the intendedtarget_cell_id.Cell API (new second engine:
DataDrip::CellApi::Engine)421 Misdirected Requestif the routing layer delivered to the wrong cell.POST /v1/backfill_runs&/v1/script_runs(idempotent create),GET /v1/groups/:group_uuid(status snapshot; script snapshots carry the full log output — the coordinator never stores it), stop / retry_failed_batches / delete re-applying the existing owner-only and history-preservation rules.Dispatch
GroupCreatorsaves the local run, freezes one payload perCellDispatch, and enqueues oneCellDispatcherJobper cell.UI
N cellsbadge on coordinator runs,from <cell>badge on dispatched runs.Identity
backfiller_namesnapshot now also on script runs; remote cells store the coordinator'sbackfiller_idverbatim (ids assumed globally unique) without requiring a local record —belongs_tois nowoptionalwith a local-existence validation for local-origin runs only.Schema & generators
group_uuid/cell_id/origin/origin_cell_idon both run tables (+ unique(group_uuid, cell_id)), newdata_drip_cell_dispatchestable.rails generate data_drip:add_multi_cellfor existing installs; install templates updated for fresh ones.Testing
🤖 Generated with Claude Code