Big Data & Cloud Engineering

Chapter 5
Data Ingestion and Integration Engineering

Graduate Program in Business Analytics
Big Data & Cloud Engineering   •   Graduate

Data Ingestion and Integration Engineering

Introduction

Data ingestion is the disciplined movement of data from operational or external sources into platforms where it can be stored, transformed, analyzed, and governed. Data integration extends this activity by combining data from heterogeneous systems while preserving meaning, lineage, quality, security, and timeliness.

In a modern organization, data may originate in relational databases, enterprise applications, object storage, spreadsheets, partner APIs, sensors, logs, and event streams. These sources differ in structure, delivery mechanism, reliability, latency, ownership, and legal status. Consequently, ingestion is not simply a matter of copying bytes. It is an engineering problem involving interface design, distributed systems, data modeling, observability, failure recovery, and organizational accountability.

Traditional extract–transform–load (ETL) pipelines transform data before loading it into a target warehouse. Cloud platforms have also made extract–load–transform (ELT) common: raw data is loaded into scalable storage and transformed there. Neither pattern is universally superior. The appropriate design depends on data volume, latency, target capabilities, privacy requirements, cost, and the need to preserve raw evidence.

Learning Objectives

By the end of this chapter, the reader should be able to:

  1. Distinguish batch, micro-batch, and streaming ingestion patterns.
  2. Select appropriate ingestion methods for databases, files, APIs, applications, and IoT sources.
  3. Compare ETL, ELT, replication, and change data capture (CDC).
  4. Design connector, orchestration, retry, idempotency, and monitoring strategies.
  5. Apply schema evolution principles and construct practical data contracts.
  6. Evaluate ingestion architectures using reliability, latency, cost, governance, and business-value criteria.
  7. Identify security, privacy, ethical, and regulatory risks in data integration.

1. The Ingestion Problem as a Systems Problem

An ingestion pipeline has at least five logical stages:

  1. Source acquisition: obtaining records from a source.
  2. Transport: moving records through a network, queue, or file exchange.
  3. Landing: storing received data in a durable raw or staging area.
  4. Validation and transformation: checking structure and applying required changes.
  5. Publication: making trusted data available to downstream consumers.

A useful conceptual model is:

Source → Capture → Transport → Land → Validate → Transform → Publish → Observe

The stages may be implemented by separate services or combined in a managed platform. Separating them often improves replayability and fault isolation. For example, if a transformation fails, the organization can replay data from a durable landing zone rather than querying a production database again.

Batch, micro-batch, and streaming

Batch ingestion processes a bounded collection of records at scheduled intervals. It is suitable for daily finance extracts, periodic master-data synchronization, and large historical loads. It is operationally straightforward but introduces delay.

Micro-batch ingestion processes small batches at frequent intervals, such as every minute. It can reduce scheduling overhead while retaining batch-oriented processing semantics.

Streaming ingestion processes records continuously or near continuously. It is appropriate for fraud detection, machine telemetry, click events, and operational alerts. Streaming reduces latency but increases design complexity: ordering, duplication, late arrivals, backpressure, state management, and replay become important.

Latency should be defined precisely. If a source event occurs at time te and becomes available to a consumer at time tc, end-to-end latency is:

L = tc − te

Here, L is latency, and both times must use the same time standard and units. This measure is meaningful only when event time and consumption time are reliably recorded. A pipeline may have low transport latency but high publication latency because validation or downstream processing is slow.

2. Source-Specific Ingestion Patterns

Relational databases

Database ingestion commonly uses one of four approaches:

  • Full extraction: read the entire table each run.
  • High-water-mark extraction: extract rows whose increasing timestamp or identifier exceeds the previous successful value.
  • Database replication: copy database changes through logs or replication mechanisms.
  • Change data capture: capture inserts, updates, and deletes from transaction logs or database metadata.

Full extraction is simple but can impose substantial load and does not naturally represent deletes. If a table contains N rows and each run reads all N rows, the data-read volume is proportional to N, even when only a small number of rows changed.

A high-water-mark query may resemble:

