In this lesson, you will learn how to quantify the reliability of your data pipelines by applying the six foundational dimensions of data quality.
As data engineers, building robust pipelines—even those with exactly-once semantics or optimized checkpointing—is useless if the data itself is untrustworthy. We evaluate data quality through these six pillars:
- Accuracy: Does the data reflect the real-world entity? For instance, does a
sensor_readingaccurately represent the actual physical temperature? - Completeness: Is the required data present? A dataset missing 30% of its
user_idfields fails the completeness test, as it creates gaps in downstream aggregations. - Consistency: Does the data agree across different systems? If your streaming sink reflects a balance of 110 for the same account, your system lacks consistency.
- Timeliness: Is the data available when needed? In real-time streaming, if your
event_timeis delayed beyond your defined SLAs, the data loses its utility. - Validity: Does the data follow defined formats and business rules? For example, a
transaction_amountmust be a positive float, not a negative string. - Uniqueness: Are there redundant records? Duplicate events caused by retries in your distributed sinks can skew metrics like
unique_page_views.
Practical Evaluation
To establish a baseline, you should implement validation logic within your processing layer or as a gatekeeper before your analytical store:
-- Example of a basic quality check in a SQL-based transformation
SELECT
COUNT(*) AS total_records,
SUM(CASE WHEN user_id IS NULL THEN 1 ELSE 0 END) AS missing_users,
SUM(CASE WHEN transaction_amount < 0 THEN 1 ELSE 0 END) AS invalid_amounts
FROM streaming_sink_table;
By monitoring these metrics, you shift from reactive debugging to proactive data governance. When a pipeline produces invalid data, these dimensions help you pinpoint whether the issue lies in upstream ingestion, transformation logic, or sink connectivity.
Key Takeaway: Data quality is not a binary state but a measurable spectrum; by monitoring accuracy, completeness, consistency, timeliness, validity, and uniqueness, you transform raw streams into reliable business assets.