Skip to main content

meridian-storage-valkey

meridian-storage-valkey is Meridian V1's Valkey adapter for disposable Cache Catalog data. It provides bounded key-value storage, canonical value envelopes, mandatory TTLs, exact-key and generation invalidation, single-key atomic operations, transparent cache-aside coordination, health verification, and standalone or Sentinel failover profiles.

Valkey is never an authority in this adapter. Eviction, restart, corruption, and read unavailability all resolve to a cache miss when an authoritative loader exists. The adapter does not advertise structured, object, evidence, or streaming behavior and cannot be selected as their fallback.

Compatibility

Component API bounds / verified recipe
Python 3.12, 3.13, 3.14
meridian-storage-core >=1.1.0,<2
meridian-storage-semantics >=2.0.1,<3
valkey client >=6.1.1,<7 (verified: 6.1.1)
Valkey server deployment-selected; tested 8.1.9 and 8.1.8
Engine profiles valkey-standalone, valkey-sentinel

The historical validation recipes and predecessor artifact digests are in compatibility.json. Install the published distribution with:

python -m pip install meridian-storage-valkey==1.1.0

Meridian discovers ValkeyAdapterFactory through the meridian_storage.adapters entry-point group. Platform or Vangu composition owns the Binding, endpoint or service reference, credentials, ACLs, topology, memory policy, recovery, and namespace-generation rollout.

Deployment selects exact package and image locks independently. Version tables are historical evidence, never startup allowlists. API bounds describe consumed Core SPI, Semantics Cache APIs and valkey-py client APIs; they do not promise conformance for every admitted release. Startup evidence records observed and selected releases separately and remains unverified-by-probe: real-engine tests establish the exact verified combinations. See the exhaustive gate inventory.

Advertised contract

The adapter advertises only the released Cache operations at version 1.0.0:

Operation contract Behavior
meridian.cache.get Validated hit, miss, or unavailable-as-miss
meridian.cache.put TTL-bounded disposable write
meridian.cache.put_if_absent Single-key atomic insert
meridian.cache.compare_and_set Envelope-version or source-version CAS
meridian.cache.delete Exact-key deletion
meridian.cache.invalidate One key or a bounded explicit key list

Bounded multi-get, single-flight get_or_load, numeric increment, leases, and Lua scripts are private adapter coordination primitives. They are not invented Meridian Catalog operations. Namespace-wide invalidation is a deployment change: increment namespaceGeneration in IaC and roll the Binding; no key scan is performed.

Binding settings

Settings are closed and fail on unknown fields. This test-only example omits real secret values, which must be resolved by the Meridian composition root:

{
  "namespaceGeneration": 1,
  "resources": {
    "cache:example.items": {
      "schemaFingerprint": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
      "serializerId": "canonical-json",
      "defaultTtlMs": 60000,
      "maximumStalenessMs": 60000,
      "negativeCaching": true,
      "authoritative": false
    }
  },
  "limits": {
    "maxKeyBytes": 512,
    "maxValueBytes": 4194304,
    "maxBatchSize": 128
  },
  "ttl": {
    "defaultTtlMs": 60000,
    "minimumTtlMs": 10,
    "maximumTtlMs": 86400000,
    "negativeTtlMs": 5000
  },
  "singleFlight": {"leaseMs": 5000, "waitMs": 250, "pollMs": 10},
  "memory": {
    "requireMaxmemory": true,
    "allowedEvictionPolicies": ["allkeys-lru"],
    "requirePersistenceDisabled": true
  },
  "topology": {"mode": "standalone", "minimumReplicas": 0},
  "database": 0,
  "seedEndpoints": [],
  "allowInsecureTestProfile": true
}

Production Bindings use valkeys:// with verified server TLS. Plaintext is accepted only when allowInsecureTestProfile is explicitly true. Sentinel Bindings use a service reference or seed endpoints plus a topology setting such as {"mode":"sentinel","minimumReplicas":2,"sentinelMaster":"meridian-cache"}.

Safety and consistency

  • Physical keys contain digests, not logical keys, tenant values, or Resource names. Tenant and scope still participate in the digest.
  • Values carry serializer, schema, source version, creation and expiry times, payload length and digest, and an envelope version. Non-canonical, stale, schema-mismatched, or corrupt entries are deleted best-effort and treated as misses.
  • A raw-bytes Resource carries bytes through serialized Operations as a canonical unpadded base64url JSON string. Results include valueEncoding: "base64url"; internal cache-aside composition may pass bytes directly.
  • TTL is mandatory and bounded by deployment policy and maximum staleness.
  • Adapter-owned scripts have stable SHA-1 identifiers and reload only after NOSCRIPT; consumer scripts and unbounded scans are rejected by design.
  • Multi-key atomic helpers require a shared Valkey hash slot. Public invalidation is a bounded sequence of independent exact-key deletes.
  • Startup verifies authentication, required commands, selected engine release drift, maxmemory, eviction, persistence policy, primary role, replica count, and script permission.
  • Telemetry contains event names, counters, and hashed Resource identifiers; it never emits keys, values, endpoints, usernames, or credentials.

See docs/architecture.md for the design boundary, docs/operations.md for deployment and recovery, and docs/conformance.md for deterministic evidence.

Development

python -m venv .venv
.venv/bin/pip install -e '.[test]'
./scripts/verify.sh
./scripts/test-integration.sh
./scripts/test-failover.sh

The integration scripts use disposable Valkey 8.1.9 or 8.1.8 containers. They never provision production infrastructure. See CONTRIBUTING.md and SECURITY.md before submitting a change.

License

Copyright 2026 Meridian contributors. Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.

Metadata

Release files for meridian-storage-valkey 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meridian-storage-valkey 1.1.0
File Size Uploaded
meridian_storage_valkey-1.1.0.tar.gz 111.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for meridian-storage-valkey 1.1.0
File Interpreter ABI Platform
meridian_storage_valkey-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 157.8 kB

Release files / meridian_storage_valkey-1.1.0.tar.gz

Download URL meridian_storage_valkey-1.1.0.tar.gz
Size 111.2 kB
Tags Source
SHA-256 checksum
How to use checksums
97478d19b8bcfd2dc16481d108134ddf27fe4d580bd6bfef957a05869192a0c8
BLAKE2b-256 checksum
How to use checksums
999cecdce155e8c9311754ad28a417457b1d272b37af10bcda5541f7c9378ddf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / meridian_storage_valkey-1.1.0-py3-none-any.whl

Download URL meridian_storage_valkey-1.1.0-py3-none-any.whl
Size 46.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45e478447a8f50abd4bac7024ae73e6df94ae504f69f8fb06a3f03609a0370d4
BLAKE2b-256 checksum
How to use checksums
04363b18d4a3a354c83a5d24c647a534ab989863e090940edd96203373696c1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release 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