Customer Playbook for Unreliable and Slow Data Pipelines
System DesignModel answerLast updated
Outline how you would advise a customer whose cloud data platform produces untrustworthy data and runs slowly or expensively: scoping, metrics, diagnosis, fixes, and architecture concepts.
Scenario
You are advising a customer as a data solutions architect. They run their analytics on a managed cloud data platform (for example a Spark-based lakehouse on any major cloud). Their team tells you:
- Reports contain wrong, missing, or duplicated records, and different teams define the same metric differently.
- Batch pipelines and queries are slow, and the compute bill keeps climbing.
Their question: "Our data is unreliable and everything is slow. Where do we start?"
What to cover
- Discovery and scoping. Which questions would you ask to understand the problem, the constraints, and the people involved?
- Success measures. Which metrics define success for (a) data quality and (b) performance and cost? Name primary metrics and guardrails.
- Diagnosis. Give a step-by-step method for finding root causes across sources, pipeline stages, storage, compute, and governance.
- Remediation. Propose concrete technical and process changes for data quality (validation, monitoring, ownership, SLAs) and for performance (storage layout, compute configuration, pipeline design).
- Concept check. Compare a data lake with a data warehouse, and explain where a lakehouse fits.
- Cloud considerations. Which cloud topics usually matter in this kind of engagement (identity and access, networking, storage, encryption, cost)?
Deliverable
A structured plan you could present to the customer, with short-term mitigations and longer-term architecture and process recommendations. Where helpful, ground your points in a past situation of your own and separate what you did from what the team did.
Hints
Hint 1
Start with questions and baselines before proposing tools: you cannot show improvement without measuring the current state first.
Hint 2
Split the problem in two: trace a few specific bad records or slow jobs end to end, rather than tuning everything at once. Many quality bugs are caused by duplicates from retries, late data, or join keys; many performance problems come from small files, skew, and full scans.
Hint 3
Separate quick wins (days) from structural fixes (months), and name an owner and a measurable target for each item.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. Discovery and scoping
Before proposing anything, I would clarify:
- Impact: Which datasets, dashboards, or models are affected? Who notices, and what decisions or revenue depend on them?
- Symptoms: Examples of bad records (wrong values, nulls, duplicates, stale data). Since when? Did it start after a change, a migration, or growth in volume?
- Performance: Which jobs or queries are slow, by how much, and against what expectation (SLA)? What is the monthly spend and what is the target?
- Architecture: Sources (databases, event streams, files, SaaS APIs), ingestion method (batch, streaming, CDC), layers (raw, cleaned, curated), formats, orchestrator, and consumers.
- Constraints: Compliance, data residency, budget, team skills, release freedom, and deadlines.
- People: Who owns each source and each table? Who defines the business metrics?
2. Defining success
Data quality (primary):
- Completeness: percent of required fields non-null; row counts against source.
- Uniqueness: duplicate rate on business keys.
- Validity and accuracy: share of records passing rules; reconciliation difference against source of truth.
- Freshness: lag between event time and availability.
- Consistency: one certified definition per key metric.
Performance and cost (primary):
- Pipeline runtime and SLA hit rate (for example p50/p95 duration).
- Query latency p95 for key dashboards.
- Cost per pipeline run or per TB processed, and total monthly compute.
- Utilization: idle cluster time, spill to disk, shuffle volume.
Guardrails: Cost reductions must not cause SLA misses; speed-ups must not lower quality scores; security controls must not be weakened; no change ships without a rollback plan.
3. Diagnosis plan
- Baseline the metrics above for the top 5 to 10 most critical pipelines and tables.
- Trace lineage from a bad report back to its sources. Pick concrete bad records and bisect through the layers to find the first stage where the data goes wrong.
- Check common quality causes: non-idempotent loads or retries creating duplicates; late or out-of-order events; wrong join keys or fan-out joins; schema drift; timezone and type casting errors; conflicting metric logic in different dashboards.
- Profile performance with the engine's job UI and query plans: look for full table scans, data skew (a few tasks far slower than the median), excessive shuffles, many small files, spill, and under- or over-sized clusters.
- Review storage: file sizes, partitioning scheme (too fine-grained or on the wrong column), clustering or data-skipping effectiveness, table maintenance history.
- Review compute: instance types, autoscaling, always-on clusters, using interactive clusters for scheduled jobs, concurrency conflicts.
- Review governance: who can change schemas, whether contracts exist, and whether anyone owns incidents.
Rank findings by impact divided by effort.
4. Remediation
Short term (days to weeks)
- Deduplicate and make loads idempotent (merge/upsert on business keys instead of append).
- Add basic checks at ingestion: non-null keys, uniqueness, row-count reconciliation, accepted value ranges. Quarantine failing records instead of silently dropping them.
- Compact small files, fix the worst partitioning, and apply clustering or data-skipping on the most filtered columns.
- Move scheduled work to job clusters with autoscaling and auto-termination; right-size instances; add cost tags.
- Pre-aggregate or cache the heaviest dashboard queries.
Long term (months)
- Layered architecture (raw, cleaned, curated) with transactional tables so each layer is reproducible and auditable.
- Data contracts with source owners covering schema, semantics, and change notice; schema enforcement with controlled evolution.
- Declarative pipelines with built-in expectations, automated tests in CI, and anomaly monitoring on volume, freshness, and distributions, with alerting routed to the owning team.
- Single semantic layer or governed metric definitions, plus a catalog with lineage and certified datasets.
- Ownership and SLAs: each dataset has an owner, a severity scheme, and an incident process with postmortems.
- Incremental processing (process only changed data) instead of full recomputes; handle skew with salting or adaptive execution; broadcast small dimensions; prune columns early.
- FinOps: budgets, per-team cost attribution, and regular reviews.
Trade-off to call out: stricter validation adds latency and may block pipelines. Use severity levels (fail, quarantine, warn) so low-risk issues do not stop the business.
5. Lake vs warehouse vs lakehouse
- Data lake: cheap object storage holding raw and varied data (structured, semi-structured, unstructured), schema applied on read. Flexible and scalable, but historically weak on transactions, consistency, and governance, which leads to "data swamps."
- Data warehouse: curated, structured data with schema on write, strong SQL performance, ACID transactions, and governance. Excellent for BI, but less suited to unstructured data and ML, and often costlier per TB with tighter coupling of storage and compute.
- Lakehouse: open file formats on object storage with a transactional table layer (versioning, ACID, schema enforcement, time travel) and warehouse-like SQL performance. One copy of data serves BI, data engineering, and ML, reducing duplicated pipelines and drift between systems. The trade-off is that it needs disciplined table maintenance and governance to reach warehouse-level predictability.
6. Cloud considerations
- Identity and access: least-privilege roles, federated SSO, service principals for jobs, fine-grained table/column/row-level access, audit logs.
- Networking: private connectivity to storage and sources, no public endpoints, controlled egress, awareness of cross-region and cross-cloud transfer costs.
- Storage: object storage tiers and lifecycle rules, versioning, and separation of storage from compute.
- Encryption: at rest and in transit, customer-managed keys where required, secrets in a vault.
- Cost: reserved/committed use versus on-demand or spot for fault-tolerant jobs, tagging, budgets and alerts, avoiding idle resources.
- Reliability and compliance: multi-zone design, backup and recovery targets, data residency and retention rules.
Presenting it
Open with the baseline and top three findings, then a 30/60/90-day plan: quick wins with expected savings, then contracts, monitoring, and architecture changes. Each action gets an owner, a metric, and a target.
Common mistakes
- Recommending a tool or migration before measuring anything.
- Tuning clusters while ignoring the data layout problem that causes the slowness.
- Treating quality as a one-time cleanup instead of ongoing monitoring with ownership.
- Cutting cost without guardrails on SLAs.
- Giving a generic list with no prioritization, owners, or numbers.