{"id":5942,"date":"2026-10-23T17:14:47","date_gmt":"2026-10-23T17:14:47","guid":{"rendered":"https:\/\/ranaghazzi.com\/?p=5942"},"modified":"2026-10-23T17:25:58","modified_gmt":"2026-10-23T17:25:58","slug":"declarative-pipelines-vs-structured-streaming","status":"publish","type":"post","link":"https:\/\/ranaghazzi.com\/?p=5942","title":{"rendered":"Declarative Pipelines vs. Structured Streaming"},"content":{"rendered":"<p><style>\n    .light-font-container, .light-font-container p, .light-font-container h2, .light-font-container li {<br \/>\n        font-weight: #FFFFFF !important;<br \/>\n    }<br \/>\n<\/style>\n<\/p>\n<div class=\"light-font-container\" style=\"background-color: #FFFFFF; padding: 40px; border-radius: 15px;\">\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Autoloader: Declarative Pipelines  vs. Structured Streaming<\/h2>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-table alignwide\"><table><thead><tr><th>Aspect<\/th><th>Structured Streaming (manual)<\/th><th>Declarative Pipelines (DLT\/Lakeflow)<\/th><\/tr><\/thead><tbody><tr><td><strong>Syntax<\/strong><\/td><td>spark.readStream.format(&#8220;cloudFiles&#8221;).option(&#8230;).load(path)<\/td><td>@dlt.table \/ CREATE STREAMING TABLE &#8230; AS SELECT * FROM cloud_files(&#8230;) (SQL) or dlt.read_stream in Python<\/td><\/tr><tr><td><strong>Checkpoint location<\/strong><\/td><td>You must set checkpointLocation manually in writeStream<\/td><td>Managed automatically by the pipeline (stored under pipeline storage location)<\/td><\/tr><tr><td><strong>Schema location<\/strong> (cloudFiles.schemaLocation)<\/td><td>You set and manage it explicitly<\/td><td>Managed automatically; no manual path needed<\/td><\/tr><tr><td><strong>Schema inference<\/strong><\/td><td>cloudFiles.inferColumnTypes \u2014 you configure<\/td><td>Same option available, but defaults are tuned by the pipeline; less boilerplate<\/td><\/tr><tr><td><strong>Schema evolution<\/strong><\/td><td>cloudFiles.schemaEvolutionMode (addNewColumns, rescue, failOnNewColumns, none) \u2014 handled by your own retry\/stream-restart logic on failure<\/td><td>Same modes supported, but pipeline framework handles the stream restart\/recovery automatically when schema changes occur<\/td><\/tr><tr><td><strong>Trigger control<\/strong><\/td><td>Full manual control: trigger(availableNow=True), processingTime, once, continuous<\/td><td>Pipeline-level setting \u2014 pipeline runs in <strong>Triggered<\/strong> (batch-like, processes available data then stops) or <strong>Continuous<\/strong> mode; you don\u2019t set triggers per-table<\/td><\/tr><tr><td><strong>File detection mode<\/strong><\/td><td>cloudFiles.useNotifications (directory listing vs. event notifications) \u2014 you configure<\/td><td>Same underlying options available via pipelines.autoOptimize\/cloudFiles options, but less commonly tuned manually since the pipeline optimizes it<\/td><\/tr><tr><td><strong>Rate limiting<\/strong><\/td><td>cloudFiles.maxFilesPerTrigger, cloudFiles.maxBytesPerTrigger \u2014 you set<\/td><td>Same options usable, but pipeline also applies its own backlog\/cluster autoscaling to manage throughput<\/td><\/tr><tr><td><strong>Start\/stop\/orchestration<\/strong><\/td><td>You call .start(), manage the StreamingQuery object, monitor .status, .lastProgress, handle restarts on failure<\/td><td>Pipeline engine starts\/stops\/retries streams as part of the DAG; no manual query object management<\/td><\/tr><tr><td><strong>Error handling \/ retries<\/strong><\/td><td>You write your own retry logic (e.g., while loop restarting on StreamingQueryException)<\/td><td>Built-in automatic retries and recovery at the pipeline level<\/td><\/tr><tr><td><strong>Data quality checks<\/strong><\/td><td>Not built-in \u2014 you write custom foreachBatch\/filter logic<\/td><td>Native @dlt.expect \/ CONSTRAINT expectations (drop, fail, or just log bad records)<\/td><\/tr><tr><td><strong>Lineage\/DAG across tables<\/strong><\/td><td>Manual \u2014 you wire readStream\/writeStream between notebooks\/jobs yourself<\/td><td>Automatic DAG inferred from table dependencies (bronze \u2192 silver \u2192 gold)<\/td><\/tr><tr><td><strong>Monitoring\/observability<\/strong><\/td><td>Spark UI, StreamingQueryListener, custom logging<\/td><td>Built-in pipeline event log, data quality metrics, lineage graph in UI<\/td><\/tr><tr><td><strong>CDC \/ merge patterns<\/strong><\/td><td>You write foreachBatch + MERGE INTO manually<\/td><td>Native APPLY CHANGES INTO (CDC\/SCD Type 1 &amp; 2) with minimal code<\/td><\/tr><tr><td><strong>Flexibility<\/strong><\/td><td>Highest \u2014 full control over Spark session, custom sinks, arbitrary transformations<\/td><td>Lower \u2014 constrained to the DLT programming model, but much less operational code<\/td><\/tr><tr><td><strong>Best fit<\/strong><\/td><td>Custom\/complex streaming logic, non-Delta sinks, fine-grained control needed<\/td><td>Standard medallion (Bronze\u2192Silver\u2192Gold) ingestion where you want less boilerplate and built-in reliability<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<p><style>\n    .light-font-container, .light-font-container p, .light-font-container h2, .light-font-container li {<br \/>\n        font-weight: #FFFFFF !important;<br \/>\n    }<br \/>\n<\/style>\n<\/p>\n<div class=\"light-font-container\" style=\"background-color: #FFFFFF; padding: 40px; border-radius: 15px;\">\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Autoloader: Declarative Pipelines vs. Structured Streaming<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Bottom line:<\/strong> the Autoloader cloudFiles options themselves are largely the same set in both \u2014 Declarative Pipelines just wraps checkpointing, schema location, triggering, retries, and orchestration so you don\u2019t configure them by hand.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Autoloader: Declarative Pipelines vs. Structured Streaming Aspect Structured Streaming (manual) Declarative Pipelines (DLT\/Lakeflow) Syntax spark.readStream.format(&#8220;cloudFiles&#8221;).option(&#8230;).load(path) @dlt.table \/ CREATE STREAMING TABLE &#8230; AS SELECT * FROM cloud_files(&#8230;) (SQL) or dlt.read_stream in Python Checkpoint location You must set checkpointLocation manually in writeStream Managed automatically by the pipeline (stored under pipeline storage location) Schema location (cloudFiles.schemaLocation) You set [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5942","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Declarative Pipelines vs. Structured Streaming - Rana Nasri Ghazzi<\/title>\n<meta name=\"description\" content=\"Explore Rana Ghazzi&#039;s data analytics portfolio \u2014 dashboards, visualizations, and insights built with Tableau, Power BI &amp; Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ranaghazzi.com\/?p=5942\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Declarative Pipelines vs. Structured Streaming - Rana Nasri Ghazzi\" \/>\n<meta property=\"og:description\" content=\"Explore Rana Ghazzi&#039;s data analytics portfolio \u2014 dashboards, visualizations, and insights built with Tableau, Power BI &amp; Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ranaghazzi.com\/?p=5942\" \/>\n<meta property=\"og:site_name\" content=\"Rana Nasri Ghazzi\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-23T17:14:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-23T17:25:58+00:00\" \/>\n<meta name=\"author\" content=\"Rana Ghazzi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rana Ghazzi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942\"},\"author\":{\"name\":\"Rana Ghazzi\",\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/#\\\/schema\\\/person\\\/d8ee34f53cb0df9faaf816fb5363a4cc\"},\"headline\":\"Declarative Pipelines vs. Structured Streaming\",\"datePublished\":\"2026-10-23T17:14:47+00:00\",\"dateModified\":\"2026-10-23T17:25:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942\"},\"wordCount\":444,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/#\\\/schema\\\/person\\\/d8ee34f53cb0df9faaf816fb5363a4cc\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942\",\"url\":\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942\",\"name\":\"Declarative Pipelines vs. Structured Streaming - Rana Nasri Ghazzi\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/#website\"},\"datePublished\":\"2026-10-23T17:14:47+00:00\",\"dateModified\":\"2026-10-23T17:25:58+00:00\",\"description\":\"Explore Rana Ghazzi's data analytics portfolio \u2014 dashboards, visualizations, and insights built with Tableau, Power BI & Python.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/?p=5942#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ranaghazzi.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Declarative Pipelines vs. Structured Streaming\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/#website\",\"url\":\"https:\\\/\\\/ranaghazzi.com\\\/\",\"name\":\"Rana Nasri Ghazzi\",\"description\":\"Turning Data into Decisions\",\"publisher\":{\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/#\\\/schema\\\/person\\\/d8ee34f53cb0df9faaf816fb5363a4cc\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ranaghazzi.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/#\\\/schema\\\/person\\\/d8ee34f53cb0df9faaf816fb5363a4cc\",\"name\":\"Rana Ghazzi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/logo.png\",\"url\":\"https:\\\/\\\/ranaghazzi.com\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/ranaghazzi.com\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/logo.png\",\"width\":1024,\"height\":1024,\"caption\":\"Rana Ghazzi\"},\"logo\":{\"@id\":\"https:\\\/\\\/ranaghazzi.com\\\/wp-content\\\/uploads\\\/2025\\\/11\\\/logo.png\"},\"url\":\"https:\\\/\\\/ranaghazzi.com\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Declarative Pipelines vs. Structured Streaming - Rana Nasri Ghazzi","description":"Explore Rana Ghazzi's data analytics portfolio \u2014 dashboards, visualizations, and insights built with Tableau, Power BI & Python.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ranaghazzi.com\/?p=5942","og_locale":"en_US","og_type":"article","og_title":"Declarative Pipelines vs. Structured Streaming - Rana Nasri Ghazzi","og_description":"Explore Rana Ghazzi's data analytics portfolio \u2014 dashboards, visualizations, and insights built with Tableau, Power BI & Python.","og_url":"https:\/\/ranaghazzi.com\/?p=5942","og_site_name":"Rana Nasri Ghazzi","article_published_time":"2026-10-23T17:14:47+00:00","article_modified_time":"2026-10-23T17:25:58+00:00","author":"Rana Ghazzi","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rana Ghazzi","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ranaghazzi.com\/?p=5942#article","isPartOf":{"@id":"https:\/\/ranaghazzi.com\/?p=5942"},"author":{"name":"Rana Ghazzi","@id":"https:\/\/ranaghazzi.com\/#\/schema\/person\/d8ee34f53cb0df9faaf816fb5363a4cc"},"headline":"Declarative Pipelines vs. Structured Streaming","datePublished":"2026-10-23T17:14:47+00:00","dateModified":"2026-10-23T17:25:58+00:00","mainEntityOfPage":{"@id":"https:\/\/ranaghazzi.com\/?p=5942"},"wordCount":444,"commentCount":0,"publisher":{"@id":"https:\/\/ranaghazzi.com\/#\/schema\/person\/d8ee34f53cb0df9faaf816fb5363a4cc"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ranaghazzi.com\/?p=5942#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ranaghazzi.com\/?p=5942","url":"https:\/\/ranaghazzi.com\/?p=5942","name":"Declarative Pipelines vs. Structured Streaming - Rana Nasri Ghazzi","isPartOf":{"@id":"https:\/\/ranaghazzi.com\/#website"},"datePublished":"2026-10-23T17:14:47+00:00","dateModified":"2026-10-23T17:25:58+00:00","description":"Explore Rana Ghazzi's data analytics portfolio \u2014 dashboards, visualizations, and insights built with Tableau, Power BI & Python.","breadcrumb":{"@id":"https:\/\/ranaghazzi.com\/?p=5942#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ranaghazzi.com\/?p=5942"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ranaghazzi.com\/?p=5942#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ranaghazzi.com\/"},{"@type":"ListItem","position":2,"name":"Declarative Pipelines vs. Structured Streaming"}]},{"@type":"WebSite","@id":"https:\/\/ranaghazzi.com\/#website","url":"https:\/\/ranaghazzi.com\/","name":"Rana Nasri Ghazzi","description":"Turning Data into Decisions","publisher":{"@id":"https:\/\/ranaghazzi.com\/#\/schema\/person\/d8ee34f53cb0df9faaf816fb5363a4cc"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ranaghazzi.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/ranaghazzi.com\/#\/schema\/person\/d8ee34f53cb0df9faaf816fb5363a4cc","name":"Rana Ghazzi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ranaghazzi.com\/wp-content\/uploads\/2025\/11\/logo.png","url":"https:\/\/ranaghazzi.com\/wp-content\/uploads\/2025\/11\/logo.png","contentUrl":"https:\/\/ranaghazzi.com\/wp-content\/uploads\/2025\/11\/logo.png","width":1024,"height":1024,"caption":"Rana Ghazzi"},"logo":{"@id":"https:\/\/ranaghazzi.com\/wp-content\/uploads\/2025\/11\/logo.png"},"url":"https:\/\/ranaghazzi.com\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=\/wp\/v2\/posts\/5942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5942"}],"version-history":[{"count":10,"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=\/wp\/v2\/posts\/5942\/revisions"}],"predecessor-version":[{"id":6008,"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=\/wp\/v2\/posts\/5942\/revisions\/6008"}],"wp:attachment":[{"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ranaghazzi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}