SELECT * FROM orders WHERE updatedat > h

where h is the last successfully committed watermark. This approach assumes that the source timestamp is reliable, sufficiently precise, and not modified backward. A safety overlap can be used by querying from h − δ, where δ is an overlap interval, followed by deduplication. The overlap protects against clock precision and transaction-visibility problems but increases duplicate processing.

CDC is generally more complete. A change event commonly contains a key, operation type, event timestamp or log position, and before/after values. Consumers must preserve ordering where required and handle deletes explicitly. A log sequence number or equivalent source position is preferable to a wall-clock timestamp for exact progress tracking because positions normally provide a durable order within the source log.

Files and object storage

File ingestion includes CSV, JSON, XML, Parquet, Avro, spreadsheets, compressed archives, and application-generated logs. A robust file pattern uses:

  1. A controlled landing location.
  2. Immutable file retention.
  3. A manifest recording filename, size, checksum, source, and arrival time.
  4. Validation before publication.
  5. Quarantine for invalid files.
  6. Idempotent handling of duplicate deliveries.

A checksum can help identify whether two files are byte-for-byte identical. It does not prove that the contents are semantically correct. A file may have a valid checksum and still contain the wrong date or business entity.

Columnar formats such as Parquet are often effective for analytical workloads because they support column projection and compression. Row-oriented formats may be preferable for interchange or append-oriented event records. Format selection should consider schema evolution, tooling, compression, interoperability, and query patterns rather than file size alone.

APIs

API ingestion must account for authentication, rate limits, pagination, request quotas, timeouts, transient errors, versioning, and semantic changes. A reliable extractor records the request parameters and response state needed for replay.

Pagination is particularly significant. Offset-based pagination can become inconsistent when records are inserted or deleted during extraction. Cursor-based or token-based pagination is often more stable because the server defines the continuation position. Incremental API extraction may use a provider’s updated-since parameter, webhook mechanism, or opaque cursor.

Retries should distinguish transient failures, such as HTTP 429 or temporary service unavailability, from permanent failures, such as invalid credentials or malformed requests. Exponential backoff is commonly used. If an initial delay is d0, a simple retry schedule is:

dk = min(dmax, d0 × 2k)

where k is the zero-based retry number and dmax is the maximum delay. Random jitter should usually be added so that many workers do not retry simultaneously. This expression describes a scheduling policy, not a guarantee that a service will recover.

Applications and operational systems

Enterprise applications may expose databases, message queues, export files, webhooks, or proprietary connectors. Direct database access can bypass application rules and create load or consistency risks. APIs and domain events preserve application boundaries but may expose less historical detail.

A practical integration assessment asks:

  • What is the system of record?
  • Which fields are authoritative?
  • What constitutes a create, update, cancelation, or deletion?
  • Are business transactions atomic across tables or services?
  • Can historical states be reconstructed?
  • Who owns the source and approves interface changes?

IoT and sensor sources

IoT ingestion frequently involves gateways, message brokers, device registries, and time-series storage. Sensors may produce out-of-order, duplicated, missing, or low-quality readings. Device identity, calibration, unit conversion, clock synchronization, and firmware version should be captured as metadata.

A measurement should not be interpreted without its unit and context. For example, a value of 25 may represent degrees Celsius, degrees Fahrenheit, volts, or a device-specific code. A data contract should therefore define measurement name, unit, precision, valid range, event-time semantics, and quality flags.

3. ETL, ELT, and Integration Architecture

ETL

In ETL, data is extracted, transformed in an integration layer, and loaded into the target. ETL is useful when:

  • sensitive fields must be removed before landing;
  • the target has limited transformation capability;
  • source data must be standardized before storage;
  • strict validation is required before acceptance.

Its principal disadvantages are greater coupling to transformation infrastructure and the possible loss of raw evidence if transformed data is the only retained copy.

ELT

In ELT, data is extracted, loaded into scalable storage, and transformed using the compute engine associated with the warehouse or lakehouse. ELT supports reprocessing, experimentation, and preservation of raw data. It requires strong access controls because uncurated or sensitive data may be retained in the platform.

