Core Concepts
Tiers
| Tier | Runtime Component | Purpose |
|---|---|---|
| Hot | Storage Engine | Primary write path, low-latency reads, canonical MQL behavior |
| Cold | Query Engine | Cost-efficient historical/data-lake-style reads |
| Federated | Coordinator | Merges hot and cold results for a single query response |
Query Routing Modes
Thermocline supports per-collection policy-driven routing through the coordinator:
hotOnlycoldArchivalsizeBasedArchival
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-architecturemake 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.rsservices/coordinator/internal/server/server.goservices/storage-engine/src/filter/evaluator.rsservices/query-engine/src/executor/execution.rs