Skip to main content

Core Concepts

Tiers

TierRuntime ComponentPurpose
HotStorage EnginePrimary write path, low-latency reads, canonical MQL behavior
ColdQuery EngineCost-efficient historical/data-lake-style reads
FederatedCoordinatorMerges hot and cold results for a single query response

Query Routing Modes

Thermocline supports per-collection policy-driven routing through the coordinator:

  • hotOnly
  • coldArchival
  • sizeBasedArchival

Policy commands are exposed through gateway-admin command handlers (thermoclineSetPolicy, thermoclineGetPolicy, thermoclineListPolicies, thermoclineDeletePolicy, thermoclineValidatePolicy).

Separation of Responsibilities

  • Gateway: protocol and command routing, not query semantics.
  • Coordinator: orchestration and merge semantics, not storage persistence.
  • Storage Engine: canonical MQL operator semantics and hot-tier persistence.
  • Query Engine: cold-tier scanning and operator execution for supported subsets.

This separation is enforced by architecture tests and guardrails:

  • make test-architecture
  • make check-guardrails

MongoDB Compatibility Model

Thermocline aims for MongoDB wire and MQL compatibility with explicit tier-level truth:

  • Fully supported operators/stages
  • Partial operators/stages with noted caveats
  • Routed behavior where cold paths delegate semantics through hot

See Compatibility for the matrix.

Source of Truth

  • services/gateway/src/proxy/handler/policy.rs
  • services/coordinator/internal/server/server.go
  • services/storage-engine/src/filter/evaluator.rs
  • services/query-engine/src/executor/execution.rs