A mature architecture often combines the two patterns: minimal protective processing before landing, followed by governed transformations after landing. For example, credentials may be removed before raw storage while business aggregations occur inside the analytical platform.

Medallion-style refinement

Many lakehouse designs use stages such as:

  • Raw or bronze: source-faithful data with ingestion metadata.
  • Validated or silver: standardized types, deduplicated records, and conformed entities.
  • Curated or gold: business-ready data products and aggregates.

These names are conventions, not universal standards. Their value lies in clearly defined quality and ownership expectations at each stage.

4. Change Data Capture and Event Semantics

CDC is a family of techniques for identifying source changes. Log-based CDC reads transaction logs and usually has lower source-query impact than trigger-based or query-based approaches. Trigger-based CDC can capture changes in systems without accessible logs but adds write-path overhead and operational complexity. Query-based CDC relies on timestamps or version columns and may miss deletes or updates that do not modify the selected field.

A CDC consumer should answer four questions:

  1. What is the unique identity of a change event?
  2. What ordering guarantee exists?
  3. How are duplicates detected?
  4. How are deletes and tombstones represented?

If an event has key k and source position p, a practical deduplication identity may be the pair (k, p), provided the source position is unique in the relevant scope. A consumer should not assume that a network retry means a new business event.

Exactly-once claims

“Exactly once” is often used imprecisely. A system may provide exactly-once processing within a particular engine while external side effects remain vulnerable to retries. At the business level, idempotent writes and durable checkpoints are usually more valuable than an absolute claim of exactly-once delivery.

A sink operation is idempotent when repeating it produces the same intended state. Upserting a record using a stable business key is commonly more idempotent than blindly appending it. However, an upsert is safe only if key uniqueness, conflict rules, and event ordering are defined.

5. Connectors, Orchestration, and Reliability

A connector translates between a source or destination interface and the platform’s ingestion framework. Connector selection should consider supported authentication, CDC capability, schema handling, throughput, offset management, observability, vendor support, and licensing—not merely the number of available integrations.

Orchestration coordinates dependencies, schedules, retries, parameters, alerts, and recovery. A pipeline should be modeled as a directed acyclic graph when tasks have explicit dependency relationships. Orchestration should not hide business logic that belongs in version-controlled transformation code.

Checkpointing and recovery

A checkpoint records the source position that has been successfully processed. The checkpoint must be advanced only after the corresponding output is durably committed. Advancing it earlier can cause data loss; advancing it later can cause duplicates. Duplicate handling is therefore a normal design requirement, not an exceptional afterthought.

Pipeline reliability can be discussed using availability. If a service is available for time Ta and unavailable for time Td, observed availability is:

A = Ta ÷ (Ta + Td)

This ratio assumes the observation period is defined and that availability events are measured consistently. It does not measure data correctness, freshness, or completeness. A pipeline can be technically available while silently dropping records.

Important operational metrics include:

DimensionExample metricInterpretation
FreshnessEvent-to-publication latencyHow current is the data?
CompletenessReceived records ÷ expected recordsWere records missing?
ValidityRecords passing rules ÷ received recordsDoes data conform to constraints?
ReliabilitySuccessful runs ÷ scheduled runsDoes operation complete consistently?
ThroughputRecords or bytes processed per unit timeCan capacity meet demand?
CostCompute, storage, and transfer costIs the design economically sustainable?

Completeness ratios require a trustworthy denominator. If the expected record count is unknown, a high ratio may be meaningless.

6. Schema Evolution and Data Contracts

A schema defines fields, data types, constraints, relationships, and sometimes semantic metadata. Schema evolution is the change of that definition over time. Common changes include adding a nullable field, renaming a field, changing precision, splitting one field into several, or changing an identifier’s meaning.

Compatibility is context-dependent:

  • Backward compatibility means new consumers can read old data.
  • Forward compatibility means old consumers can read new data.
  • Full compatibility requires both directions under defined rules.

