Machine Learning pathway increased my salary by 40%
Data Ingestion and Integration Engineering
Build ingestion that can be trusted: repeatable extraction, exactly-once semantics, schema evolution without breakage, reconciliation against source systems, and the operational controls that keep pipelines honest when sources change without notice.
Executive Summary
Ingestion is where trust in a platform is won or lost. Every downstream model, dashboard and AI system inherits whatever the ingestion layer got wrong, and it does so silently. A pipeline that drops rows during a partial failure, replays duplicates after a retry, or quietly truncates a widened column will produce confident, wrong answers for months. Reliable ingestion engineering rests on a small number of principles applied consistently: extraction must be repeatable, writes must be idempotent, schema changes must be explicit, and every load must be reconcilable against the source. This topic covers batch and streaming patterns, API integration, connector management, schema evolution, reconciliation and the observability that makes a pipeline verifiable rather than merely running.
Definition
Data ingestion and integration engineering is the discipline of moving data from source systems into a platform reliably, repeatedly and verifiably. It encompasses batch extraction from databases and files, streaming consumption from event buses, API integration with third-party services, and the orchestration, validation and monitoring that surround them. Integration engineering adds the semantics: mapping source structures to platform structures, managing schema evolution, resolving keys across systems, and handling the timing differences between systems that update continuously and platforms that load periodically. The output is not merely data in storage but data with a known provenance, a known completeness and a defensible answer to the question of whether it is current.
Why It Matters
Downstream systems cannot recover from ingestion errors they cannot see. A missing day of orders appears as a plausible dip, a duplicated load inflates revenue, and a truncated identifier breaks joins silently. Because these failures look like business events rather than technical faults, they are often detected by customers rather than by monitoring. Ingestion also determines whether the platform can answer audit questions: provenance, completeness and timing must be provable, not asserted. And it determines cost, because re-extraction after a failure is expensive and full reloads are frequently the default response to problems that a reconciliation check would have localised in minutes.
Evolution of the Technology
Nightly Full Extracts -> Incremental Batch -> Micro-Batch Streaming -> Change Data Capture -> Event-Native Integration. Ingestion began with nightly full extracts that were simple and expensive. Incremental extraction with watermarks reduced cost but introduced late-arrival and boundary problems. Micro-batch streaming narrowed latency while retaining batch semantics. Change data capture moved the burden to the source log, providing accurate deltas without querying production tables. The current direction is event-native integration, where the event stream is the contract and batch layers are derived views rather than primary paths.
Learning Objectives
- Design repeatable batch extraction with stable watermarks
- Implement idempotent loads that survive retries and replays
- Choose between polling, CDC and event streams for a given source
- Handle late-arriving and out-of-order data correctly
- Manage schema evolution without breaking downstream consumers
- Build reconciliation checks that compare platform and source
- Design API integration with pagination, rate limits and backoff
- Operate connectors as owned products with service levels
- Instrument ingestion for completeness, latency and volume
- Diagnose duplicate, missing and truncated data incidents
Prerequisites
- Working knowledge of SQL and at least one programming language
- Familiarity with databases, files and message queues
- Understanding of basic data modelling concepts
- Experience operating a scheduled job in production
Repeatability and Idempotency
A pipeline is repeatable when running it twice with the same inputs produces the same output. It is idempotent when rerunning a failed or partially completed load does not duplicate or corrupt data. These two properties are the foundation of every reliable ingestion design, because failures are normal and retries are the primary recovery mechanism. Idempotency is usually achieved through a deterministic key plus a write pattern that overwrites rather than appends: merge on primary key, delete-and-insert over a partition, or upsert with a version column. The alternative, append-only with deduplication downstream, pushes the problem to every consumer and guarantees that someone will forget. Practical discipline matters: generate a deterministic load identifier per partition, write to a staging location first, validate the row count against the extract, then atomically promote. Pipelines that write directly into final tables and rely on nobody rerunning them are one transient error away from a data incident.
Idempotency Patterns
| Pattern | Mechanism | Trade-off |
|---|---|---|
| Merge on key | Upsert by primary key with version | Requires a stable key and version column |
| Partition overwrite | Replace whole partition on rerun | Cheap and safe, requires correct partitioning |
| Staging then promote | Validate in staging, swap atomically | Extra storage, strongest guarantee |
| Append with dedupe downstream | Consumers deduplicate | Pushes correctness cost to every consumer |
| Transactional load | Single transaction commits all rows | Limited by transaction size |
Extraction Patterns: Polling, CDC and Events
Polling queries a source on a schedule using a watermark such as an updated timestamp. It is simple, works against any database, and fails in specific ways: rows updated during the extraction window can be missed, deleted rows are invisible, and watermark columns that are not reliably maintained produce silent gaps. Change data capture reads the source transaction log, capturing inserts, updates and deletes in order without querying production tables. It is accurate and low-impact but requires log access, adds replication infrastructure, and needs careful handling of schema changes at the source. Event streams invert the model: the source publishes events and the platform consumes them, which gives the lowest latency and the clearest contract, but requires the source team to own publication. Choosing between them is a question of source control, volume, latency requirement and whether deletes matter. Most estates use all three, which makes connector ownership the operational challenge rather than pattern selection.
Extraction Patterns Compared
| Pattern | Latency | Captures Deletes | Main Constraint |
|---|---|---|---|
| Full extract | Daily | Yes, by replacement | Cost grows with volume |
| Watermark polling | Minutes to hours | No | Requires reliable watermark column |
| Change data capture | Seconds | Yes | Needs log access and schema handling |
| Event stream | Sub-second | Yes, as events | Requires source-side ownership |
| API polling | Varies | Rarely | Rate limits and pagination stability |
Schema Evolution and Contracts
Sources change without consulting the platform. A column widens, a field is renamed, an enum gains a value, a nested structure appears. Each change can break a pipeline, and the breakage is frequently silent: a widened column truncated by a fixed type loads successfully with corrupted values. Ingestion must therefore treat schema as a first-class concern. Record the observed schema on every load and compare it with the expected contract. Classify changes as additive, compatible or breaking, and respond differently: additive changes pass automatically, compatible changes pass with a notification, breaking changes halt the pipeline and route to the owner. Where the source supports it, negotiate a data contract so changes are announced rather than discovered. Store raw data in an open format that preserves the original structure so that a mapping error can be corrected by reprocessing rather than by re-extraction.
Schema Change Handling
| Change | Classification | Response |
|---|---|---|
| New nullable column | Additive | Pass, notify consumers |
| Column widened | Compatible | Pass with type update and validation |
| Column renamed | Breaking | Halt, route to owner, update mapping |
| Enum value added | Compatible | Pass, validate downstream logic |
| Type narrowed | Breaking | Halt, prevent silent truncation |
| Nested structure changed | Breaking | Halt, requires mapping review |
Reconciliation and Ingestion Observability
Reconciliation is the practice of proving that what arrived matches what was sent. Without it, completeness is an assumption. Practical reconciliation compares row counts, control totals such as sums and distinct counts, and boundary values between source and platform for each load window. Where direct comparison is impossible, compare against an independent extract or a source-provided control file. Reconciliation results belong in monitoring, not in a spreadsheet, and a failed check should be treated as an incident rather than a warning. Observability adds the surrounding signals: volume per load compared with a rolling baseline, latency from source change to platform availability, freshness against a published service level, and error rates by connector. These four signals catch most real failures before a consumer notices, and they are the difference between operating ingestion and hoping about it.
Reconciliation Checks
| Check | Detects | Frequency |
|---|---|---|
| Row count comparison | Missing or duplicated rows | Every load |
| Control totals | Partial loads and corruption | Every load |
| Distinct key count | Duplication from retries | Every load |
| Boundary values | Truncation and type coercion | Every load |
| Freshness against service level | Stalled pipelines | Continuous |
| Volume against baseline | Source-side anomalies | Continuous |
Batch Ingestion with Verification
From source extraction to a validated, promotable load
Streaming Ingestion with Exactly-Once Semantics
Consuming events without loss or duplication
Late-Arriving and Out-of-Order Data
Real data arrives late. A mobile client that was offline uploads hours later, a partner batch runs behind schedule, a clock on an edge device drifts. Any design that assumes events arrive in order and on time will produce wrong aggregates that look correct. Streaming systems handle this with watermarks and allowed lateness: a watermark asserts that no data earlier than a point is expected, and allowed lateness extends the window during which late arrivals are still incorporated. Batch systems handle it with reprocessing windows and idempotent overwrites of affected partitions. The architectural decision is where correctness is enforced. If downstream aggregates are append-only, late data can never be corrected and every consumer inherits the error. If aggregates are recomputable from a raw event store, late data triggers a bounded recomputation. The second pattern is more expensive in storage and far cheaper in trust, which is why retaining raw events is standard in any pipeline where lateness is plausible.
Late Data Strategies
| Strategy | Mechanism | Best For |
|---|---|---|
| Watermark with allowed lateness | Extend window for late events | Streaming aggregations |
| Bounded reprocessing | Recompute affected partitions | Batch with raw retention |
| Raw event store plus views | Aggregates derived on demand | Correctness-critical metrics |
| Quarantine and manual merge | Hold late rows for review | Low-volume regulated data |
Operating Connectors as Products
Most ingestion estates accumulate connectors faster than they accumulate owners. A connector is a piece of software with a source dependency, a schema expectation, a credential and a failure mode, which means it needs an owner, a service level and a change process exactly like any other product. Practical connector management starts with an inventory recording the source, the extraction pattern, the credential owner, the freshness service level and the downstream consumers. It continues with versioned connector configuration in source control rather than configured in a user interface, so that changes are reviewable and reversible. It requires credential rotation that does not require a human to remember, and it requires that a failing connector alerts the owning team rather than a central operations queue where nobody has context. The signal that connector management is working is simple: when a source team changes a schema, the platform learns from a contract or a check rather than from a broken dashboard three weeks later.
Connector Inventory Fields
| Field | Purpose |
|---|---|
| Source system and owner | Accountability for change notification |
| Extraction pattern | Determines failure modes and recovery |
| Credential owner and rotation | Prevents expiry incidents |
| Freshness service level | Defines what counts as broken |
| Downstream consumers | Impact assessment during incidents |
| Configuration location | Reviewability and reversibility |
Frameworks & Standards
Ingestion frameworks structure the engineering work so that reliability is designed rather than discovered after the first incident.
Ingestion Engineering Frameworks
| Framework | Focus | Use |
|---|---|---|
| Idempotency by design | Repeatable, safe reruns | Every pipeline before production |
| Reconciliation-first | Prove completeness per load | All financial and operational data |
| Contract-driven schema | Explicit change management | Sources with frequent change |
| Connector ownership | Inventory, service levels, rotation | Estates with many sources |
| Observability signals | Volume, latency, freshness, errors | Operational monitoring baseline |
Tools & Technologies
| Category | Tools | Use Case |
|---|---|---|
| Batch ingestion | Airbyte, Fivetran, custom extractors, dbt seeds | Scheduled extraction from databases and SaaS |
| CDC | Debezium, Kafka Connect, native database replication | Accurate deltas including deletes |
| Streaming | Kafka, Kinesis, Pulsar, Flink, Spark Structured Streaming | Low-latency event ingestion |
| Orchestration | Airflow, Dagster, Prefect | Scheduling, retries and dependency management |
| Schema management | Schema Registry, dbt contracts, Great Expectations | Change detection and contract enforcement |
| Reconciliation | Custom SQL checks, Soda, data diff tools | Proving completeness per load |
| Observability | Monte Carlo, Soda, Prometheus, custom metrics | Freshness, volume and error monitoring |
| Secrets | Vault, cloud secret managers, workload identity | Credential issuance and rotation |
Batch vs Streaming vs CDC Ingestion
| Aspect | Batch | Streaming | CDC |
|---|---|---|---|
| Latency | Minutes to daily | Seconds | Seconds |
| Operational complexity | Low | High | Medium |
| Handles deletes | By replacement | As events | Yes, natively |
| Cost profile | Predictable | Continuous | Moderate |
| Best for | Files, reference data, reporting | Events, telemetry, real-time features | Operational databases |
Enterprise Use Cases
Case Studies
Problem: A nightly load appended rows to a fact table. When the job failed mid-run, operators reran it, producing duplicated transactions. Revenue reporting was inflated for eleven days before finance reconciled manually.
Architecture: Introduced a deterministic load identifier per partition, staged writes with row-count reconciliation against source, and atomic partition promotion. Retries became safe by construction rather than by operator judgement.
Outcome: Duplicates stopped entirely, and the reconciliation check began catching a separate source-side partial load within the first month.
Lessons: Append-only loading with manual retry discipline is a data incident waiting for a transient failure.
Problem: A source widened a customer identifier from 12 to 20 characters. The target column retained the shorter type, so loads succeeded with truncated identifiers and joins silently lost matches.
Architecture: Added observed-schema capture per load, classified widening as a compatible change requiring type update and validation, and added boundary-value checks comparing maximum identifier length against source.
Outcome: The next schema change was detected automatically and handled without data loss, and the historical truncation was identified and repaired from retained raw data.
Lessons: A successful job is not a correct load; schema and boundary checks are what make success meaningful.
Implementation Steps
Enterprise SOPs
Purpose: Recover from failed loads without duplication
Owner: Data Engineering
Steps: Confirm failure point from logs, verify staging state, check load identifier uniqueness, rerun with same identifier, reconcile against source, promote only after reconciliation passes, record incident
Evidence: Run logs, reconciliation results, promotion records, incident notes
Purpose: Manage source schema changes safely
Owner: Data Platform Team
Steps: Detect change from observed schema, classify as additive, compatible or breaking, update mapping if needed, validate on sample, deploy with consumer notification, verify downstream
Evidence: Schema diff, classification record, validation output, consumer notice
Purpose: Provision a connector as an owned product
Owner: Ingestion Engineering
Steps: Record source and owner, choose pattern, store configuration in version control, configure credential rotation, define freshness service level, instrument metrics, hand over with runbook
Evidence: Inventory entry, configuration commit, rotation schedule, service level definition
Build a Verified Ingestion Layer for an Order Platform
Problem: An order platform ingests from store POS systems, an e-commerce database and a payment provider. Loads occasionally duplicate, store terminals upload late, and a recent source schema change truncated order identifiers without any job failing.
- Idempotent batch loads with deterministic identifiers and atomic promotion
- CDC for the e-commerce database capturing updates and deletes
- Late-arrival handling for store terminals with bounded reprocessing
- Schema change detection with additive, compatible and breaking classification
- Reconciliation against source control totals for every load
- Freshness and volume monitoring with per-connector service levels
Architecture: Store POS files land in raw storage keyed by store and business date, staged and reconciled before partition promotion. The e-commerce database streams through CDC into a raw event table with checkpointing. Payment data arrives by API with pagination and backoff, written to staging and merged on transaction identifier. Observed schema is captured per load and compared with contracts. Reconciliation compares counts and totals per window, and failures raise incidents to the owning connector team rather than a central queue.
Outcome: Revenue reporting becomes reproducible, late store uploads correct themselves without manual intervention, and schema changes surface as governed events rather than silent corruption.
Key Metrics & KPIs
Risks & Mitigation
Maturity Model
Future Roadmap
2026 Trends & Emerging Developments
Career Applications
Frequently Asked Questions
Research References
Continue this lesson with a subscription
Data Engineering & Intelligent Data Platforms is part of the paid catalogue. You have read the free preview. A subscription opens the rest of this lesson, the classroom slides and the assessment questions.
- The full lesson for this topic and every other catalogue topic
- Every classroom slide deck and worked example
- All assessments, with a verifiable certificate on completion
The Free-To-Learn library stays open to everyone and is not affected by this.
