Prepstellar

DEA-C01 · Data Ingestion and Loading

22 cards

Batch and Streaming Ingestion Patterns

Swipe, scroll or use ← →
  1. Triggered execution: the batch pattern

    Every ingestion design answers two questions that are easy to confuse. The first is when does processing happen? Start there, because it is the cleanest distinction available and it does not depend on any product choice.

    A triggered ingestion pipeline processes new data on a schedule or when it is started manually.

    This execution mode fits a batch ingestion pattern because available records are handled at distinct run boundaries. Work accumulates between runs; a run begins, drains what is waiting, and ends. That boundary is the whole idea of a batch.

    1 / 22
  2. Triggered execution: the batch pattern

    Choose triggered mode when new data should be processed periodically or on demand. Those two words cover both ways a triggered run can begin:

    The requirement says The run begins
    "Every night at 02:00" On a schedule
    "Whenever the operations team asks for it" On a manual start

    One clarification prevents a common misreading. A triggered run can still process only newly available data, but its defining characteristic here is when processing begins. Triggered does not mean "reload everything" — it means the run waits for a clock or a person rather than for the data itself.

    2 / 22
  3. Quick check

    Files accumulate through the business day and must be processed at 02:00 each night. Which execution mode fits?

    1. ATriggered mode, because processing begins on a recurring schedule

      Right. A fixed daily start is a scheduled run boundary, which is exactly what triggered mode is for.

    2. BContinuous mode, because it waits until the scheduled start time

      Continuous mode does not wait for a clock; it processes new data as it arrives in the source.

    3. CTriggered mode, because it stays active between the scheduled runs

      Staying active between runs describes continuous execution, not the triggered mode this requirement calls for.

    3 / 22

  4. Continuous execution: the streaming pattern

    The other cadence removes the boundary altogether.

    A continuous ingestion pipeline processes new data as it arrives in the source.

    This execution mode fits a streaming ingestion pattern because the pipeline remains active instead of waiting for a scheduled or manual run. Nothing accumulates while it waits, because it is not waiting.

    Choose continuous mode when new source data should be processed as it arrives. A continuous run is defined by ongoing arrival-driven processing — the source, not a schedule, sets the pace.

    4 / 22
  5. Continuous execution: the streaming pattern

    Side by side, the two cadences answer the same question differently:

    Triggered Continuous
    What starts the work A schedule, or a manual start The arrival of new data
    Pipeline between runs Not running Still active
    Pattern Batch Streaming
    Natural requirement "Every night", "on demand" "As records appear"

    Neither is a quality judgement. A nightly intake is not a worse pipeline than a streaming one; it is a pipeline whose requirement is expressed in hours rather than seconds.

    5 / 22
  6. Quick check

    What defines continuous ingestion mode?

    1. AIt reprocesses the whole source every time a schedule fires again

      Reprocessing everything on a schedule describes neither mode; cadence is about when work starts, not about how much is re-read.

    2. BIt processes new data as that data arrives in the source

      Right. Continuous execution is arrival-driven: the pipeline stays active and handles new data as it appears.

    3. CIt waits for a manual trigger before every group of source records

      A manual start is one of the ways a triggered run begins, and it is the opposite of arrival-driven processing.

    6 / 22

  7. Structured Streaming: the customizable engine

    The second question is how much of the pipeline do you want to run yourself? The documented stack answers it with three layers, and the most hands-on of them is the engine underneath everything else.

    Apache Spark Structured Streaming is a streaming engine with end-to-end fault tolerance and exactly-once processing guarantees through Spark APIs.

    Two promises are packed into that sentence. End-to-end fault tolerance means a failure does not leave the pipeline in an unknown state. Exactly-once processing means a record is neither lost nor applied twice when a run recovers.

    7 / 22
  8. Structured Streaming: the customizable engine

    It is the most customizable ingestion layer in the documented stack. You write against Spark APIs, which is exactly what you want when the workload has requirements no declarative framework expresses — and exactly what you do not want when it does not, because everything you write is yours to maintain.

    What this layer does not do is take over source-specific work. Authentication schemes, change data capture, and long-term API maintenance for a particular source are not part of it; those belong to the most automated layer, further up.

    8 / 22
  9. Quick check

    Which capability belongs to Apache Spark Structured Streaming?

    1. ASource-specific authentication and long-term API maintenance

      Source-specific authentication and API maintenance are added by the fully-managed connector layer, not by the engine.

    2. BScheduled-only processing, with no arrival-driven execution

      Structured Streaming is a streaming engine, so arrival-driven execution is precisely what it supports.

    3. CEnd-to-end fault tolerance and exactly-once processing through Spark APIs

      Right. It is the Spark API engine, and its documented guarantees are end-to-end fault tolerance and exactly-once processing.

    9 / 22

  10. Keep your progress in the app

    That’s 3 of 8 quick checks. In the app they stay answered, and every lesson remembers where you left off.

  11. Lakeflow pipelines: declarative management on top

    The middle layer keeps that engine and takes the operational work off your hands.

    Lakeflow pipelines extend Structured Streaming with a declarative framework that manages orchestration, monitoring, data quality, errors, and other pipeline concerns.

    Declarative means you state what the pipeline should produce rather than coding every mechanism that gets it there. They provide more automation and less operational overhead than using Structured Streaming directly.

    Concern Structured Streaming directly Lakeflow pipelines
    Orchestration Yours to build Managed by the framework
    Monitoring Yours to build Managed by the framework
    Data quality Yours to build Managed by the framework
    Error handling Yours to build Managed by the framework
    10 / 22
  12. Lakeflow pipelines: declarative management on top

    Note the boundary carefully, because two plausible-sounding claims are wrong.

    Lakeflow pipelines do not add source-specific authentication or long-term API maintenance — that is the layer above. And they are not restricted to batch pipelines: the declarative framework is built over a streaming engine, and it serves both patterns.

    If a streaming workload benefits from declarative orchestration, monitoring, data quality, and error management, Lakeflow pipelines supply the more managed layer. If the same workload needs direct control through Spark APIs instead, Structured Streaming supplies the customizable one.

    11 / 22
  13. Quick check

    What do Lakeflow pipelines add on top of Structured Streaming?

    1. ADeclarative management of orchestration, monitoring, data quality, and errors

      Right. They extend the engine with a declarative framework covering orchestration, monitoring, data quality, errors, and other pipeline concerns.

    2. BSource-specific authentication and long-term API maintenance for every supported source

      Source-specific authentication and API maintenance come from the fully-managed connector layer that builds on these pipelines.

    3. CA rule that every pipeline must run continuously rather than on a schedule

      The framework imposes no cadence: it can build batch pipelines as well as streaming ones.

    12 / 22

  14. Fully-managed connectors: the most automated layer

    The top of the stack builds on the layer below it rather than replacing it.

    Fully-managed connectors build on Lakeflow pipelines and add source-specific authentication, change data capture, edge-case handling, long-term API maintenance, automated retries, and automated schema evolution for supported sources.

    They are the most automated layer in this stack. Every item on that list is work that would otherwise be written and then maintained forever, and each of them is specific to the source rather than generic pipeline plumbing.

    Layer Character
    Fully-managed connectors Most automated — source-specific work is handled for supported sources
    Lakeflow pipelines Declarative management of pipeline concerns
    Structured Streaming Most customizable — direct Spark API control

    Two words limit the top layer: supported sources. Automation exists only where a connector exists.

    13 / 22
  15. Quick check

    For a supported source, what does the fully-managed connector layer take over?

    1. ADirect Spark API control, without any source-specific handling

      Direct Spark API control is what the most customizable layer offers; the managed layer moves in the opposite direction.

    2. BScheduled execution that switches off change data capture

      Managed connectors include change data capture rather than disabling it, and they impose no cadence.

    3. CAutomated retries, automated schema evolution, and source-specific authentication

      Right. Managed connectors add exactly this source-specific automation on top of Lakeflow pipelines.

    14 / 22

  16. Which layer to start from

    With three layers on the table, the selection rule is a direction rather than a preference.

    Start with the most managed layer and move to the next less-managed layer when the current layer does not meet the requirement, such as when it does not support the source.

    Two things follow. First, an unmet requirement is the only reason to move down — an unsupported source, or behaviour the layer cannot express. Second, the movement is one-directional: you do not begin at the engine and climb toward automation, because the point of the rule is to avoid writing what you could have been given.

    Keep the rule away from cadence, too. Moving between layers has nothing to do with switching between triggered and continuous execution; those are answers to a different question entirely.

    15 / 22
  17. Quick check

    How should the implementation layer normally be selected?

    1. AStart with Structured Streaming and move up when more automation is wanted

      Beginning at the engine means writing pipeline behaviour that the managed layers would have provided.

    2. BStart with the most managed layer and move down when it cannot meet a requirement

      Right. Begin at the most managed suitable layer and drop to a less-managed one when the requirement — an unsupported source, for instance — is not met.

    3. CStart with continuous mode and move to triggered mode when more customization is needed

      Triggered and continuous are execution cadences, not layers, so switching between them selects nothing about implementation.

    16 / 22

  18. Two decisions, taken separately

    The batch-versus-streaming decision and the implementation-layer decision answer different questions. The first decides when ingestion runs. The second decides how much pipeline behavior the platform manages.

    The clearest proof that they are independent is this: Lakeflow pipelines can be used to build both batch and streaming data pipelines in SQL and Python. Therefore, selecting Lakeflow pipelines does not by itself determine whether execution is triggered or continuous.

    17 / 22
  19. Two decisions, taken separately

    Laid out as a grid, all four corners are legitimate designs:

    Triggered Continuous
    Structured Streaming Scheduled runs, written against Spark APIs Arrival-driven, written against Spark APIs
    Lakeflow pipelines Scheduled runs, declaratively managed Arrival-driven, declaratively managed

    So read a requirement in two passes. "Records must be handled as they appear" fixes the column. "The team wants declarative orchestration, monitoring, and data-quality management" fixes the row. Neither phrase answers the other question, and a design that treats them as one will get one of the two wrong.

    18 / 22
  20. Quick check

    Why does choosing Lakeflow pipelines not settle the ingestion cadence?

    1. ABecause they can build both batch and streaming pipelines

      Right. The framework serves both cadence families — in SQL and in Python — so the triggered-or-continuous choice is still open after selecting it.

    2. BBecause they run only after a manual trigger, whatever the language used

      They are not limited to manual starts; scheduled and arrival-driven execution are both available.

    3. CBecause they select a source but cannot define transformations or execution

      Defining transformations is precisely what the declarative framework is for.

    19 / 22

  21. Key takeaways

    • Triggered mode processes new data on a schedule or after a manual trigger; continuous mode processes new data as it arrives.
    • Structured Streaming provides Spark API control with end-to-end fault tolerance and exactly-once processing guarantees.
    • Lakeflow pipelines add declarative management of orchestration, monitoring, data quality, and errors.
    • Fully-managed connectors build on those pipelines and add source-specific authentication, change data capture, edge-case handling, long-term API maintenance, automated retries, and automated schema evolution for supported sources.
    • Begin with the most managed suitable layer and move toward more customization only when requirements demand it.
    20 / 22
  22. Key takeaways

    Two requirements, resolved with both axes:

    Arrival-driven processing, with direct control through Spark APIs. The cadence is continuous. The layer is Structured Streaming, because "direct control through Spark APIs" is a requirement only the most customizable layer meets.

    A supported streaming source, arrival-driven, with declarative transformations, monitoring, and data-quality management. The cadence is still continuous — the arrival requirement did not change. But the layer moves up: declarative orchestration, monitoring, and data quality are exactly what Lakeflow pipelines manage, so writing it against Spark APIs would mean building all of that by hand.

    One phrase changed the layer and left the cadence alone. That is the whole point of keeping the two decisions apart.

    21 / 22
  23. Quick check

    A supported streaming source needs arrival-driven processing plus declarative transformations, monitoring, and data-quality management. Which design fits?

    1. ATriggered execution through Structured Streaming, since monitoring needs run boundaries

      Monitoring does not require scheduled boundaries, and a triggered cadence would ignore the arrival-driven requirement.

    2. BTriggered execution through a managed connector, since arrivals form a batch

      Grouping arrivals into batches contradicts the requirement, and the declarative management asked for is not what defines that layer.

    3. CContinuous execution through Lakeflow pipelines

      Right. Continuous execution matches arrival-driven processing, and Lakeflow pipelines supply the declarative orchestration, monitoring, and data-quality management.

    22 / 22

  24. 8 quick checks · then the test

    In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.

The whole course, on your phone

Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.