Adding an optional field is often safer than removing or changing the meaning of an existing field. Renaming a field should normally use a transition period in which both old and new names are supported or a versioned interface is published. Type changes, especially from numeric to string or from local time to timestamp, can create subtle analytical errors even when technical parsing succeeds.

A data contract is an explicit agreement among producers, platform owners, and consumers. It should specify:

  • field names, types, units, and descriptions;
  • required and optional fields;
  • primary or business keys;
  • event-time and processing-time definitions;
  • allowed values and quality rules;
  • null and deletion semantics;
  • privacy classification;
  • ownership and support contacts;
  • versioning and compatibility policy;
  • service-level expectations for freshness and availability.

Contracts are not merely schemas. A schema may say that a field is an integer; a contract also says what the integer means, who owns it, and what happens when its meaning changes.

7. Data Quality, Security, and Governance

Data quality controls should be placed as close as practical to the point at which errors can be detected. Typical controls include uniqueness, referential integrity, accepted-value checks, range checks, freshness thresholds, volume anomaly detection, and reconciliation to source totals.

Quarantine is preferable to silent correction when a record violates a critical rule. Automatic correction may be appropriate for documented, low-risk transformations such as trimming whitespace, but it should preserve the original value and record the rule applied.

Security controls include encrypted transport, encryption at rest, secret management, least-privilege identities, network segmentation, token rotation, audit logging, and environment separation. Personal, financial, health, and location data may require minimization, masking, tokenization, retention limits, and purpose restrictions.

Governance should establish who may ingest a source, who approves its use, which legal basis permits processing, and how individuals can exercise applicable rights. Data copied into a lake or warehouse remains subject to relevant privacy and sectoral obligations. Replication does not eliminate responsibility.

Ethically, engineers should consider whether integration creates new inferences or surveillance capabilities. Combining individually innocuous datasets can reveal sensitive behavior. Access decisions should therefore reflect potential harm, not only the sensitivity labels assigned to individual fields.

8. Worked Design Example: Retail Order Integration

Consider an illustrative retailer integrating orders from an e-commerce database, store point-of-sale files, a shipping API, and warehouse scanners.

Background and problem

Management wants near-real-time order status and a daily profitability report. The e-commerce database changes continuously, stores deliver files every hour, the shipping provider limits API requests, and warehouse scanners emit events with occasional duplicate scans. A simple nightly full extract produces stale status information and overloads the e-commerce database.

Analysis

The requirements differ by source:

SourcePatternMain riskRecommended control
E-commerce databaseLog-based CDCOrdering and deletesDurable offsets and tombstones
Store POSImmutable filesDuplicate deliveryManifest and checksum
Shipping APICursor-based incremental callsRate limitsBackoff, jitter, and cursor storage
Warehouse scannersEvent streamDuplicate and late eventsEvent IDs, event time, and watermark policy

The business key for an order is order_id; a line item requires the compound identity order_id plus line_number. The contract defines currency as ISO 4217 code, monetary amounts as decimal values rather than floating-point approximations, and timestamps as UTC instants with the original local timezone retained when needed for reporting.

Solution

The retailer lands source-faithful records in immutable object storage. CDC events include operation type and source log position. File arrivals are registered in a manifest before processing. API responses are stored with cursor metadata, and requests producing transient errors are retried under a bounded backoff policy. Scanner events are deduplicated by device-generated event ID.

A validation layer checks required keys, timestamp parseability, currency codes, and nonnegative quantities where the business rule applies. Invalid records are quarantined with reason codes. Curated tables are produced by joining orders, payments, shipments, and scans. A current-status table is maintained through idempotent upserts, while an historical event table preserves state changes for audit and analysis.

Outcome

Operational users receive fresher status information without repeated full scans of the order database. Analysts can reproduce historical reports because raw inputs and transformation versions are retained. The organization also gains visibility into late files, API failures, invalid records, and unprocessed source positions.

Learning points

The case illustrates that integration architecture should be source-specific. A single universal pattern would be inefficient or unsafe. It also demonstrates why raw retention, explicit contracts, idempotent writes, and operational metrics are complementary rather than interchangeable controls.

