Skip to content

Pipeline lifecycle: development and production modes, and the deployment step - #314

Draft
dimitri-yatsenko wants to merge 4 commits into
mainfrom
docs/development-and-production
Draft

dimitri-yatsenko wants to merge 4 commits into
mainfrom
docs/development-and-production

Conversation

@dimitri-yatsenko

@dimitri-yatsenko dimitri-yatsenko commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Defines development and production as two ways of operating a DataJoint pipeline, derived from first principles, and specifies the lifecycle that connects them. DataJoint is designed to uphold the two modes; enforcement comes from database privileges, not from a DataJoint setting. The recommendations are a standard that individual deployments can vary.

The rule: in development, the definition and the data may change together, from any process. In production, the definition (tables, make() methods, Lookup contents) changes only in a deployment step, and run time changes only data.

What changed

  • reference/specs/deploy-operations.md is now "Pipeline Lifecycle and Deployment". New sections come before the existing datajoint.deploy API:

    • terms: definition, data, target, pipeline, run time, deployment step;
    • the rule, and the two modes compared;
    • the lifecycle, drawn as an SVG figure: development, the move to production, changing a production pipeline, production as one-way under this standard;
    • ten recommendations for production: privileges, only workers populate (from a clean checkout of the deployed commit, so recorded versions are accurate), declaring hidden tables ahead of time, create_tables, Lookup tables for definition only, changed make(), preview then delete, additive vs revising changes, checking make() before deploying, recording where rows come from;
    • the deployment step;
    • what DataJoint does at run time, and how a deployment step prepares for each behavior.

    The datajoint.deploy API keeps its content, under its own heading. "Deploy hooks" and "staging environment" now read "deployment step" and "development target".

  • Additive and revising changes (new section of the spec). An additive change extends the pipeline and leaves what exists as it was. A revising change removes, renames, narrows or constrains what running code reads or writes, or changes what existing rows mean. The section gives examples of each and how each kind is managed: in development both are applied as written; in production additive changes deploy without pausing work, and revising changes are reviewed and deployed with the dependent work paused, together with a data migration.

  • How the modes differ (new section of the spec):

    • intrinsic provenance, the structural lineage, with job metadata recording the code version;
    • extrinsic provenance (_prov), turned on by every process that enters data;
    • the make() reproducibility contract, with a table of where it is enforced: by DataJoint at run time (populate-only for master tables, the all-or-nothing write, reads through self.upstream, the tripartite make_fetch re-check), at review and in the deployment step (the only place every rule is checked), and in production by privileges and workers: only worker logins insert computed rows;
    • Lookup seeding.
  • reference/specs/autopopulate.md: its statements that the contract isn't enforced at run time now name the parts that are, and link to that table.

  • explanation/development-and-production.md (new) gives the reasoning: why definition and data are kept apart, and how DataJoint upholds the modes.

  • how-to/deploy-production.md says create_tables=False is part of production, not the whole of it, and links to the spec. "Enable Production Mode" becomes "Turn Off Automatic Table Creation". It also corrects when tables are declared: when the class is decorated, usually at import.

  • Inbound link text and nav updated: the CDC explanation, the how-to index, manage-pipeline-project and semantic-matching.

The statements about library behavior were checked against datajoint-python master and next:

  • when tables, jobs tables and ~lineage are declared;
  • how Lookup contents are inserted;
  • safemode and prompt;
  • AccessError, and the paths where a refusal stays silent.

Follow-ups (not in this PR)

  • how-to/manage-pipeline-project.md: the dev_ schema "promotion" diagram and the role table, which has no deployment login, should follow the lifecycle here.
  • how-to/delete-data.md: a production note, preview first, linking recommendation 6.
  • how-to/alter-tables.md: link the additive vs revising classification and the deployment step.
  • datajoint.deploy.add_prov_column (since 2.3.6) is not yet documented in the spec.
  • A single setting to disable all schema changes (DDL) at run time, Lookup contents included datajoint-python#1649 (2.4) makes refused schema changes and Lookup writes report clearly; the run-time table can be updated when it ships.

Draft for discussion of the framing before the follow-ups.

Define development and production as modes of a target, from first
principles: the definition (tables, make(), Lookup contents) changes
only in a deployment step in production, and run time changes only
data. The deploy-operations spec now specifies the lifecycle, the
recommendations for production, the deployment step and what DataJoint
does at run time, ahead of the datajoint.deploy API. A new explanation
page gives the reasoning. The production how-to and inbound links are
aligned: create_tables=False is part of production, not the whole.
…d Lookup seeding across modes

Introduce the two kinds of change to a production pipeline, additive and
revising, with examples and how each is managed in each mode. Specify how
intrinsic and extrinsic provenance, the make() reproducibility contract
and Lookup seeding differ between development and production, and where
the make() contract is enforced: by DataJoint at run time (populate-only
for master tables, the all-or-nothing write, reads through self.upstream,
the tripartite make_fetch re-check), at review and deployment, and
optionally by privileges. Align the autopopulate spec's statements on
enforcement.
populate() and make() run only in workers, from a clean checkout of the
committed code at the deployed version, so the git version recorded with
each computed row is the code that computed it. Worker logins alone may
insert into auto-populated tables and their parts; user logins read,
enter Manual data, and delete (previewed), which cascades through
auto-populated tables.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant