<?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 Cost in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/cost/m-p/130078#M48689</link>
    <description>&lt;H1&gt;Reduced Monthly Databricks Bill from $47K to $12.7K&lt;/H1&gt;&lt;P class=""&gt;&lt;STRONG&gt;The Problem:&lt;/STRONG&gt; We were scanning 2.3TB for queries needing only 8GB of data.&lt;/P&gt;&lt;H2&gt;Three Quick Wins&lt;/H2&gt;&lt;H3&gt;1. Multi-dimensional Partitioning (30% savings)&lt;/H3&gt;&lt;P&gt;# Before&lt;BR /&gt;df.write.partitionBy("date").parquet(path)&lt;/P&gt;&lt;P&gt;# After-partition by multiple columns&lt;BR /&gt;df.repartition("region", "date") \&lt;BR /&gt;.sortWithinPartitions("customer_id") \&lt;BR /&gt;.write.partitionBy("region", "date").parquet(path)&lt;BR /&gt;&lt;BR /&gt;2. Add Zonemap Index (35% additional savings)&lt;BR /&gt;# Build index on high-cardinality columns only&lt;BR /&gt;selective_cols = df.columns. filter(lambda c: df.select(c). distinct(). count() &amp;gt; 100)&lt;BR /&gt;create_zonemap(table_path, selective_cols)&lt;BR /&gt;3. Query Rewriting (8% more savings)&lt;/P&gt;&lt;P class=""&gt;Use file pruning to read only necessary files.&lt;/P&gt;&lt;H2&gt;Daily Cost Impact&lt;/H2&gt;&lt;UL class=""&gt;&lt;LI&gt;&lt;STRONG&gt;Before:&lt;/STRONG&gt; 847 DBU/day ($1,567)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;After:&lt;/STRONG&gt; 223 DBU/day ($423)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Monthly savings:&lt;/STRONG&gt; $34,300&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;&lt;STRONG&gt;Key Learning:&lt;/STRONG&gt; Z-ordering actually INCREASED our costs by 12%. Targeted zone maps worked better for our access patterns.&lt;/P&gt;&lt;P class=""&gt;What's your biggest Databricks cost optimization win?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Aug 2025 18:45:13 GMT</pubDate>
    <dc:creator>ck7007</dc:creator>
    <dc:date>2025-08-28T18:45:13Z</dc:date>
    <item>
      <title>Cost</title>
      <link>https://community.databricks.com/t5/data-engineering/cost/m-p/130078#M48689</link>
      <description>&lt;H1&gt;Reduced Monthly Databricks Bill from $47K to $12.7K&lt;/H1&gt;&lt;P class=""&gt;&lt;STRONG&gt;The Problem:&lt;/STRONG&gt; We were scanning 2.3TB for queries needing only 8GB of data.&lt;/P&gt;&lt;H2&gt;Three Quick Wins&lt;/H2&gt;&lt;H3&gt;1. Multi-dimensional Partitioning (30% savings)&lt;/H3&gt;&lt;P&gt;# Before&lt;BR /&gt;df.write.partitionBy("date").parquet(path)&lt;/P&gt;&lt;P&gt;# After-partition by multiple columns&lt;BR /&gt;df.repartition("region", "date") \&lt;BR /&gt;.sortWithinPartitions("customer_id") \&lt;BR /&gt;.write.partitionBy("region", "date").parquet(path)&lt;BR /&gt;&lt;BR /&gt;2. Add Zonemap Index (35% additional savings)&lt;BR /&gt;# Build index on high-cardinality columns only&lt;BR /&gt;selective_cols = df.columns. filter(lambda c: df.select(c). distinct(). count() &amp;gt; 100)&lt;BR /&gt;create_zonemap(table_path, selective_cols)&lt;BR /&gt;3. Query Rewriting (8% more savings)&lt;/P&gt;&lt;P class=""&gt;Use file pruning to read only necessary files.&lt;/P&gt;&lt;H2&gt;Daily Cost Impact&lt;/H2&gt;&lt;UL class=""&gt;&lt;LI&gt;&lt;STRONG&gt;Before:&lt;/STRONG&gt; 847 DBU/day ($1,567)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;After:&lt;/STRONG&gt; 223 DBU/day ($423)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Monthly savings:&lt;/STRONG&gt; $34,300&lt;/LI&gt;&lt;/UL&gt;&lt;P class=""&gt;&lt;STRONG&gt;Key Learning:&lt;/STRONG&gt; Z-ordering actually INCREASED our costs by 12%. Targeted zone maps worked better for our access patterns.&lt;/P&gt;&lt;P class=""&gt;What's your biggest Databricks cost optimization win?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 18:45:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cost/m-p/130078#M48689</guid>
      <dc:creator>ck7007</dc:creator>
      <dc:date>2025-08-28T18:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cost</title>
      <link>https://community.databricks.com/t5/data-engineering/cost/m-p/130080#M48690</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/180185"&gt;@ck7007&lt;/a&gt;&amp;nbsp;thanks so much for sharing! That's such a saving, by the way. Congrats.&lt;BR /&gt;&lt;BR /&gt;Out of curiosity, did you consider using Liquid Clustering which was meant to replace partitioning and z-order:&amp;nbsp;&lt;A href="https://docs.databricks.com/aws/en/delta/clustering" target="_blank"&gt;https://docs.databricks.com/aws/en/delta/clustering&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BS_THE_ANALYST_0-1756407341099.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/19458iBE7992143DC8F09D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BS_THE_ANALYST_0-1756407341099.png" alt="BS_THE_ANALYST_0-1756407341099.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I found this part particularly interesting:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; It provides the flexibility to redefine clustering keys without rewriting existing data, allowing data layout to evolve alongside analytic needs over time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If you did use it, how did you find that versus Z-Order?&lt;BR /&gt;&lt;BR /&gt;All the best,&lt;BR /&gt;BS&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 18:57:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cost/m-p/130080#M48690</guid>
      <dc:creator>BS_THE_ANALYST</dc:creator>
      <dc:date>2025-08-28T18:57:42Z</dc:date>
    </item>
  </channel>
</rss>

