Designing an Analytics Data Pipeline Across Cloud, Hybrid and Multi-Cloud
System DesignModel answerLast updated
Design a pipeline from operational systems to analytics, then adapt it for a hybrid on-prem and cloud setup and map it onto AWS and Azure, defending each tool choice.
Scenario
A company wants to get data out of its operational systems and into an analytics platform used by analysts, dashboards and downstream applications. You are asked to design the pipeline and defend every tool you pick against at least one alternative.
The requirements are deliberately incomplete. Ask about them or state assumptions, and explain how your design would shift under different answers. Typical questions:
- What are the sources (relational databases, application events, partner files, third-party APIs) and how much does each produce per day?
- How fresh must the data be for each consumer: daily, hourly, or within minutes?
- Who consumes it: BI, analysts and data scientists, ML features, operational apps?
- Is there personal or sensitive data, and must any of it stay on-premises?
- Is the company committed to one cloud, or should the design stay portable?
Concrete services, frameworks and libraries are expected, not only boxes and arrows.
Part 1: Single cloud
Design the pipeline end to end on one cloud provider, covering:
- Ingestion per source type into a landing zone
- Storage layers, file and table formats, partitioning and schema evolution
- Transformation and orchestration
- Serving to consumers
- Data quality checks, idempotent reruns, backfills and failure alerting
Part 2: Hybrid environment
Some source systems and some data must remain in on-premises data centers. Redesign the pipeline, covering:
- Secure connectivity across the boundary, with buffering when the link fails
- Where compute and storage live on each side, and the rules for what may move
- A single orchestration and monitoring view
- Consistent identity, encryption and auditing in both environments
Ask what drives the on-prem constraint (regulation, contracts, cost) and what network capacity exists.
Part 3: AWS and Azure
Map each stage to services on both providers and compare them. Explain which differences actually change the design, what portability costs, and how local development and testing mirror the cloud deployment.
Hints
Hint 1
Start by fixing assumptions (volume, freshness, consumers, sensitivity) and let them decide batch versus streaming for each source rather than picking tools first.
Hint 2
Organize storage as raw, cleaned and curated layers on an open table format, and make every job idempotent (partition overwrite or merge on keys) so reruns and backfills are safe.
Hint 3
For the hybrid case, think about what crosses the boundary: use a private link, a local buffer or queue on-prem, and process or mask sensitive data before it leaves. For multi-cloud, separate the portable layer (open formats, dbt, Spark, Airflow, Terraform) from the managed services that differ.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Assumptions
I would state these up front and say how they change the design:
- Sources: a few relational OLTP databases (about 1 TB total, tens of GB of changes per day), application events (about 5k events/s peak), daily partner CSV files, and one or two REST APIs.
- Freshness: dashboards hourly, operational apps and some ML features within minutes, finance daily.
- Consumers: BI, analysts running SQL, data scientists, and a few services reading curated tables.
- Some columns are PII. If freshness is only daily, I would drop streaming entirely and simplify.
Part 1: Single cloud (AWS as the example)
Ingestion
- Databases: log-based change data capture (Debezium to Kafka, or AWS DMS) rather than polling queries. It captures deletes, avoids load on the primary and preserves ordering. Alternative: periodic full or incremental extracts, which are simpler but miss deletes and are heavier.
- Events: Kafka (MSK) or Kinesis. Kinesis is less operational work; Kafka gives a larger ecosystem, replay control and portability.
- Files: land in S3 through event-triggered ingestion (S3 events to a queue). APIs: scheduled extract jobs with checkpointing and rate-limit handling (Airbyte or custom Python).
Storage
- Zones: raw (immutable, as received), cleaned (typed, deduplicated), curated (modelled marts).
- Format: Parquet files managed by an open table format (Iceberg or Delta). This gives ACID merges for CDC upserts, schema evolution and time travel. Alternative: plain Parquet plus a Hive catalog, which is simpler but cannot do safe upserts or concurrent writes.
- Partition by event or ingest date, avoid high-cardinality partition keys, and compact small files regularly.
Transformation
- Spark (EMR or Glue) for large or streaming transformations; dbt on a warehouse or query engine (Redshift, Athena, Snowflake) for SQL modelling. Choosing dbt for the modelling layer gives tests, lineage and review workflows. Alternative: pure Spark SQL, which is flexible but weaker on modelling discipline.
- Streaming only where freshness requires it (Flink or Spark Structured Streaming); the rest stays batch, which is cheaper and easier to debug.
Orchestration
- Airflow (MWAA) for dependency-aware scheduling, backfills and retries. Alternatives: Dagster (better asset model and testing), Step Functions (good for small AWS-only flows, poor portability).
Serving
- Warehouse or Athena for SQL and BI, a feature store or key-value store (DynamoDB, Redis) for low-latency apps, and a semantic layer so metrics are defined once.
Quality and failure handling
- Schema and contract checks at ingestion; Great Expectations or dbt tests on null rates, uniqueness, referential integrity and freshness. Failing batches go to quarantine, not the curated layer.
- Idempotency: write by partition overwrite or MERGE on business keys, so a rerun produces the same result. Dedupe on event IDs for at-least-once delivery. Handle late data with watermarks and a reprocessing window.
- Backfills: parameterize jobs by date range, run in isolation from daily loads.
- Alerts on job failure, freshness SLA breaches and volume anomalies, routed to on-call with runbooks.
Part 2: Hybrid
- Connectivity: a dedicated link (Direct Connect or ExpressRoute) with a VPN as backup; TLS everywhere. Without a dedicated link, VPN plus compression and batching.
- Buffering: keep a local Kafka cluster or queue on-prem and replicate to the cloud (MirrorMaker 2 or a CDC agent). If the link drops, data accumulates locally and resumes from offsets, with no loss.
- Placement: regulated raw data stays on-prem in object storage (MinIO, Ceph) or HDFS. A processing step on-prem masks, tokenizes or aggregates it, and only the safe output crosses to the cloud. Allow-lists per dataset define what may move, enforced in code and reviewed.
- Compute: run Spark on-prem (Kubernetes) for the data that cannot move, cloud compute for everything else. Trade-off: two clusters to operate. Moving bulk data costs egress and time, so move compute to data when volumes are large.
- Single control plane: one Airflow deployment (or one per side, triggered from a central one) with remote workers on-prem. Metrics and logs via OpenTelemetry/Prometheus/Grafana or a hosted tool, and one lineage catalog (OpenLineage, DataHub).
- Security: a single identity provider federated to both sides, per-dataset RBAC, encryption at rest with customer-managed keys (KMS or HSM-backed), centralized audit logs, and secrets in Vault or the cloud secret manager.
Part 3: AWS versus Azure
| Stage | AWS | Azure |
|---|---|---|
| Streaming | Kinesis / MSK | Event Hubs (Kafka-compatible) |
| CDC / batch ingest | DMS, Glue, AppFlow | Data Factory, Event Hubs |
| Object storage | S3 | ADLS Gen2 |
| Spark | EMR, Glue | Databricks, Synapse, Fabric |
| Warehouse | Redshift, Athena | Synapse, Fabric Warehouse |
| Orchestration | MWAA, Step Functions | Data Factory, Managed Airflow |
| Identity / keys | IAM, KMS | Entra ID, Key Vault |
| Hybrid link | Direct Connect | ExpressRoute |
Differences that change the design: ADLS Gen2 has hierarchical namespaces and ACLs, so directory-level permissions differ from S3's IAM policies; Event Hubs is Kafka-compatible but not Kafka, with different throughput units and retention limits; Azure's Entra ID integration makes hybrid identity easier for Microsoft-centric shops; Data Factory is low-code and connector-rich, whereas Airflow is code-first.
Portability: use open formats (Parquet, Iceberg/Delta), Kafka APIs, Spark, dbt, Airflow, Terraform and containers. Cost: you give up some managed convenience and take on more operations. I would be pragmatic: portable at the data and transformation layers, native for IAM, networking and monitoring.
Local development: Docker Compose with Kafka, MinIO, Spark, Airflow and Postgres; the same dbt and Spark code runs against small sample data. Config via environment variables, infrastructure in Terraform modules, and CI that runs unit tests, dbt tests and a small end-to-end run before deployment.
Common mistakes
- Naming tools without tying them to freshness and volume.
- Choosing streaming everywhere.
- Ignoring deletes, late data, duplicates and schema changes.
- Non-idempotent jobs that corrupt data on retry.
- Bolting security on at the end, or letting sensitive data cross the hybrid boundary unmasked.
- Claiming full portability without acknowledging its cost.