9. Contemporary Developments and Critical Issues

Cloud-native ingestion increasingly combines object storage, managed streaming, serverless functions, lakehouse tables, catalog services, and declarative pipeline tools. These services reduce infrastructure administration but do not remove design responsibility. Vendor abstractions can obscure costs, lock in metadata models, or make cross-platform recovery difficult.

Data products and data mesh approaches emphasize domain ownership and treating datasets as products with documented interfaces, quality expectations, and discoverability. Their success depends on platform capabilities and organizational incentives; simply assigning ownership does not guarantee interoperability.

Artificial intelligence can assist with schema matching, anomaly detection, document extraction, and pipeline code generation. Such assistance requires human review. Automated schema inference may mistake identifiers for numbers, interpret missing values incorrectly, or infer unstable types from a small sample. AI-generated transformations should be tested against contracts, privacy rules, lineage requirements, and representative edge cases.

A continuing research and engineering challenge is balancing low latency with correctness. Faster delivery may increase late-arrival errors, compute cost, and operational burden. The correct target is not minimum latency in isolation but an agreed service level that reflects decision value and risk.

Best-Practice Design Checklist

Before production release, an ingestion design should answer the following:

  • Is the source of record identified?
  • Is the extraction pattern appropriate to source behavior and required latency?
  • Can the pipeline resume from a durable checkpoint?
  • Are retries bounded and safe?
  • Are outputs idempotent or explicitly deduplicated?
  • Are deletes, corrections, and late events represented?
  • Is raw evidence retained according to policy?
  • Is schema and semantic evolution governed by a contract?
  • Are quality, freshness, completeness, and cost observable?
  • Are secrets, personal data, and access rights managed appropriately?
  • Is there a tested recovery and replay procedure?
  • Are ownership and support responsibilities explicit?

Chapter Summary

Data ingestion and integration engineering moves data from diverse sources into dependable analytical and operational platforms. Effective designs begin with source characteristics, latency requirements, consistency expectations, and governance constraints. Batch, micro-batch, and streaming patterns serve different purposes. ETL and ELT are architectural alternatives that may also be combined.

Database ingestion may use full extraction, high-water marks, replication, or CDC. File pipelines benefit from manifests, immutable landing, checksums, and quarantine. API pipelines require cursor management, rate-limit handling, and differentiated retries. IoT and event systems require attention to identity, units, event time, duplicates, and late arrival.

Reliability depends on checkpoints, durable outputs, idempotency, replay, and observability. Schema evolution must be managed through compatibility policies and data contracts that include semantics, ownership, quality, privacy, and service expectations. Security and governance are integral because copied data remains subject to ethical, legal, and organizational responsibilities.

Key Terms

Batch ingestion: Processing a bounded collection of records at scheduled intervals.

Change data capture (CDC): Detecting and delivering inserts, updates, and deletes from a source system.

Checkpoint: A durable record of the source position successfully processed.

Connector: Software that translates between a source or destination interface and an ingestion platform.

Data contract: A formal agreement defining a dataset’s schema, semantics, quality, ownership, and operational expectations.

Data integration: Combining data from multiple sources while preserving meaning and usability.

ELT: Extract, load, and transform.

ETL: Extract, transform, and load.

Event time: The time at which an event occurred in the source domain.

High-water mark: A progress value used to identify records not previously extracted.

Idempotency: The property that repeating an operation produces the same intended result.

Landing zone: Durable storage in which received source data is initially placed.

Late-arriving data: Data received after the expected processing period or watermark.

Micro-batch: Frequent processing of small bounded groups of records.

Schema evolution: Change to a dataset’s structural definition over time.

Streaming ingestion: Continuous or near-continuous processing of records.

Tombstone: A record indicating deletion or logical absence of an entity.

Watermark: A progress boundary used to reason about event-time completeness.

Review Questions

5 Short Answer Questions

  1. What is the difference between ETL and ELT?
  2. Why are durable checkpoints important in ingestion pipelines?
  3. State two limitations of high-water-mark extraction.
  4. What information should a data contract contain beyond field names and types?
  5. Why is idempotency valuable when processing retries?

