<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic What is the Best Practice of Maintaining the Delta table loaded in Streaming? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/what-is-the-best-practice-of-maintaining-the-delta-table-loaded/m-p/138768#M51008</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;We have our Bronze(append) Silver(append) and Gold(merge) Tables loaded using spark streaming continuously with trigger as processing time(3 secs).&lt;/P&gt;&lt;P&gt;We Also Run our Maintenance Job on the Table like OPTIMIZE,VACCUM and we perform DELETE for some tables with a datetime retention policy.&lt;/P&gt;&lt;P&gt;In such cases we see that our jobs often fails stating the underlying source file for deleted, or missing or updated...&lt;/P&gt;&lt;P&gt;I want to understand what is the optimized design or approach for my streaming process to perform this kind of Maintenance without affecting my streaming.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Nov 2025 11:55:52 GMT</pubDate>
    <dc:creator>Naveenkumar1811</dc:creator>
    <dc:date>2025-11-12T11:55:52Z</dc:date>
    <item>
      <title>What is the Best Practice of Maintaining the Delta table loaded in Streaming?</title>
      <link>https://community.databricks.com/t5/data-engineering/what-is-the-best-practice-of-maintaining-the-delta-table-loaded/m-p/138768#M51008</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;We have our Bronze(append) Silver(append) and Gold(merge) Tables loaded using spark streaming continuously with trigger as processing time(3 secs).&lt;/P&gt;&lt;P&gt;We Also Run our Maintenance Job on the Table like OPTIMIZE,VACCUM and we perform DELETE for some tables with a datetime retention policy.&lt;/P&gt;&lt;P&gt;In such cases we see that our jobs often fails stating the underlying source file for deleted, or missing or updated...&lt;/P&gt;&lt;P&gt;I want to understand what is the optimized design or approach for my streaming process to perform this kind of Maintenance without affecting my streaming.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2025 11:55:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/what-is-the-best-practice-of-maintaining-the-delta-table-loaded/m-p/138768#M51008</guid>
      <dc:creator>Naveenkumar1811</dc:creator>
      <dc:date>2025-11-12T11:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: What is the Best Practice of Maintaining the Delta table loaded in Streaming?</title>
      <link>https://community.databricks.com/t5/data-engineering/what-is-the-best-practice-of-maintaining-the-delta-table-loaded/m-p/138896#M51039</link>
      <description>&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;To ensure continuous Spark streaming to your Delta Lake Bronze, Silver, and Gold tables while performing maintenance jobs (like OPTIMIZE, VACUUM, and DELETE) without streaming job failures, you need to coordinate and optimize your maintenance strategies. Failures such as "underlying source file deleted or missing" are common when streaming jobs encounter files that maintenance jobs have removed or altered.&lt;/P&gt;
&lt;H2 id="recommended-strategies" class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0 md:text-lg [hr+&amp;amp;]:mt-4"&gt;Recommended Strategies&lt;/H2&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Increase Streaming Trigger Interval&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Increase the batch trigger interval for streaming jobs (from 3 seconds to something larger, like 2 minutes or more), especially on high-throughput tables. This reduces the contention between streaming write/read operations and ongoing maintenance tasks.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Avoid Overlap Between Streaming and Maintenance&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Do not schedule maintenance jobs like DELETE, OPTIMIZE, or VACUUM at the same time as streaming workloads on the same table. Maintenance tasks should run during planned low-traffic windows when streaming is paused, or be orchestrated to avoid overlap with streaming activity.​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Maintenance should be orchestrated using workflows (such as job orchestration tools, or orchestration scripts) to ensure streaming jobs are paused, maintenance completes, then streaming resumes.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Retention and Vacuum Settings&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Do not set a VACUUM retention period lower than the time in which streaming jobs may touch old files. Default is 7 days; setting it lower (e.g., 1 hour) risks removal of files still in use by streaming queries, leading to failures.​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If retention must be lowered, set&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;spark.databricks.delta.retentionDurationCheck.enabled&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;false&lt;/CODE&gt;, but this is generally discouraged unless you're confident all consumers will not read recently deleted files.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Use AutoOptimize and AutoCompaction&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Enable Delta Lake features like autoOptimize and autoCompaction to minimize small files and keep tables performant, which improves both streaming and batch consumption and reduces maintenance frequency.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Cluster and Job Management&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Use separate job clusters for maintenance work (OPTIMIZE, VACUUM, DELETE), ideally autoscaling to fit resource needs so streaming jobs remain unaffected by resource contention.​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;If required, use larger driver nodes and more workers to parallelize heavy maintenance jobs, then scale down post-job completion for efficiency.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0"&gt;Streaming-Specific Options&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;For streaming jobs, make use of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;foreachBatch&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to run periodic maintenance operations safely at batch boundaries instead of concurrently with streaming jobs.​&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Always checkpoint streaming queries. If schema changes, or VACUUM deletes files, restarting the query with a new checkpoint may be necessary.​&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H2 id="best-practice-summary" class="mb-2 mt-4 font-display font-semimedium text-base first:mt-0 md:text-lg [hr+&amp;amp;]:mt-4"&gt;Best Practice Summary&lt;/H2&gt;
&lt;UL class="marker:text-quiet list-disc"&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Schedule and orchestrate maintenance and streaming to run in non-overlapping windows.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Never run maintenance with retention periods shorter than the possible read lag of any streaming consumer.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Increase streaming batch triggers, use autoOptimize/autoCompaction, and monitor for small file accumulation.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Automate maintenance via orchestration tools/scripts to avoid manual errors.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="py-0 my-0 prose-p:pt-0 prose-p:mb-2 prose-p:my-0 [&amp;amp;&amp;gt;p]:pt-0 [&amp;amp;&amp;gt;p]:mb-2 [&amp;amp;&amp;gt;p]:my-0"&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;Consider using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;foreachBatch&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in streaming jobs to embed some maintenance logic with awareness of streaming state.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="my-2 [&amp;amp;+p]:mt-4 [&amp;amp;_strong:has(+br)]:inline-block [&amp;amp;_strong:has(+br)]:pb-2"&gt;By applying these best practices, you reduce maintenance-related stream failures and keep your pipelines resilient and performant.​&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 11:24:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/what-is-the-best-practice-of-maintaining-the-delta-table-loaded/m-p/138896#M51039</guid>
      <dc:creator>mark_ott</dc:creator>
      <dc:date>2025-11-13T11:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: What is the Best Practice of Maintaining the Delta table loaded in Streaming?</title>
      <link>https://community.databricks.com/t5/data-engineering/what-is-the-best-practice-of-maintaining-the-delta-table-loaded/m-p/138925#M51049</link>
      <description>&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;But the real problem is our streaming job runs 365 days 24 *7 and we cant afford any further latency to our data flowing to gold layer. We don't have any window to pause or slower our streaming and we continuously get the data feed actually since the data is flowing from a satellite terminal. I see the suggestion mentioned above mostly to control our streaming which is not&amp;nbsp; possible in our case? Any other best design approach for a live application perspective?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 13:01:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/what-is-the-best-practice-of-maintaining-the-delta-table-loaded/m-p/138925#M51049</guid>
      <dc:creator>Naveenkumar1811</dc:creator>
      <dc:date>2025-11-13T13:01:15Z</dc:date>
    </item>
  </channel>
</rss>

