Skip to main content

Meridian Storage Projection

meridian-storage-projection is the Apache-2.0 Meridian V1 lifecycle library for transactional outbox processing, derived projections, cache policy and normal-read reuse, explicit Schema migration, logical export/import, and projection rebuild.

It is a library, not a Projection Catalog. Meridian still has exactly five Catalogs: structured, object, cache, evidence, and streaming. This package registers none of them. The released cache Catalog retains its exact public surface and this package supplies policy and coordination helpers around it.

Install

python -m pip install meridian-storage-projection==1.0.1

Python 3.12 through 3.14 is supported. Runtime dependencies are pinned to the released Meridian Core, Semantics, and Query 1.0.0 contracts.

Projection

from meridian_storage.projection import ProjectionRunner, ProjectionSpec

spec = ProjectionSpec(
    name="case-search-v1",
    source_catalog="structured",
    source="investigation.cases",
    target_catalog="structured",
    target="investigation.case_search",
    source_schema="investigation.case@3",
    target_schema="investigation.case_search@1",
)

runner = ProjectionRunner(
    meridian=meridian,
    spec=spec,
    project=project_case_for_search,
    outbox=outbox_adapter,
    batch_size=100,
    lease_seconds=60,
)

# The host process owns scheduling and shutdown.
runner.run_once()

The runner advances a checkpoint only after the derived target acknowledges the exact source version. Crashed workers reclaim expired leases, duplicate delivery requires idempotent target writes, and poison records enter quarantine until an explicit operator retry.

Construct the runner after meridian.start(). Both Resources must have the exact Schemas in the spec and resolved Bindings satisfying their declared Capability requirements. Construction performs no target writes or projector calls.

Adapter authors can run the wheel's shared lifecycle fixtures via meridian_storage.projection.testing; see conformance. The owner-only port does not fence an older attempt after the same owner is reused. Hosts must prevent overlapping owner reuse.

Transparent read cache

from datetime import timedelta

from meridian_storage.projection import (
    CacheCoordinator,
    CachePolicy,
    LoadedValue,
    MeridianCacheBackend,
)

policy = CachePolicy(
    source_resource="investigation.cases",
    cache_resource="investigation.case_cache",
    key_fields=("case_id",),
    serializer_id="canonical-json-v1",
    schema_fingerprint="sha256:" + schema_fingerprint_hex,
    default_ttl=timedelta(seconds=30),
    maximum_ttl=timedelta(minutes=5),
    maximum_staleness=timedelta(seconds=30),
)
cache = CacheCoordinator(policy=policy, backend=MeridianCacheBackend(meridian))

result = cache.read(
    {"case_id": case_id},
    lambda: LoadedValue(load_authoritative_case(), source_version=record_version),
    required_source_version=record_version,
)

Every stored value carries a versioned cache envelope with its logical key, serializer, Schema fingerprint, creation/expiry timestamps, and source version. Positive and negative values use distinct tagged payloads, so user Data cannot collide with the negative-cache marker. Cache outage, corruption, and invalidation failure never change authoritative correctness. Explicit CAS/unavailable operations fail retryably; normal reads may fall back according to policy.

Migration and portability

MigrationPlanner classifies released SchemaDocument values and verifies an explicit logical MigrationBundleV1. Preconditions, validations, and postconditions carry complete serialized Meridian V1 Operations, never Adapter or Engine concepts. MigrationExecutor runs only when called by a deployment job, against injected Adapter compilation/lock/apply/activation hooks. Runtime startup remains read-only.

LogicalExportCoordinator and LogicalImportCoordinator stream bounded, canonical NDJSON partitions with counts, byte sizes, logical-id bounds, and SHA-256 verification. Import verifies every immutable artifact before target preflight or writes, then detects any artifact change between verification and consumption. Cache state is excluded. PortableRecoveryCoordinator only correlates logical evidence with an IaC-owned backup/restore validation; it performs no Engine lifecycle action.

V1 boundaries

  • No service, scheduler, broker, worker deployment, or Engine client is started.
  • No physical table, index, topic, bucket, endpoint, or credential is public.
  • Streaming replay/group positions remain versioned Streaming Operations.
  • Online dual-write, CDC catch-up, zero-downtime cross-engine cutover, snapshot-stable pagination, and high-volume specialization are forward-looking.
  • Platform/Vangu IaC owns provisioning, identity, ACL, migration jobs, backup, restore, recovery, topology, scaling, and worker lifecycle.

Normative JSON Schemas are in contracts/data-lifecycle/. Unit, integration, contract, crash-boundary, and packaging tests are included in the source distribution.

Verification

Run the same release gate used by CI:

python scripts/verify.py

It runs formatting, lint, strict typing, unit/integration/contract/crash and packaging tests, branch coverage, dependency consistency, reproducible builds, wheel installation, and Twine metadata validation. Deterministic hashes and results are written to build/evidence/verification.json. See docs/CONFORMANCE.md for acceptance traceability.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meridian_storage_projection-1.0.1.tar.gz (72.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meridian_storage_projection-1.0.1-py3-none-any.whl (72.4 kB view details)

Uploaded Python 3

File details

Details for the file meridian_storage_projection-1.0.1.tar.gz.

File metadata

File hashes

Hashes for meridian_storage_projection-1.0.1.tar.gz
Algorithm Hash digest
SHA256 39b278af0fb7a79186da3f3f9a2e68a758fdc5497c2e5cf194c0d9dd47e5f97b
MD5 215f9e47c91ade5ff56486ebfad39041
BLAKE2b-256 191a4b8776b55be4e506fd1e0c7703d764df68d9cf12cf029d2d05931e151cc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for meridian_storage_projection-1.0.1.tar.gz:

Publisher: release.yml on zephytiju/MeridianDataLifecycle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meridian_storage_projection-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for meridian_storage_projection-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dee2b291f537a415c3139589ba57f8c2bb7063b78a701c1257ad611c8381444f
MD5 4b87031bad4f2db8c7ad9743fabd8184
BLAKE2b-256 b0af73026b81fa8659e156e5d725779473bb09e91dd2887fac4d20e85e3d07fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for meridian_storage_projection-1.0.1-py3-none-any.whl:

Publisher: release.yml on zephytiju/MeridianDataLifecycle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.0.3

2 files

1.0.2

2 files

This release

1.0.1 This release

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page