5 Long Answer Questions

  1. Compare batch, micro-batch, and streaming ingestion in terms of latency, complexity, cost, and appropriate use cases.
  2. Explain how a robust file-ingestion pipeline can detect duplicate, incomplete, and invalid deliveries.
  3. Discuss log-based CDC, trigger-based CDC, and query-based incremental extraction.
  4. Explain how schema evolution can break downstream consumers and propose a compatibility policy.
  5. Evaluate the security, privacy, and ethical risks of consolidating data from operational systems into a cloud platform.

3 Analytical / Application Questions

  1. Design an ingestion architecture for a bank that receives core-banking CDC events, monthly regulatory files, and fraud-alert API data. Justify the pattern, checkpoint, quality, and governance controls for each source.
  2. A sensor platform receives 1,000 events per minute, but approximately 2% are duplicates and 1% arrive more than ten minutes late. Propose an event identity, deduplication, watermark, and monitoring strategy. Explain the trade-off between completeness and reporting latency.
  3. An API provider changes a field from a numeric customer identifier to a string and begins paginating with cursors instead of offsets. Analyze the migration risks and create a data-contract and rollout plan that protects existing consumers.

Multiple Choice Questions with Answers

Question 1

Which ingestion approach is most appropriate for capturing inserts, updates, and deletes from a database transaction log?

A. Full table extraction

B. Log-based change data capture

C. Manual spreadsheet upload

D. Offset-only API pagination

Correct Answer: B. Log-based change data capture

Question 2

In an idempotent ingestion design, repeating the same operation should:

A. Always append a new copy of the record

B. Produce the same intended final state

C. Delete the source record

D. Advance the checkpoint before writing output

Correct Answer: B. Produce the same intended final state

Question 3

Which practice best supports reliable file ingestion?

A. Overwriting files with the same name

B. Processing files without recording arrival metadata

C. Using an arrival manifest and immutable landing storage

D. Ignoring malformed records

Correct Answer: C. Using an arrival manifest and immutable landing storage

Question 4

What is a principal advantage of ELT in a scalable cloud analytical platform?

A. It eliminates the need for access controls

B. It preserves raw data for later transformation and reprocessing

C. It guarantees exactly-once delivery across all systems

D. It prevents schema evolution

Correct Answer: B. It preserves raw data for later transformation and reprocessing

Question 5

Which statement about a data contract is correct?

A. It defines only column names

B. It replaces all data-quality monitoring

C. It can specify semantics, ownership, quality, privacy, and compatibility

D. It applies only to streaming data

Correct Answer: C. It can specify semantics, ownership, quality, privacy, and compatibility

Question 6

A pipeline has 90 hours of availability and 10 hours of downtime during an observation period. Using A = Ta ÷ (Ta + Td), what is its observed availability?

A. 0.09

B. 0.10

C. 0.90

D. 9.00

Correct Answer: C. 0.90

Question 7

Why can cursor-based API pagination be preferable to offset-based pagination during a changing dataset?

A. It removes the need for authentication

B. It can provide a more stable continuation position

C. It guarantees that no records are ever late

D. It eliminates API rate limits

Correct Answer: B. It can provide a more stable continuation position

Question 8

Which action is generally safest when a critical validation rule fails?

A. Silently discard the record

B. Publish it as trusted data

C. Quarantine it with a reason code

D. Change the source value automatically without logging

Correct Answer: C. Quarantine it with a reason code

Question 9

What is the main purpose of a tombstone in a CDC or event system?

A. To indicate deletion or logical absence

B. To increase file compression

C. To identify an API password

D. To define a database index

Correct Answer: A. To indicate deletion or logical absence

Question 10

Which metric most directly measures how current published data is relative to source events?

A. Event-to-publication latency

B. Number of connector types

C. File checksum length

D. Number of schema fields

Correct Answer: A. Event-to-publication latency

Big Data & Cloud Engineering
Chapter 5 of 14