GrabYuanzhe LiuProblem & solution
Real-time data quality monitoring: Kafka stream contracts with syntactic and semantic test
Summary
Kafka stream data can fail syntactically when actual records do not match expected schemas, or semantically when fields violate agreed patterns, ranges, or constants. The described platform addresses this gap with user-defined data contracts covering schema agreements, field-level semantic rules, stream configuration, and ownership metadata. An LLM recommends semantic rules from schemas and anonymized samples, while a transformation engine converts them into Test Runner configurations and inverse SQL queries. A long-running FlinkSQL Test Runner reads Kafka with its own consumer group, publishes issue events and stores them in AWS S3; Genchi sends Slack alerts and Coban shows violating fields and sample records. Deployed across 100+ critical topics, the solution provides real-time detection, alerting, and visibility, with future work targeting producer tracing, cross-field tests, completeness, freshness, and DTO change detection.
Context
Kafka stream monitoring lacked effective validation for syntactic and semantic data quality issues, timely alerts, and visibility into the specific records and fields causing downstream problems.
Approach / What changed
The platform uses data contracts, LLM-based semantic-rule recommendations, a transformation engine, and a long-running FlinkSQL Test Runner. It detects violations in real time, publishes enriched issue events to Kafka, stores them in AWS S3, and provides Slack alerting and Coban UI observability through Genchi.
Takeaways
Data contracts combine Kafka schemas with field-level semantic rules such as string patterns, number ranges, and constant values, plus stream ownership and alerting metadata.
FlinkSQL consumes the monitored topic with a separate consumer group and uses inverse SQL queries to capture syntactically incorrect or semantically invalid records without affecting other consumers.
The deployed solution monitors 100+ critical Kafka topics and shows sample bad records and violating fields; planned extensions include producer tracing, cross-field validation, completeness, freshness, and DTO change detection.
Source and freshness
- Source
- engineering.grab.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.