Validation
The schema and contract check every event passes through immediately after collection, before it can affect any downstream system.
High-Level Design
Validation is the quality gate between collection and everything else.
💼 Business Context
- Bad data caught at the door is cheap; bad data caught in a dashboard three hops downstream is expensive and erodes trust in the platform
- Protects every team's reports and models from a single misbehaving integration
- Owned by Platform Engineering, with schema ownership shared with each domain team via the Event Schema & Registry
🔌 Technical Overview
Validation checks every event against the JSON Schema published alongside the Cxos.Ingestion.Client contract: required fields, type correctness, and enum constraints (e.g., a known channel value). Events that fail validation are not silently dropped — they're routed to a dead-letter Event Hubs topic with the validation error attached, so the sending team can see exactly what failed and why.
Checks Performed
💾 Validation Failure Record
{
"event_id": "9f2c1e6a-...",
"status": "validation_failed",
"errors": [
{ "field": "properties.price", "issue": "expected number, got string" }
],
"raw_payload_ref": "deadletter/2026-08-01/9f2c1e6a.json"
}
🔗 Integration Points
- JSON Schema derived from the Cxos.Ingestion.Client contract (single source of truth)
- Dead-letter Azure Event Hubs topic — quarantines failed events with error context
- Event Schema & Registry — schema versioning and compatibility rules
- Azure Monitor alert — notifies the owning team when their integration's failure rate spikes
🧰 Services Consumed
- Owning microservice —
Cxos.Ingestion.Application(see the Full Application Service Map) - Database — Azure Cache for Redis (cache only, no system-of-record database)
⚠️ Non-Functional Considerations
- Scale: validation is a stateless, in-memory check — negligible latency overhead per event
- Latency: adds low-single-digit milliseconds to the collection-to-acknowledgment path
- Reliability: a schema registry outage fails open to the last-known-good schema version rather than blocking all ingestion
- Security/Privacy: validation also enforces that no unexpected fields smuggle unclassified data past the contract boundary
🎯 Enterprise Example
A newly deployed version of the Mobile SDK accidentally sends price as a string instead of a number. Validation catches every affected event at the door, routes them to the dead-letter topic, and fires an alert to Mobile Engineering within minutes — instead of corrupting weeks of revenue reporting before anyone notices.