โ† All Data Engineering Flashcard Decks

Data Ingestion Patterns Flashcards

6 cards from real Data Engineering practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Data Ingestion Patterns flashcards as text
  1. A financial services company needs to replicate its transactional OLTP database to a cloud data warehouse for real-time analytics. The key requirements are to capture every individual row-level change (inserts, updates, and deletes) with minimal performance impact on the source database and to ensure data arrives at the destination with very low latency. Which ingestion pattern is most suitable for this use case?

    Answer: Change Data Capture (CDC) utilizing the database's transaction log.

    Change Data Capture (CDC) is the ideal pattern for this scenario. It reads changes directly from the database's transaction log (or write-ahead log), which is a highly efficient and low-overhead method for capturing all committed data modifications, including inserts, updates, and crucially, deletes. This approach has a minimal impact on the source database's performance and allows for the near real-time streaming of changes. The other methods are less suitable: querying a timestamp column is a batch method that cannot capture deletes and puts a query load on the source; nightly backups are not real-time; and trigger-based logging adds significant performance overhead to every transaction in the source database.

  2. In the context of ingesting data from a third-party SaaS application's API, which statement best describes the fundamental difference between a webhook-based approach and a polling-based approach?

    Answer: A webhook is a 'push' mechanism where the source system sends data upon an event, while polling is a 'pull' mechanism where the consumer periodically requests data.

    This statement accurately defines the core difference. A webhook is an event-driven, 'push' model where the source system initiates the communication, sending a payload to a pre-configured endpoint as soon as an event occurs. This is highly efficient and provides real-time data. In contrast, API polling is a 'pull' model where the consumer system is responsible for repeatedly making requests to the source API on a schedule to check for new data. This can be resource-intensive and introduces latency based on the polling interval.

  3. A large e-commerce platform runs its application on hundreds of virtual machines. The operations team needs to centralize all application logs in real-time for monitoring and security analysis. Which of the following represents the most common and effective architectural pattern for this task?

    Answer: Installing a lightweight agent (e.g., Fluentd, Filebeat) on each server to tail log files and stream events to a central log aggregator.

    The standard and most robust pattern for centralized logging is to use a dedicated log shipping agent. Lightweight agents like Fluentd, Filebeat, or the OpenTelemetry Collector are designed specifically to run on each source machine, tail log files efficiently, and forward the log events in a streaming fashion to a central system (like Elasticsearch, OpenSearch, or a message queue). This approach is scalable, resilient to network issues, and provides real-time data. Hourly batch uploads are not real-time, direct database writes would cause a performance bottleneck, and custom SSH scripts are brittle and hard to manage at scale.

  4. A data engineer is designing an ingestion pipeline for a large operational database that does not have Change Data Capture (CDC) enabled. The goal is to create a daily updated copy in the data warehouse. The source table is very large and has a `last_updated_at` timestamp column that is reliably updated on every change. Which ingestion strategy is most efficient for minimizing both the load on the source system and the amount of data transferred daily?

    Answer: An incremental load using a watermark based on the `last_updated_at` column.

    An incremental load using a watermark is the classic and most efficient pattern for this scenario. The pipeline stores the maximum `last_updated_at` value from the last successful run (the 'high watermark'). In the next run, it only queries the source for rows where `last_updated_at` is greater than the stored watermark. This drastically reduces the query load and data volume compared to a full table dump. While this method doesn't capture deletes, it is far more efficient than the other options for capturing new and updated records. Implementing triggers would add significant overhead to the operational database.

  5. An IoT company is ingesting high-throughput telemetry data from millions of devices. The data arrives in unpredictable bursts and needs to be processed by a downstream analytics application that can sometimes experience slowdowns or require maintenance. Which architectural component is crucial for decoupling the data producers from the consumers and preventing data loss during consumer downtime?

    Answer: A distributed message queue or pub/sub system like Apache Kafka or Google Cloud Pub/Sub.

    A distributed message queue is the ideal component for this use case. It acts as a durable, scalable buffer that decouples producers (IoT devices) from consumers (analytics application). Producers can write data to the queue at a very high rate, and the queue persists these messages reliably. The consumer can then read from the queue at its own pace. If the consumer is slow or offline, messages accumulate safely in the queue until the consumer is ready, preventing data loss and smoothing out bursty workloads.

  6. In the context of data ingestion pipelines, why is designing for idempotency a critical principle, especially when dealing with batch processing that may need to be re-run after a failure?

    Answer: It ensures that re-running a pipeline with the same input data multiple times produces the same final result without creating duplicates or errors.

    Idempotency is the property that an operation can be applied multiple times without changing the result beyond the initial application. In data pipelines, failures are common. An idempotent pipeline can be safely retried on the same input data after a failure without causing data duplication or corruption. For example, an idempotent write operation might use an 'upsert' (update/insert) or 'delete-then-write' pattern to ensure that re-processing a batch of data results in the correct final state in the target system, rather than creating duplicate records.