<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jay Bilgaye on Medium]]></title>
        <description><![CDATA[Stories by Jay Bilgaye on Medium]]></description>
        <link>https://medium.com/@jayprakash.bilgaye?source=rss-2cdbc18b44ff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6ivnulG_T8S-aS0oX7psiQ.jpeg</url>
            <title>Stories by Jay Bilgaye on Medium</title>
            <link>https://medium.com/@jayprakash.bilgaye?source=rss-2cdbc18b44ff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 04:47:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jayprakash.bilgaye/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why 80% of Kafka Clusters Would Fail a SOC 2 Audit Tomorrow]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/why-80-of-kafka-clusters-would-fail-a-soc-2-audit-tomorrow-ce4cc8740f8b?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce4cc8740f8b</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[soc2]]></category>
            <category><![CDATA[compliance]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Fri, 08 May 2026 16:48:14 GMT</pubDate>
            <atom:updated>2026-05-08T16:48:14.646Z</atom:updated>
            <content:encoded><![CDATA[<p>We aggregated findings from 50 production scans. The patterns are consistent — and uncomfortable.</p><p><strong>The Uncomfortable Number</strong></p><p>We aggregated findings from 50 production Kafka cluster scans. **80% of them had at least one finding that would fail a SOC 2 Type II audit on the spot.** Not “needs improvement.” Not “compensating control accepted.” Fail.</p><p>The findings are not exotic. They’re not edge cases. They’re the same handful of mistakes, repeated across teams, frameworks, and managed-Kafka providers.</p><p>This post breaks down the most common ones, what SOC 2 control they map to, and what to change.</p><p>If you’re preparing for a SOC 2 audit with Kafka in scope — or you suspect an upcoming auditor question — read on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2nynSnAfbKKj6fyQNC4FxA.png" /></figure><p><strong>What “in scope” actually means</strong></p><p>Before we get to findings, the question every team gets wrong: *is Kafka in your SOC 2 scope?*</p><p>If your Kafka clusters touch any of the following, the answer is yes:</p><p>- Customer data or PII<br>- Payment information<br>- Healthcare data<br>- Authentication tokens or session data<br>- Financial transactions<br>- Audit logs from other in-scope systems</p><p>Most teams realise this in the auditor’s second meeting, not the planning phase. By then, the surface area is larger than they remembered.</p><p>— -</p><p><strong>The 7 Findings That Keep Showing Up</strong></p><p>We found 80% of clusters failing on at least one of these seven controls.</p><p><strong>1 — Inter-broker traffic in plaintext (73% of clusters)</strong></p><p>**SOC 2 control:** CC6.7 — *Restrict transmission of information.*</p><p>If `security.inter.broker.protocol` is `PLAINTEXT`, replication, controller messages, and ISR state move between brokers unencrypted. Anyone with network access between brokers can read every message replicating across the cluster.</p><p><strong>Fix:</strong></p><pre>properties<br>security.inter.broker.protocol=SSL<br>ssl.keystore.location=/etc/kafka/ssl/server.keystore.jks<br>ssl.truststore.location=/etc/kafka/ssl/server.truststore.jks<br>```</pre><p>This is a rolling-restart change. Plan it, but don’t ship without it.</p><p><strong>2 — Wildcard ACLs on production topics (73%)</strong></p><p><strong>SOC 2 control: CC6.1 — Logical access controls.</strong></p><p>ACLs granted to `User:*` or `Group:*`. Every authenticated principal can read or write the topic.</p><p>The reason it persists: someone needed quick access during an incident, granted wildcard, and never came back. The auditor will read the ACL list line-by-line; they will find this.</p><p><strong>Fix:</strong> Replace wildcards with explicit principals or a dedicated group. If your ACL surface is complex, declare ACLs in IaC and audit drift on every deploy.</p><p><strong>3 — No client authentication (52%)</strong></p><p><strong>SOC 2 control: CC6.1.</strong></p><p>A `PLAINTEXT://` listener bound to anything other than localhost. Even when “internal-only,” internal increasingly means *every workload in the VPC, every compromised pod, every leaked service-account token*.</p><p>Network position is not an authentication mechanism in 2026.</p><p><strong>Fix:</strong> SASL/SCRAM-SHA-512 at minimum, mTLS for stronger identity guarantees:</p><pre>properties<br>listeners=SASL_SSL://0.0.0.0:9093<br>sasl.enabled.mechanisms=SCRAM-SHA-512</pre><p><strong>4 — auto.create.topics.enable=true (44%)</strong></p><p><strong>SOC 2 control: CC8.1 — Authorized configuration changes.</strong></p><p>Topics created on demand have no naming convention, no retention policy, no ACL, no documentation, no change-management trail.</p><p>That’s an <strong>unauthorized configuration change</strong> in CC8.1 terms.</p><p><strong>Fix:</strong> Set it to `false`. Once. Topic creation routes through your provisioning pipeline like every other infrastructure change.</p><p><strong>5 — Outdated Kafka with unpatched CVEs (32%)</strong></p><p><strong>SOC 2 control: CC7.1 — Vulnerability detection.</strong></p><p>We routinely find clusters on 2.6, 2.8, 3.1. CVE-2023–25194 (Confluent JMX RCE), CVE-2024–27309 (Kafka principal-impersonation in MirrorMaker), and others have public exploits and were disclosed long enough ago that they should have been patched.</p><p><strong>Fix:</strong> Run `kafka-broker-api-versions.sh` and compare. Plan the rolling upgrade. If you’re stuck on an old version because of a downstream client that won’t upgrade, document the compensating control — and make sure it’s actually compensating.</p><p><strong>6 — JMX exposed without authentication (28%)</strong></p><p><strong>SOC 2 control: CC6.6 — Logical access from outside boundaries.</strong></p><p>Default port 9999. No auth. No TLS. Means anyone on the broker network can read JMX MBeans (broker internals, topic metadata, consumer group state). Some `jmxremote` configurations also allow code execution via deserialization.</p><p><strong>Fix:</strong></p><pre>properties<br>com.sun.management.jmxremote.authenticate=true<br>com.sun.management.jmxremote.ssl=true</pre><p>Or, if you don’t need JMX externally, drop it entirely.</p><p><strong>7 — No audit log retention (24%)</strong></p><p><strong>SOC 2 control: CC4.1 + CC7.2 — Ongoing monitoring.</strong></p><p>Audit logs enabled but with no retention policy, or no audit logs at all.</p><p>The auditor will ask: *”Who consumed from this topic in Q1?”* If the answer is “we don’t know,” it’s a finding. If the answer is “we know, but the logs got rotated three weeks ago,” it’s also a finding.</p><p><strong>Fix:</strong></p><pre>properties<br>authorizer.class.name=kafka.security.authorizer.AclAuthorizer<br>log4j.logger.kafka.authorizer.logger=INFO, authorizerAppender</pre><p>Plus an explicit retention policy on the audit log appender. 90 days minimum for SOC 2 Type II; 365 days if you want headroom.</p><p>— -</p><p><strong>What to do this week</strong></p><p>If three of these felt familiar, three options in order of effort:</p><p>1. <strong>Run a scan</strong> — KafkaGuard is open-source, single binary.<br>2. <strong>Pick the highest-blast-radius finding</strong> above and fix it this week. Inter-broker TLS and wildcard ACLs are usually the worst.<br>3. <strong>Schedule the audit prep meeting</strong> with your security team using this list as the agenda.</p><p>You don’t need to fix all seven before the auditor arrives. You need to be able to answer <strong>”yes, we know about it, here’s the remediation timeline, here’s the compensating control.”</strong> The cluster doesn’t have to be perfect. The story does.</p><p>— -</p><p><strong>Methodology</strong></p><p>The 50 scans referenced are a mix of self-hosted Apache Kafka, Confluent Platform, Amazon MSK, Aiven, and Redpanda — anonymous data from KafkaGuard runs across our user base over Q1–Q2 2026. We did not include scans against test clusters or scans run with ` — policy baseline-dev`. Findings are deduplicated per cluster.</p><p>— -</p><p><em>Originally published at [kafkaguard.com](https://kafkaguard.com/blog/why-80-percent-kafka-clusters-fail-soc2). KafkaGuard is an open-source Kafka security and compliance scanner — 55 controls across PCI-DSS, SOC 2, ISO 27001. Single binary. Runs in 90 seconds.*</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce4cc8740f8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building the Full Stack: Iceberg on Ozone, Hive Migration, and Troubleshooting]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/building-the-full-stack-iceberg-on-ozone-hive-migration-and-troubleshooting-593dcc657d73?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/593dcc657d73</guid>
            <category><![CDATA[cloudera]]></category>
            <category><![CDATA[apache-iceberg]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 12:46:01 GMT</pubDate>
            <atom:updated>2026-04-07T12:46:01.494Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 6 of 6 in the Apache Iceberg on CDP series</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_za1m9UGQzcOGdjxsCTTVg.png" /></figure><p>This is the final post in the series, and it covers the three topics that bring everything together: running Iceberg on Apache Ozone (Cloudera’s next-generation storage), migrating your existing Hive tables to Iceberg, and a troubleshooting reference for the issues you’ll inevitably hit.</p><p>If you’ve followed Parts 1–5, you have Iceberg tables running on HDFS with time travel, schema evolution, and a maintenance routine. This post takes you to the endgame: the full open lakehouse stack.</p><h3>Iceberg on Apache Ozone: the complete picture</h3><p>Apache Ozone is Cloudera’s designated successor to HDFS. I covered Ozone in detail in my separate Ozone series, but the short version: Ozone is a distributed object store that provides S3-compatible APIs, a Hadoop-compatible filesystem interface (ofs://), and scales to billions of objects without the NameNode bottleneck that limits HDFS.</p><p>Running Iceberg on Ozone combines modern table format with modern storage. The result is a lakehouse that scales beyond HDFS limits with all of Iceberg’s features intact.</p><h3>Configuring Iceberg tables on Ozone storage</h3><p>First, confirm Ozone is running on your CDP cluster with the ofs:// filesystem accessible:</p><pre># Verify Ozone filesystem<br>ozone fs -ls ofs://ozone1/</pre><p>Create an Ozone volume and bucket for Iceberg tables:</p><pre>ozone sh volume create /iceberg-warehouse<br>ozone sh bucket create /iceberg-warehouse/tables</pre><p>Now create an Iceberg table stored on Ozone:</p><pre>-- In spark-shell (with Iceberg extensions loaded)<br>CREATE TABLE iceberg_demo.events_on_ozone (<br>    event_id BIGINT,<br>    event_type STRING,<br>    user_id BIGINT,<br>    event_time TIMESTAMP,<br>    region STRING,<br>    payload STRING<br>)<br>USING iceberg<br>PARTITIONED BY (days(event_time), region)<br>LOCATION &#39;ofs://ozone1/iceberg-warehouse/tables/events_on_ozone&#39;<br>TBLPROPERTIES (<br>    &#39;format-version&#39; = &#39;2&#39;,<br>    &#39;write.parquet.compression-codec&#39; = &#39;zstd&#39;<br>);</pre><p>The key difference is the LOCATION clause pointing to an ofs:// path instead of hdfs://. Everything else — the CREATE TABLE syntax, partition transforms, table properties — is identical.</p><p>Insert data:</p><pre>INSERT INTO iceberg_demo.events_on_ozone VALUES<br>    (1, &#39;page_view&#39;, 1001, timestamp &#39;2026-03-15 10:30:00&#39;, &#39;us-east&#39;, &#39;{&quot;page&quot;:&quot;home&quot;}&#39;),<br>    (2, &#39;purchase&#39;,  1002, timestamp &#39;2026-03-15 14:20:00&#39;, &#39;us-west&#39;, &#39;{&quot;item&quot;:&quot;laptop&quot;}&#39;),<br>    (3, &#39;page_view&#39;, 1003, timestamp &#39;2026-03-16 09:15:00&#39;, &#39;eu-west&#39;, &#39;{&quot;page&quot;:&quot;search&quot;}&#39;);</pre><p>Verify the data lives on Ozone:</p><pre>ozone fs -ls -R ofs://ozone1/iceberg-warehouse/tables/events_on_ozone/</pre><pre>drwxr-xr-x .../metadata/<br>-rw-r--r-- .../metadata/v1.metadata.json<br>-rw-r--r-- .../metadata/v2.metadata.json<br>-rw-r--r-- .../metadata/snap-...avro<br>drwxr-xr-x .../data/<br>drwxr-xr-x .../data/event_time_day=2026-03-15/<br>...</pre><p>All Iceberg features work identically on Ozone: time travel, schema evolution, partition evolution, compaction, snapshot expiration. The table format layer is completely storage-agnostic.</p><h3>Performance considerations: Iceberg on Ozone vs HDFS</h3><p>In my testing on a 3-node cluster, I observed:</p><p><strong>Write throughput</strong> is comparable. Ozone’s write path adds a small overhead for the Ratis consensus protocol (replication via Raft rather than HDFS’s pipeline replication), but it’s negligible for batch workloads.</p><p><strong>Read throughput</strong> is comparable for sequential scans. Random reads (small file lookups) can be slightly slower due to Ozone’s key-lookup path through the OzoneManager, but Iceberg’s file-level statistics minimize random reads anyway.</p><p><strong>NameNode is no longer a bottleneck.</strong> This is the real win. A large Iceberg table might have 10,000+ data files. On HDFS, those 10,000 files contribute to NameNode heap pressure (~150 bytes per file+block in memory). On Ozone, the OzoneManager handles this with a RocksDB-backed store that scales to billions of keys.</p><p><strong>The storage density improvement</strong> is significant. Ozone DataNodes can manage ~400TB each vs. HDFS’s ~100TB practical limit. Fewer nodes for the same storage capacity means lower hardware costs.</p><h3>Migrating Iceberg tables from HDFS to Ozone</h3><p>If you have existing Iceberg tables on HDFS and want to move them to Ozone, the cleanest approach is:</p><pre>-- Create new table on Ozone with same schema<br>CREATE TABLE iceberg_demo.events_ozone<br>USING iceberg<br>LOCATION &#39;ofs://ozone1/iceberg-warehouse/tables/events_ozone&#39;<br>AS SELECT * FROM iceberg_demo.events;</pre><p>This copies both schema and data. For large tables, run this as a Spark job with appropriate executor resources.</p><p>Alternatively, use DistCp at the file level and then register the table:</p><pre># Copy data files<br>hadoop distcp hdfs:///warehouse/.../events/data ofs://ozone1/iceberg-warehouse/tables/events/data</pre><pre># Copy metadata<br>hadoop distcp hdfs:///warehouse/.../events/metadata ofs://ozone1/iceberg-warehouse/tables/events/metadata</pre><p>Then register the table in HMS pointing to the Ozone location. This preserves the full snapshot history but requires careful handling of the metadata file pointer.</p><h3>Migrating existing Hive tables to Iceberg</h3><p>This is the question I get most frequently: “We have hundreds of Hive tables. How do we migrate them to Iceberg?”</p><h3>Option 1: In-place migration (recommended for most cases)</h3><p>Iceberg provides a migrate procedure that converts a Hive table to Iceberg format in-place — without copying data:</p><pre>CALL spark_catalog.system.migrate(&#39;iceberg_demo.legacy_hive_table&#39;);</pre><p>What this does:</p><ol><li>Reads the Hive table’s metadata (schema, partitions, file locations)</li><li>Creates Iceberg metadata files that reference the existing data files</li><li>Updates the HMS entry to mark the table as Iceberg</li><li>Creates the first Iceberg snapshot</li></ol><p><strong>The data files are NOT moved or rewritten.</strong> The existing Parquet/ORC files stay exactly where they are. Iceberg simply wraps them with its metadata layer.</p><p>After migration, the table supports all Iceberg features: time travel (from this point forward), schema evolution, partition evolution, and maintenance procedures.</p><h3>Verifying the migration</h3><pre>-- Confirm it&#39;s now an Iceberg table<br>DESCRIBE EXTENDED iceberg_demo.legacy_hive_table;<br>-- Look for: Provider: iceberg</pre><pre>-- Check the snapshot history<br>SELECT * FROM iceberg_demo.legacy_hive_table.snapshots;</pre><pre>+---------------------+-------------------+-----------+<br>| committed_at        | snapshot_id       | operation |<br>+---------------------+-------------------+-----------+<br>| 2026-03-31 10:45:00 | 7723918274650123  | append    |<br>+---------------------+-------------------+-----------+</pre><p>One snapshot — the initial state at migration time.</p><h3>Option 2: CTAS (Create Table As Select)</h3><p>For tables where you want to change the file format, apply new partitioning, or filter data during migration:</p><pre>CREATE TABLE iceberg_demo.events_new<br>USING iceberg<br>PARTITIONED BY (days(event_time))<br>TBLPROPERTIES (&#39;format-version&#39; = &#39;2&#39;)<br>AS SELECT * FROM iceberg_demo.events_old_hive;</pre><p>This rewrites the data but gives you a clean start with optimal file sizes and partitioning.</p><h3>Option 3: Snapshot migration (non-destructive)</h3><p>If you want to keep the original Hive table untouched while creating an Iceberg copy:</p><pre>CALL spark_catalog.system.snapshot(&#39;iceberg_demo.source_hive_table&#39;, &#39;iceberg_demo.iceberg_copy&#39;);</pre><p>This creates an Iceberg table that references the same data files as the Hive table. Both tables remain functional. Changes to either table don’t affect the other (writes go to new files).</p><h3>Migration gotchas I’ve hit</h3><p><strong>Hive managed tables in CDP behave differently from CDH.</strong> On CDP, dropping a managed Hive table deletes the underlying data. Before migrating, verify whether your tables are managed or external:</p><pre>DESCRIBE FORMATTED your_table;<br>-- Look for: Table Type: MANAGED_TABLE vs EXTERNAL_TABLE</pre><p>If they’re managed and you’re not 100% sure about the migration, convert to external first:</p><pre>ALTER TABLE your_table SET TBLPROPERTIES (&#39;EXTERNAL&#39;=&#39;TRUE&#39;);</pre><p><strong>ORC tables with complex types</strong> sometimes have schema mapping issues during migration. Test with a small table first.</p><p><strong>Partition filter behavior changes.</strong> Hive requires explicit partition column filters in queries. Iceberg doesn’t (hidden partitioning handles it). But your existing queries with explicit partition filters still work — Iceberg just also optimizes queries without them.</p><p><strong>Statistics need rebuilding.</strong> After migration, Iceberg’s column-level statistics only exist for new data files. For migrated files, run a compaction to rewrite files with full statistics:</p><pre>CALL spark_catalog.system.rewrite_data_files(<br>    table =&gt; &#39;iceberg_demo.legacy_hive_table&#39;<br>);</pre><h3>Troubleshooting reference</h3><p>Here are the issues I’ve run into most frequently, with the actual fixes:</p><h3>“Table metadata file not found”</h3><pre>org.apache.iceberg.exceptions.NotFoundException:<br>  Failed to open input stream for file: hdfs://...metadata/v47.metadata.json</pre><p><strong>Cause:</strong> The HMS catalog points to a metadata file that was deleted — usually by an overly aggressive expire_snapshots or manual filesystem cleanup.</p><p><strong>Fix:</strong> If the previous metadata file exists (v46.metadata.json), update the HMS table property to point to it. In serious cases, the metadata-log inside the most recent surviving metadata file lists the full metadata history.</p><h3>“Concurrent write conflict — commit failed”</h3><pre>org.apache.iceberg.exceptions.CommitFailedException:<br>  Cannot commit: found conflicting changes</pre><p><strong>Cause:</strong> Two writers tried to commit to the same table simultaneously and their changes conflicted (e.g., both overwrote the same partition).</p><p><strong>Fix:</strong> Retry the failed write. Iceberg automatically retries with commit.retry.num-retries (default 4). If you&#39;re hitting this frequently, your concurrent write patterns are too aggressive. Consider:</p><ul><li>Partitioning to reduce conflict surface area</li><li>Serializing writes to the same partition via a queue or scheduler</li><li>Increasing commit.retry.num-retries in table properties</li></ul><h3>“Manifest file is too large” / slow query planning</h3><p><strong>Cause:</strong> Too many data files tracked by manifests (often from many small writes without compaction).</p><p><strong>Fix:</strong> Run compaction + manifest rewriting:</p><pre>CALL spark_catalog.system.rewrite_data_files(&#39;iceberg_demo.events&#39;);<br>CALL spark_catalog.system.rewrite_manifests(&#39;iceberg_demo.events&#39;);</pre><h3>Impala can’t see changes from Spark</h3><p><strong>Cause:</strong> Impala caches metadata and doesn’t auto-detect changes from other engines.</p><p><strong>Fix:</strong></p><pre>-- In impala-shell<br>INVALIDATE METADATA iceberg_demo.events;<br>-- Or for a lighter refresh:<br>REFRESH iceberg_demo.events;</pre><h3>“HDFS quota exceeded” during compaction</h3><p><strong>Cause:</strong> Compaction temporarily doubles storage (old files + new files coexist until old files are cleaned up by expire_snapshots).</p><p><strong>Fix:</strong> Ensure your HDFS/Ozone quota allows for 2x the table’s current size during compaction. Or compact partition-by-partition instead of the whole table.</p><h3>Slow INSERT performance</h3><p><strong>Cause:</strong> Usually too many partitions being written to simultaneously, causing many small file creations.</p><p><strong>Fix:</strong> Set the fanout writer property:</p><pre>ALTER TABLE iceberg_demo.events SET TBLPROPERTIES (<br>    &#39;write.spark.fanout.enabled&#39; = &#39;true&#39;<br>);</pre><p>Or adjust the target file size:</p><pre>ALTER TABLE iceberg_demo.events SET TBLPROPERTIES (<br>    &#39;write.target-file-size-bytes&#39; = &#39;134217728&#39;  -- 128MB<br>);</pre><h3>Series wrap-up</h3><p>Over these six posts, we’ve covered:</p><ol><li><strong>Why Iceberg exists</strong> — the Hive table problems it solves</li><li><strong>Architecture</strong> — the four-layer metadata model</li><li><strong>Hands-on setup</strong> — Iceberg on CDP with Spark, Hive, and Impala</li><li><strong>Power features</strong> — time travel, schema evolution, partition evolution</li><li><strong>Operations</strong> — compaction, snapshot expiry, manifest rewriting, orphan cleanup</li><li><strong>Full stack</strong> — Iceberg on Ozone, Hive migration, troubleshooting</li></ol><p>The common thread: Iceberg isn’t a minor upgrade from Hive tables. It’s a fundamental architectural improvement that changes how you think about data management. The immutable snapshot model, metadata-driven query planning, and storage-agnostic design make it the foundation for modern lakehouses.</p><p>If you’re still running Hive tables on CDH or early CDP versions, the migration path is well-defined and the tooling works. Start with a non-critical table, run the migrate procedure, verify everything works, then expand. The sooner you move, the sooner you stop fighting the problems that Iceberg was built to eliminate.</p><p><em>All code and configurations from this series are available on GitHub: </em><a href="https://jaybilgaye.github.io/">https://jaybilgaye.github.io/</a></p><p><em>If you found this series useful, I’m building a comprehensive CDP Private Cloud Administration course on Udemy covering Iceberg, Ozone, Ranger, Atlas, Kerberos, and everything else a CDP administrator needs. Follow me for the launch announcement.</em></p><p><em>I’m Jayprakash Bilgaye — Senior Big Data &amp; Platform Engineer, 15+ years in distributed data systems. I write about Hadoop, CDP, Kafka, ClickHouse, and the operational side of running data platforms at scale. Connect with me on LinkedIn or here </em><a href="https://jaybilgaye.github.io/">https://jaybilgaye.github.io/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=593dcc657d73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Iceberg Table Maintenance: Compaction, Cleanup, and Keeping Your Lakehouse Healthy]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/apache-iceberg-table-maintenance-compaction-cleanup-and-keeping-your-lakehouse-healthy-20e9a58c23e4?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/20e9a58c23e4</guid>
            <category><![CDATA[apache-iceberg]]></category>
            <category><![CDATA[cloudera]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 12:41:01 GMT</pubDate>
            <atom:updated>2026-04-05T12:41:01.216Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 5 of 6 in the Apache Iceberg on CDP series</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FV-JnKvlsRnDr0YalWF7ew.png" /></figure><p>Here’s the thing nobody tells you in the Iceberg getting-started tutorials: without regular maintenance, your Iceberg tables will slowly degrade. Query planning gets slower as manifest files accumulate. Storage grows as expired snapshots keep old data files alive. Small files multiply from streaming inserts.</p><p>This isn’t a flaw — it’s a design tradeoff. Iceberg keeps everything immutable for safety (snapshots, metadata, manifests). The cost of immutability is that old artifacts need explicit cleanup.</p><p>After running Iceberg on CDP for several months, I’ve landed on a maintenance routine that I’ll share here. This is the operational knowledge that separates “I created an Iceberg table” from “I run Iceberg tables in production.”</p><h3>The four maintenance procedures</h3><p>Iceberg provides four built-in procedures, all callable via Spark SQL. Think of them as your Iceberg DBA toolkit.</p><h3>1. Expire snapshots</h3><p>Every write creates a snapshot. Without expiration, snapshot count grows indefinitely, and every snapshot keeps its data files alive (they can’t be garbage collected).</p><pre>-- Expire snapshots older than 7 days, keeping at least 1<br>CALL spark_catalog.system.expire_snapshots(<br>    table =&gt; &#39;iceberg_demo.events&#39;,<br>    older_than =&gt; TIMESTAMP &#39;2026-03-24 00:00:00&#39;,<br>    retain_last =&gt; 5<br>);</pre><pre>+------------------------+----------------------------+----------------------------+<br>| deleted_data_files_cnt | deleted_manifest_files_cnt | deleted_manifest_lists_cnt |<br>+------------------------+----------------------------+----------------------------+<br>| 12                     | 3                          | 4                          |<br>+------------------------+----------------------------+----------------------------+</pre><p>The output tells you exactly what was cleaned up: 12 data files that were only referenced by expired snapshots (and not by any surviving snapshot), 3 manifest files, and 4 manifest lists.</p><p><strong>Important:</strong> retain_last =&gt; 5 guarantees you always keep the 5 most recent snapshots regardless of the older_than timestamp. This is your safety net.</p><p><strong>What gets deleted:</strong> Only files that are not referenced by ANY surviving snapshot. If a data file is shared between an expired snapshot and a surviving one, it’s kept.</p><p><strong>My recommendation:</strong> Run this daily. Keep 7 days of snapshots for time travel, with retain_last set to at least 3. For tables with regulatory requirements, extend to 30 or 90 days.</p><pre>-- Production-ready expire: keep 7 days + last 10 snapshots<br>CALL spark_catalog.system.expire_snapshots(<br>    table =&gt; &#39;iceberg_demo.events&#39;,<br>    older_than =&gt; current_timestamp() - INTERVAL 7 DAYS,<br>    retain_last =&gt; 10<br>);</pre><h3>2. Rewrite data files (compaction)</h3><p>This is Iceberg’s answer to the small files problem. It reads multiple small files and rewrites them into fewer, larger files.</p><pre>-- Check current file situation<br>SELECT file_size_in_bytes, record_count<br>FROM iceberg_demo.events.files<br>ORDER BY file_size_in_bytes;</pre><p>If you see hundreds of files under 10MB, it’s compaction time.</p><pre>-- Compact files: merge small files targeting 256MB per output file<br>CALL spark_catalog.system.rewrite_data_files(<br>    table =&gt; &#39;iceberg_demo.events&#39;,<br>    options =&gt; map(<br>        &#39;target-file-size-bytes&#39;, &#39;268435456&#39;,<br>        &#39;min-file-size-bytes&#39;, &#39;67108864&#39;,<br>        &#39;max-file-size-bytes&#39;, &#39;536870912&#39;<br>    )<br>);</pre><pre>+----------------------------+----------------------------+<br>| rewritten_data_files_count | added_data_files_count     |<br>+----------------------------+----------------------------+<br>| 847                        | 23                         |<br>+----------------------------+----------------------------+</pre><p>847 small files consolidated into 23 appropriately-sized files. The query planning improvement is immediate — manifest files now reference 23 files instead of 847.</p><p>You can also target specific partitions:</p><pre>-- Only compact files in March 2026 partitions<br>CALL spark_catalog.system.rewrite_data_files(<br>    table =&gt; &#39;iceberg_demo.events&#39;,<br>    where =&gt; &#39;event_time &gt;= timestamp &quot;2026-03-01&quot; AND event_time &lt; timestamp &quot;2026-04-01&quot;&#39;<br>);</pre><p><strong>The sort order trick:</strong> For better query performance, compact with a sort order that matches your common query patterns:</p><pre>CALL spark_catalog.system.rewrite_data_files(<br>    table =&gt; &#39;iceberg_demo.events&#39;,<br>    strategy =&gt; &#39;sort&#39;,<br>    sort_order =&gt; &#39;event_time ASC NULLS LAST, region ASC NULLS LAST&#39;<br>);</pre><p>This rewrites data files sorted by event_time and region, which dramatically improves min/max statistics for predicate pushdown. Queries filtering by event_time or region can now skip entire files based on statistics.</p><p><strong>My recommendation:</strong> Run compaction on a schedule — daily for high-ingest tables, weekly for batch-loaded tables. Always compact after a large bulk load.</p><h3>3. Rewrite manifests</h3><p>Manifest files can also become fragmented. If you’ve done many small writes, you’ll have many manifest files, each tracking just a few data files. Query planning reads all manifests, so consolidating them helps.</p><pre>-- Check manifest count<br>SELECT COUNT(*) as manifest_count FROM iceberg_demo.events.manifests;</pre><pre>+----------------+<br>| manifest_count |<br>+----------------+<br>| 234            |<br>+----------------+</pre><p>234 manifests for one table is too many. Let’s consolidate:</p><pre>CALL spark_catalog.system.rewrite_manifests(&#39;iceberg_demo.events&#39;);</pre><pre>+----------------------------+----------------------------+<br>| rewritten_manifests_count  | added_manifests_count      |<br>+----------------------------+----------------------------+<br>| 234                        | 8                          |<br>+----------------------------+----------------------------+</pre><p>234 manifests down to 8. Query planning is now reading 8 files instead of 234 to enumerate data files.</p><p><strong>My recommendation:</strong> Run after compaction (since compaction changes which data files exist, the manifest layout should be rebuilt to reflect the new file set). Monthly is usually sufficient.</p><h3>4. Remove orphan files</h3><p>Orphan files are data files that exist on storage but aren’t referenced by any snapshot’s metadata. They can appear from failed writes, interrupted compactions, or bugs.</p><pre>-- Find and remove orphan files older than 3 days<br>CALL spark_catalog.system.remove_orphan_files(<br>    table =&gt; &#39;iceberg_demo.events&#39;,<br>    older_than =&gt; current_timestamp() - INTERVAL 3 DAYS,<br>    dry_run =&gt; true   -- ALWAYS dry run first!<br>);</pre><pre>+----------------------------------------------------+<br>| orphan_file_location                               |<br>+----------------------------------------------------+<br>| .../data/event_time_day=2026-03-15/00003-1-xxx.par |<br>| .../data/event_time_day=2026-03-16/00007-1-yyy.par |<br>+----------------------------------------------------+</pre><p>Always run with dry_run =&gt; true first to see what would be deleted. Then:</p><pre>CALL spark_catalog.system.remove_orphan_files(<br>    table =&gt; &#39;iceberg_demo.events&#39;,<br>    older_than =&gt; current_timestamp() - INTERVAL 3 DAYS<br>);</pre><p><strong>Warning:</strong> Be very careful with the older_than threshold. If you set it too aggressively (e.g., 1 hour), you might delete files from a long-running write that hasn&#39;t committed yet. 3 days is a safe default.</p><p><strong>My recommendation:</strong> Run monthly. This is the least critical of the four procedures — orphan files are rare if your cluster is healthy.</p><h3>Putting it together: a production maintenance schedule</h3><p>Here’s the Airflow-friendly schedule I use:</p><pre>Daily (off-peak, e.g., 2 AM):<br>├── expire_snapshots (keep 7 days, retain_last=10)<br>└── rewrite_data_files (for tables with streaming ingest)</pre><pre>Weekly (Sunday 3 AM):<br>├── rewrite_data_files (for batch-loaded tables)<br>└── rewrite_manifests (for all tables)</pre><pre>Monthly (1st of month, 4 AM):<br>└── remove_orphan_files (dry_run first, then actual)</pre><p>On CDP, you can schedule these via:</p><ul><li><strong>Cloudera Data Engineering (CDE):</strong> Create a Spark job with the maintenance SQL, schedule with Airflow</li><li><strong>Cron + spark-submit:</strong> For simpler setups, a bash script calling spark-sql</li><li><strong>Oozie:</strong> If you’re still using Oozie (no judgment), it works fine for this</li></ul><h3>Monitoring table health</h3><p>Before and after maintenance, track these metrics:</p><pre>-- Snapshot count (should stay bounded after expire)<br>SELECT COUNT(*) FROM iceberg_demo.events.snapshots;</pre><pre>-- Data file count (should decrease after compaction)<br>SELECT COUNT(*) FROM iceberg_demo.events.files;</pre><pre>-- Average file size (should be near target-file-size after compaction)<br>SELECT<br>    COUNT(*) as file_count,<br>    AVG(file_size_in_bytes) / 1048576 as avg_size_mb,<br>    MIN(file_size_in_bytes) / 1048576 as min_size_mb,<br>    MAX(file_size_in_bytes) / 1048576 as max_size_mb,<br>    SUM(record_count) as total_records<br>FROM iceberg_demo.events.files;</pre><pre>+------------+-------------+-------------+-------------+---------------+<br>| file_count | avg_size_mb | min_size_mb | max_size_mb | total_records |<br>+------------+-------------+-------------+-------------+---------------+<br>| 23         | 241.7       | 128.3       | 256.0       | 15000000      |<br>+------------+-------------+-------------+-------------+---------------+</pre><p>23 files averaging 241MB is healthy. If you see file_count climbing above 1000 or avg_size_mb dropping below 10, it’s time for compaction.</p><pre>-- Manifest count (should stay in single digits per partition spec)<br>SELECT COUNT(*) FROM iceberg_demo.events.manifests;</pre><pre>-- Total metadata size<br>SELECT SUM(length) / 1048576 as metadata_size_mb<br>FROM iceberg_demo.events.manifests;</pre><h3>The maintenance cost is worth it</h3><p>Yes, this is more operational work than Hive tables required. But Hive tables had the same underlying problems — they just didn’t give you tools to fix them. Small files accumulated on Hive tables too; you just wrote custom Spark jobs to compact them. Old data accumulated; you just wrote custom DELETE statements or partition drops. Metadata bloated; you just restarted the Metastore and hoped for the best.</p><p>Iceberg gives you first-class, SQL-callable maintenance procedures. The problems are the same. The tooling is dramatically better.</p><p><em>In Part 6 — the series finale — I’ll cover building the full lakehouse stack: Iceberg tables on Apache Ozone storage, migrating existing Hive tables to Iceberg, and a troubleshooting guide for the issues you’ll actually hit.</em></p><p><em>All code: </em><a href="https://jaybilgaye.github.io/">https://jaybilgaye.github.io/</a><em>| Follow for the finale.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20e9a58c23e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time Travel, Schema Evolution, and Partition Evolution on Apache Iceberg]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/time-travel-schema-evolution-and-partition-evolution-on-apache-iceberg-91cf7ba33f6c?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/91cf7ba33f6c</guid>
            <category><![CDATA[apache-iceberg]]></category>
            <category><![CDATA[cloudera]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Fri, 03 Apr 2026 11:41:01 GMT</pubDate>
            <atom:updated>2026-04-03T11:41:01.392Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 4 of 6 in the Apache Iceberg on CDP series</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbLWAJZIMUONAZ_ecNHCYA.png" /></figure><p>If Part 3 was about getting Iceberg tables running, this is about the features that make you wonder how you ever lived without them. Time travel queries alone have saved me from late-night data recovery emergencies more than once in the past year.</p><p>All examples below continue from the iceberg_demo.events table we created in Part 3.</p><h3>Time travel queries</h3><p>Every write to an Iceberg table creates a new snapshot. Those snapshots don’t disappear (until you explicitly expire them). That means you can query the table as it existed at any previous point in time.</p><h3>Query by timestamp</h3><pre>-- What did the table look like yesterday before the latest batch load?<br>SELECT * FROM iceberg_demo.events<br>TIMESTAMP AS OF &#39;2026-03-31 06:00:00&#39;;</pre><p>This returns the data as it existed at that exact moment — before any writes that happened after 6 AM. No special backup tables, no restore from snapshots, no HDFS snapshot mounts. Just a query.</p><h3>Query by snapshot ID</h3><pre>-- First, find your snapshot IDs<br>SELECT committed_at, snapshot_id, operation, summary<br>FROM iceberg_demo.events.snapshots<br>ORDER BY committed_at;</pre><pre>+---------------------+-------------------+-----------+----------------------------------+<br>| committed_at        | snapshot_id       | operation | summary                          |<br>+---------------------+-------------------+-----------+----------------------------------+<br>| 2026-03-31 06:15:23 | 8823748291034562  | append    | {added-records:5, ...}           |<br>| 2026-03-31 07:30:45 | 9912637481523698  | append    | {added-records:1000, ...}        |<br>| 2026-03-31 09:12:01 | 1024859372648103  | overwrite | {deleted-records:3, added:3,...}  |<br>+---------------------+-------------------+-----------+----------------------------------+</pre><pre>-- Query the table at snapshot 1 (when it only had 5 rows)<br>SELECT COUNT(*) FROM iceberg_demo.events<br>VERSION AS OF 8823748291034562;</pre><pre>+----------+<br>| count(1) |<br>+----------+<br>| 5        |<br>+----------+</pre><h3>Rollback to a previous snapshot</h3><p>This is the emergency button. If a bad ETL job corrupted or overwrote data, you can roll the table back:</p><pre>-- Roll back to the state before the bad overwrite<br>CALL spark_catalog.system.rollback_to_snapshot(&#39;iceberg_demo.events&#39;, 9912637481523698);</pre><p>The table now points to snapshot 2. The overwrite data from snapshot 3 is still on disk (useful for forensics) but the table reads from the rolled-back state. Queries immediately see the old data.</p><p>This operation is metadata-only. No data files are copied, moved, or rewritten. It takes milliseconds regardless of table size.</p><h3>Practical use cases I’ve used in production</h3><p><strong>Debugging data discrepancies.</strong> “The dashboard numbers changed overnight but nobody ran a load.” Compare the table at two timestamps:</p><pre>-- Row count at end of business yesterday<br>SELECT COUNT(*) FROM events TIMESTAMP AS OF &#39;2026-03-30 18:00:00&#39;;<br>-- Row count this morning<br>SELECT COUNT(*) FROM events TIMESTAMP AS OF &#39;2026-03-31 08:00:00&#39;;</pre><p><strong>Audit queries.</strong> Regulatory compliance often requires showing what data looked like at a specific point in time. Time travel gives you this for free.</p><p><strong>Safe ETL development.</strong> Run your new ETL against the table. If the results look wrong, roll back. No backup/restore cycle needed.</p><h3>Schema evolution</h3><p>Iceberg supports changing a table’s schema without rewriting any data files. The changes are recorded in metadata, and Iceberg reconciles old and new schemas at read time.</p><h3>Add a column</h3><pre>ALTER TABLE iceberg_demo.events ADD COLUMNS (<br>    device_type STRING,<br>    session_id STRING<br>);</pre><p>Existing data files are untouched. When you query old data, the new columns return NULL. New inserts can populate them:</p><pre>INSERT INTO iceberg_demo.events VALUES<br>    (6, &#39;click&#39;, 1005, timestamp &#39;2026-03-18 08:00:00&#39;, &#39;ap-south&#39;, &#39;{}&#39;, &#39;mobile&#39;, &#39;sess-abc&#39;);</pre><pre>SELECT event_id, device_type, session_id FROM events ORDER BY event_id;</pre><pre>+----------+-------------+------------+<br>| event_id | device_type | session_id |<br>+----------+-------------+------------+<br>| 1        | NULL        | NULL       |  ← old data, new columns are NULL<br>| 2        | NULL        | NULL       |<br>| ...      |             |            |<br>| 6        | mobile      | sess-abc   |  ← new data has values<br>+----------+-------------+------------+</pre><h3>Rename a column</h3><pre>ALTER TABLE iceberg_demo.events RENAME COLUMN payload TO event_data;</pre><p>This is a metadata-only operation. The Parquet files still have a column called payload internally, but Iceberg maps it to the new name event_data using its column ID tracking system. Every column in Iceberg has a unique ID that persists across renames.</p><p>Try doing this with a Hive table. You can’t — not without rewriting every data file.</p><h3>Drop a column</h3><pre>ALTER TABLE iceberg_demo.events DROP COLUMN session_id;</pre><p>Again, metadata-only. The old data files still contain the session_id column physically, but Iceberg stops including it in query results. Storage is reclaimed when those files are eventually compacted into new files (covered in Part 5).</p><h3>Widen a type</h3><pre>ALTER TABLE iceberg_demo.events ALTER COLUMN user_id TYPE BIGINT;<br>-- (already BIGINT in our case, but INT → BIGINT works the same way)</pre><p>Supported type promotions: INT → BIGINT, FLOAT → DOUBLE, DECIMAL precision increase.</p><h3>What you CAN’T do</h3><p>You cannot narrow types (BIGINT → INT), change incompatible types (STRING → INT), or change a column from required to optional in format v1 (v2 allows this). These restrictions exist because Iceberg guarantees that old data files remain readable without rewriting.</p><h3>Partition evolution</h3><p>This is the feature that saves the most operational pain. In Hive, changing a table’s partition scheme requires rewriting the entire table. In Iceberg, it’s a metadata operation.</p><h3>The scenario</h3><p>Your table is partitioned by days(event_time). Traffic has grown 10x and daily partitions now contain too many files. You want to switch to hourly partitioning for new data:</p><pre>ALTER TABLE iceberg_demo.events<br>SET PARTITION SPEC (hours(event_time), region);</pre><p>That’s it. After this:</p><ul><li><strong>Existing data</strong> stays in daily partitions. The data files are not moved or rewritten.</li><li><strong>New inserts</strong> go to hourly partitions.</li><li><strong>Queries</strong> work seamlessly across both partition schemes. Iceberg’s query planner knows about both specs and prunes files correctly regardless of which partition scheme a given data file was written under.</li></ul><h3>Another common scenario: adding a partition column</h3><p>Your table was originally partitioned by days(event_time) only. You realize you should also partition by region:</p><pre>ALTER TABLE iceberg_demo.events<br>SET PARTITION SPEC (days(event_time), region);</pre><p>Old data stays in event_time_day=YYYY-MM-DD/ directories. New data goes to event_time_day=YYYY-MM-DD/region=XX/ directories. Queries against both work correctly.</p><h3>Removing a partition field</h3><p>You can also simplify the partition spec:</p><pre>ALTER TABLE iceberg_demo.events<br>SET PARTITION SPEC (month(event_time));</pre><p>Now new data is partitioned monthly instead of daily+region. Old data retains its existing layout.</p><h3>Why this matters operationally</h3><p>In my CDH days, I managed a table that started with monthly partitions. As data volume grew, we needed daily. The migration plan was: create a new table with daily partitions, run a Spark job to rewrite 40TB of data into the new layout, update all downstream consumers to point at the new table, then drop the old table. It took a week of planning and three days of execution.</p><p>With Iceberg, this is a one-line ALTER TABLE that executes in under a second.</p><h3>Combining time travel with schema evolution</h3><p>Here’s something subtle and powerful: time travel respects the schema version of each snapshot. If you added a column on March 20 and query the table as of March 15, the new column won’t appear in the results — because it didn’t exist in that schema version.</p><pre>-- Query before the column was added<br>SELECT * FROM events TIMESTAMP AS OF &#39;2026-03-15 00:00:00&#39;;<br>-- Result: no device_type column</pre><pre>-- Query after the column was added<br>SELECT * FROM events TIMESTAMP AS OF &#39;2026-03-20 00:00:00&#39;;<br>-- Result: device_type column present (NULL for old rows, populated for new)</pre><p>This is a subtle but important property for audit and compliance scenarios. The time travel view is a faithful representation of the table at that moment — including its schema.</p><p><em>Part 5 covers the operational side: compaction, snapshot expiration, orphan file cleanup, and manifest rewriting. The unglamorous work that keeps your lakehouse healthy.</em></p><p><em>All code:</em><a href="https://jaybilgaye.github.io/">https://jaybilgaye.github.io/</a><em> | Follow for Parts 5–6.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91cf7ba33f6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started: Apache Iceberg on CDP Private Cloud (Hands-On)]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/getting-started-apache-iceberg-on-cdp-private-cloud-hands-on-59e37ae6ecaa?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/59e37ae6ecaa</guid>
            <category><![CDATA[apache-iceberg]]></category>
            <category><![CDATA[cloudera]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 11:36:01 GMT</pubDate>
            <atom:updated>2026-04-02T11:36:01.418Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 3 of 6 in the Apache Iceberg on CDP series</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x7LFJ0xpVdjdVbeo3M2Bzw.png" /></figure><p>Enough theory. Let’s get our hands dirty.</p><p>In this post, I’ll walk through enabling Iceberg on a CDP Private Cloud Base 7.3.1 cluster, creating tables via both Spark SQL and Hive, querying from Impala, and verifying the metadata structure. Every command shown here was run on my 3-node CDP cluster with the actual output included.</p><h3>Prerequisites</h3><p>Before you start, confirm your environment:</p><pre># Check Cloudera Runtime version (should be 7.1.7+ for Iceberg, 7.3.1 recommended)<br>curl -u admin:admin http://your-cm-host:7180/api/v54/clusters/YourCluster | python -m json.tool | grep fullVersion</pre><p>You need these services running:</p><ul><li><strong>Hive Metastore (HMS)</strong> — Iceberg uses HMS as its catalog</li><li><strong>Spark</strong> — primary engine for Iceberg table operations</li><li><strong>Hive on Tez</strong> — for Hive-based Iceberg access</li><li><strong>Impala</strong> — for Impala-based reads (Impala Iceberg support is GA in Runtime 7.3.1)</li></ul><h3>Step 1: Configure Hive Metastore for Iceberg</h3><p>The Hive Metastore needs to know about Iceberg table types. On CDP 7.3.1, most of this is preconfigured, but verify these settings in Cloudera Manager:</p><p>Navigate to <strong>Hive &gt; Configuration</strong> and search for these properties:</p><pre># These should already be set in CDP 7.3.1<br>metastore.catalog.default = hive<br>iceberg.engine.hive.enabled = true</pre><p>For the Hive service itself, verify:</p><pre># Hive &gt; Configuration &gt; HiveServer2 Advanced Configuration<br>hive.vectorized.execution.enabled = true</pre><p>No restart should be needed if these are already set, which they typically are on a fresh CDP 7.3.1 install.</p><h3>Step 2: Verify Spark Iceberg integration</h3><p>CDP 7.3.1 ships Spark 3.3 with the Iceberg extension pre-bundled. Let’s verify:</p><pre># Launch spark-shell with Iceberg extensions<br>spark-shell \<br>  --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \<br>  --conf spark.sql.catalog.spark_catalog=org.apache.iceberg.spark.SparkSessionCatalog \<br>  --conf spark.sql.catalog.spark_catalog.type=hive</pre><p>If the shell starts without errors, you’re good. You should see the Iceberg extension loaded in the startup log:</p><pre>Setting default log level to &quot;WARN&quot;.<br>Spark context Web UI available at http://your-host:4040<br>Spark context available as &#39;sc&#39;<br>Spark session available as &#39;spark&#39;</pre><p>The three configuration properties are doing specific things:</p><ul><li>spark.sql.extensions — loads the Iceberg SQL extensions (enables CREATE TABLE ... USING iceberg, time travel syntax, stored procedures)</li><li>spark.sql.catalog.spark_catalog — tells Spark to use Iceberg&#39;s catalog implementation for the default catalog</li><li>spark.sql.catalog.spark_catalog.type=hive — uses the Hive Metastore as the backing catalog</li></ul><p>For production use, add these to spark-defaults.conf via Cloudera Manager so they&#39;re applied to every Spark session:</p><p>Navigate to <strong>Spark &gt; Configuration &gt; Spark Client Advanced Configuration</strong> and add the three properties.</p><h3>Step 3: Create your first Iceberg table (Spark SQL)</h3><pre>-- In spark-shell or spark-sql</pre><pre>-- Create a database<br>CREATE DATABASE IF NOT EXISTS iceberg_demo;<br>USE iceberg_demo;</pre><pre>-- Create an Iceberg table with hidden partitioning<br>CREATE TABLE events (<br>    event_id BIGINT,<br>    event_type STRING,<br>    user_id BIGINT,<br>    event_time TIMESTAMP,<br>    region STRING,<br>    payload STRING<br>)<br>USING iceberg<br>PARTITIONED BY (days(event_time), region)<br>TBLPROPERTIES (<br>    &#39;format-version&#39; = &#39;2&#39;,<br>    &#39;write.parquet.compression-codec&#39; = &#39;zstd&#39;<br>);</pre><p>Let me unpack the important parts:</p><p>USING iceberg — this is what makes it an Iceberg table rather than a Hive table. Forget this and you get a regular Hive managed table.</p><p>PARTITIONED BY (days(event_time), region) — notice days(event_time), not just event_time. This is a <strong>partition transform</strong>. Iceberg automatically extracts the date from the timestamp and partitions by day. Your queries don&#39;t need to include a partition column — Iceberg handles it transparently.</p><p>Available partition transforms: year(), month(), day(), hour(), bucket(n), truncate(n).</p><p>format-version = 2 — enables row-level deletes and updates.</p><p>write.parquet.compression-codec = zstd — ZSTD gives better compression than Snappy with comparable speed.</p><h3>Insert some data</h3><pre>INSERT INTO events VALUES<br>    (1, &#39;page_view&#39;, 1001, timestamp &#39;2026-03-15 10:30:00&#39;, &#39;us-east&#39;, &#39;{&quot;page&quot;:&quot;home&quot;}&#39;),<br>    (2, &#39;purchase&#39;,  1002, timestamp &#39;2026-03-15 14:20:00&#39;, &#39;us-west&#39;, &#39;{&quot;item&quot;:&quot;laptop&quot;,&quot;price&quot;:999}&#39;),<br>    (3, &#39;page_view&#39;, 1003, timestamp &#39;2026-03-16 09:15:00&#39;, &#39;eu-west&#39;, &#39;{&quot;page&quot;:&quot;search&quot;}&#39;),<br>    (4, &#39;signup&#39;,    1004, timestamp &#39;2026-03-16 11:45:00&#39;, &#39;us-east&#39;, &#39;{&quot;plan&quot;:&quot;premium&quot;}&#39;),<br>    (5, &#39;purchase&#39;,  1001, timestamp &#39;2026-03-17 16:30:00&#39;, &#39;us-east&#39;, &#39;{&quot;item&quot;:&quot;mouse&quot;,&quot;price&quot;:49}&#39;);</pre><h3>Verify the data</h3><pre>SELECT * FROM events ORDER BY event_id;</pre><pre>+----------+------------+---------+---------------------+---------+------------------------------+<br>| event_id | event_type | user_id | event_time          | region  | payload                      |<br>+----------+------------+---------+---------------------+---------+------------------------------+<br>| 1        | page_view  | 1001    | 2026-03-15 10:30:00 | us-east | {&quot;page&quot;:&quot;home&quot;}              |<br>| 2        | purchase   | 1002    | 2026-03-15 14:20:00 | us-west | {&quot;item&quot;:&quot;laptop&quot;,&quot;price&quot;:999}|<br>| 3        | page_view  | 1003    | 2026-03-16 09:15:00 | eu-west | {&quot;page&quot;:&quot;search&quot;}            |<br>| 4        | signup     | 1004    | 2026-03-16 11:45:00 | us-east | {&quot;plan&quot;:&quot;premium&quot;}           |<br>| 5        | purchase   | 1001    | 2026-03-17 16:30:00 | us-east | {&quot;item&quot;:&quot;mouse&quot;,&quot;price&quot;:49}  |<br>+----------+------------+---------+---------------------+---------+------------------------------+</pre><h3>Inspect the metadata</h3><p>This is where it gets interesting. Let’s look at what Iceberg created under the hood:</p><pre>-- View snapshot history<br>SELECT * FROM iceberg_demo.events.snapshots;</pre><pre>+---------------------+-------------------+-----------+---------+<br>| committed_at        | snapshot_id       | operation | summary |<br>+---------------------+-------------------+-----------+---------+<br>| 2026-03-31 06:15:23 | 8823748291034562  | append    | {...}   |<br>+---------------------+-------------------+-----------+---------+</pre><p>One snapshot. The append operation means data was added without overwriting.</p><pre>-- View data files<br>SELECT file_path, record_count, file_size_in_bytes<br>FROM iceberg_demo.events.files;</pre><pre>+--------------------------------------------------+--------------+--------------------+<br>| file_path                                        | record_count | file_size_in_bytes |<br>+--------------------------------------------------+--------------+--------------------+<br>| .../event_time_day=2026-03-15/region=us-east/... | 1            | 1247               |<br>| .../event_time_day=2026-03-15/region=us-west/... | 1            | 1253               |<br>| .../event_time_day=2026-03-16/region=eu-west/... | 1            | 1241               |<br>| .../event_time_day=2026-03-16/region=us-east/... | 1            | 1238               |<br>| .../event_time_day=2026-03-17/region=us-east/... | 1            | 1249               |<br>+--------------------------------------------------+--------------+--------------------+</pre><p>Five data files — one per partition combination. In a real workload with batch inserts, you’d get fewer, larger files. The small file situation here is because we inserted 5 individual rows across 5 different partitions. Part 5 will cover how to compact these.</p><h3>Step 4: Create an Iceberg table via Hive</h3><p>Hive uses slightly different syntax:</p><pre>-- In beeline<br>!connect jdbc:hive2://your-hs2-host:10000/iceberg_demo</pre><pre>CREATE TABLE customer_orders (<br>    order_id BIGINT,<br>    customer_id BIGINT,<br>    order_date DATE,<br>    total_amount DECIMAL(10,2),<br>    status STRING<br>)<br>STORED BY &#39;org.apache.iceberg.mr.hive.HiveIcebergStorageHandler&#39;<br>TBLPROPERTIES (<br>    &#39;iceberg.catalog&#39; = &#39;hive&#39;,<br>    &#39;format-version&#39; = &#39;2&#39;<br>);</pre><p>The key differences from Spark:</p><ul><li>STORED BY &#39;org.apache.iceberg.mr.hive.HiveIcebergStorageHandler&#39; instead of USING iceberg</li><li>Partition transforms are specified differently in Hive (check your CDP version’s docs for exact syntax)</li></ul><p>Insert data via Hive:</p><pre>INSERT INTO customer_orders VALUES<br>    (1001, 501, &#39;2026-03-15&#39;, 299.99, &#39;completed&#39;),<br>    (1002, 502, &#39;2026-03-15&#39;, 1499.00, &#39;shipped&#39;),<br>    (1003, 501, &#39;2026-03-16&#39;, 49.99, &#39;completed&#39;);</pre><h3>Step 5: Query Iceberg tables from Impala</h3><p>On CDP 7.3.1, Impala can read and write Iceberg tables natively:</p><pre>-- In impala-shell<br>USE iceberg_demo;</pre><pre>-- Read Iceberg table created by Spark<br>SELECT event_type, COUNT(*) as cnt<br>FROM events<br>GROUP BY event_type<br>ORDER BY cnt DESC;</pre><pre>+------------+-----+<br>| event_type | cnt |<br>+------------+-----+<br>| page_view  | 2   |<br>| purchase   | 2   |<br>| signup     | 1   |<br>+------------+-----+</pre><p>Impala can also create and insert into Iceberg tables:</p><pre>CREATE TABLE inventory (<br>    product_id BIGINT,<br>    warehouse STRING,<br>    quantity INT,<br>    last_updated TIMESTAMP<br>)<br>STORED AS ICEBERG<br>TBLPROPERTIES (&#39;format-version&#39; = &#39;2&#39;);</pre><pre>INSERT INTO inventory VALUES<br>    (1, &#39;warehouse-a&#39;, 150, now()),<br>    (2, &#39;warehouse-b&#39;, 300, now());</pre><p>The multi-engine interoperability is real. A table created by Spark is queryable by Hive and Impala. A table created by Impala is queryable by Spark and Hive. Same HMS catalog, same metadata, same data files.</p><h3>Step 6: Inspect the physical file layout</h3><p>Let’s look at what Iceberg created on HDFS:</p><pre>hdfs dfs -ls -R /warehouse/tablespace/managed/hive/iceberg_demo.db/events/metadata/ | head -20</pre><pre>-rw-r--r-- .../v1.metadata.json<br>-rw-r--r-- .../v2.metadata.json<br>-rw-r--r-- .../snap-8823748291034562-1-afe3c2d1.avro<br>-rw-r--r-- .../afe3c2d1-manifest.avro</pre><p>And the data directory:</p><pre>hdfs dfs -ls -R /warehouse/tablespace/managed/hive/iceberg_demo.db/events/data/</pre><pre>drwxr-xr-x .../event_time_day=2026-03-15/<br>drwxr-xr-x .../event_time_day=2026-03-15/region=us-east/<br>-rw-r--r-- .../event_time_day=2026-03-15/region=us-east/00001-1-a8f3e2b1.parquet<br>drwxr-xr-x .../event_time_day=2026-03-15/region=us-west/<br>-rw-r--r-- .../event_time_day=2026-03-15/region=us-west/00001-1-b9c4d3e2.parquet<br>...</pre><p>Notice the partition directory structure — event_time_day=2026-03-15/region=us-east/. Iceberg created this from the days(event_time) transform. You never specified a partition column called event_time_day. Iceberg derived it.</p><h3>Common setup issues and fixes</h3><p><strong>“Table format version not supported”</strong> — You’re running a Cloudera Runtime version older than 7.1.7. Iceberg format v2 requires Runtime 7.1.7+. Check your version and upgrade if needed.</p><p><strong>“Hive Metastore connection refused”</strong> — The HMS thrift service isn’t running. Verify in CM: Hive &gt; Instances &gt; Hive Metastore Server should be running on port 9083.</p><p><strong>“Iceberg extension not found” in Spark</strong> — You forgot the spark.sql.extensions configuration. Add it to spark-defaults.conf in CM or pass it via --conf on the command line.</p><p><strong>Impala can’t see tables created by Spark</strong> — Run INVALIDATE METADATA in Impala to refresh its catalog cache. Impala doesn&#39;t auto-detect HMS changes from other engines.</p><pre>-- In impala-shell<br>INVALIDATE METADATA iceberg_demo.events;<br>SELECT * FROM iceberg_demo.events LIMIT 5;</pre><p><strong>Table location mismatch</strong> — If you specify a custom LOCATION in the CREATE TABLE, make sure the path exists and is writable by the service user. When in doubt, let Iceberg use the default warehouse location.</p><p><em>In Part 4, I’ll cover the features that change everything: time travel queries, schema evolution, and partition evolution — all with live demos.</em></p><p><em>All code and configs: </em><a href="https://jaybilgaye.github.io/">https://jaybilgaye.github.io/</a></p><p><em>I’m Jayprakash Bilgaye — 15+ years in distributed data systems. Follow for Parts 4–6.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59e37ae6ecaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apache Iceberg Architecture: The Metadata Model That Makes Everything Work]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/apache-iceberg-architecture-the-metadata-model-that-makes-everything-work-fee506601d76?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/fee506601d76</guid>
            <category><![CDATA[apache-iceberg]]></category>
            <category><![CDATA[cloudera]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 11:36:01 GMT</pubDate>
            <atom:updated>2026-04-01T11:36:01.522Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 2 of 6 in the Apache Iceberg on CDP series</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhLVVisxR0iSWoRqzzgYVg.png" /></figure><p>In Part 1, I covered why Iceberg exists and what problems it solves. Now let’s get into the mechanics — because understanding how Iceberg organizes its metadata is the difference between “I can create tables” and “I can debug why my queries are slow and my storage is bloating.”</p><p>This is the foundation for everything that follows in this series. If you understand the four layers of Iceberg’s metadata model, every feature (time travel, schema evolution, partition evolution, compaction) will make intuitive sense.</p><h3>The four layers of Iceberg</h3><p>Every Iceberg table is organized into four distinct layers. From top to bottom:</p><p><strong>Layer 1: Catalog</strong> — Points to the current metadata file for each table. This is what the Hive Metastore (HMS) stores: a reference to the latest metadata file location.</p><p><strong>Layer 2: Metadata files</strong> — JSON files that contain the table’s schema, partition spec, snapshot history, and a pointer to the current snapshot’s manifest list. A new metadata file is written on every schema change, property change, or snapshot commit.</p><p><strong>Layer 3: Manifest lists</strong> (also called snapshot manifests) — Avro files that list all the manifest files that make up a particular snapshot. Each entry tracks the manifest file path, the partition range it covers, and content statistics (added/deleted file counts).</p><p><strong>Layer 4: Manifest files</strong> — Avro files that list the actual data files. Each entry tracks the data file path, partition values, record count, file size, and column-level statistics (min/max values, null counts).</p><p><strong>Data files</strong> sit below all of this — Parquet, ORC, or Avro files containing the actual rows.</p><h3>Why this layered approach matters</h3><p>The critical insight is that <strong>reads never need to list directories.</strong> In Hive, a query against a partitioned table requires listing the partition directory, then listing files in each relevant partition. On a table with 50,000 partitions, this directory listing alone can take minutes.</p><p>Iceberg skips directory listing entirely. The query planner reads the metadata file, finds the relevant manifest list, reads the manifest files, and knows exactly which data files to open — including their min/max column statistics for predicate pushdown. The entire planning phase works from indexed metadata, not filesystem operations.</p><p>This is why Iceberg queries can plan in seconds on tables where Hive query planning takes minutes.</p><h3>Walking through a real example</h3><p>Let me trace what happens when you create a table and insert data. I’ll use the actual file structure from my CDP cluster.</p><h3>Step 1: Create the table</h3><pre>CREATE TABLE warehouse.events (<br>    event_id BIGINT,<br>    event_type STRING,<br>    user_id BIGINT,<br>    event_time TIMESTAMP,<br>    payload STRING<br>)<br>USING iceberg<br>PARTITIONED BY (days(event_time))<br>TBLPROPERTIES (&#39;format-version&#39; = &#39;2&#39;);</pre><p>After this command, Iceberg creates:</p><ul><li>A metadata file (v1.metadata.json) containing the schema, the partition spec (days(event_time)), and an empty snapshot list.</li><li>The HMS catalog entry is updated to point to this metadata file.</li><li>No manifest lists, no manifest files, no data files yet.</li></ul><h3>Step 2: Insert data</h3><pre>INSERT INTO warehouse.events VALUES<br>    (1, &#39;click&#39;, 100, timestamp &#39;2026-03-15 10:30:00&#39;, &#39;{&quot;page&quot;: &quot;home&quot;}&#39;),<br>    (2, &#39;purchase&#39;, 101, timestamp &#39;2026-03-15 14:20:00&#39;, &#39;{&quot;item&quot;: &quot;laptop&quot;}&#39;),<br>    (3, &#39;click&#39;, 102, timestamp &#39;2026-03-16 09:15:00&#39;, &#39;{&quot;page&quot;: &quot;search&quot;}&#39;);</pre><p>Now the file structure looks like this:</p><pre>warehouse/events/<br>├── metadata/<br>│   ├── v1.metadata.json          ← initial (empty table)<br>│   ├── v2.metadata.json          ← after INSERT (current)<br>│   ├── snap-8823748...-manifest-list.avro<br>│   └── 9f3e2a1b...-manifest.avro<br>└── data/<br>    ├── event_time_day=2026-03-15/<br>    │   └── 00001-1-a8f3e2b1.parquet   (2 rows)<br>    └── event_time_day=2026-03-16/<br>        └── 00001-1-c7d2f4a3.parquet   (1 row)</pre><p>Let me trace the pointer chain:</p><ol><li><strong>HMS</strong> says current metadata is v2.metadata.json</li><li><strong>v2.metadata.json</strong> says current snapshot is snap-8823748... and points to its manifest list</li><li><strong>Manifest list</strong> has one entry pointing to 9f3e2a1b...-manifest.avro</li><li><strong>Manifest file</strong> has two entries:</li></ol><ul><li>event_time_day=2026-03-15/00001-1-a8f3e2b1.parquet (2 records, min event_id=1, max event_id=2)</li><li>event_time_day=2026-03-16/00001-1-c7d2f4a3.parquet (1 record, min event_id=3, max event_id=3)</li></ul><h3>Step 3: Insert more data</h3><pre>INSERT INTO warehouse.events VALUES<br>    (4, &#39;login&#39;, 103, timestamp &#39;2026-03-16 11:00:00&#39;, &#39;{&quot;device&quot;: &quot;mobile&quot;}&#39;);</pre><p>Now there’s a <strong>second snapshot.</strong> The file structure grows:</p><pre>warehouse/events/<br>├── metadata/<br>│   ├── v1.metadata.json<br>│   ├── v2.metadata.json<br>│   ├── v3.metadata.json          ← NEW (current)<br>│   ├── snap-8823748...-manifest-list.avro  ← snapshot 1<br>│   ├── snap-9912637...-manifest-list.avro  ← snapshot 2 (NEW)<br>│   ├── 9f3e2a1b...-manifest.avro           ← reused!<br>│   └── b4c8d1e2...-manifest.avro           ← NEW<br>└── data/<br>    ├── event_time_day=2026-03-15/<br>    │   └── 00001-1-a8f3e2b1.parquet<br>    └── event_time_day=2026-03-16/<br>        ├── 00001-1-c7d2f4a3.parquet<br>        └── 00002-1-d9e5f6a7.parquet        ← NEW (1 row)</pre><p>The key detail here: <strong>snapshot 2’s manifest list references BOTH the old manifest file (for the March 15 data, which didn’t change) AND a new manifest file (for the new March 16 file).</strong> Iceberg doesn’t copy or rewrite the old manifest. It reuses it.</p><p>This is how Iceberg keeps writes fast even on huge tables. Each write only creates metadata proportional to the data that changed, not the total table size.</p><h3>Column-level statistics: the hidden performance driver</h3><p>Every manifest file entry includes column-level min/max statistics. When you run:</p><pre>SELECT * FROM warehouse.events WHERE event_id = 3;</pre><p>The query planner reads the manifest files and sees:</p><ul><li>File 1: event_id min=1, max=2 → <strong>skip</strong> (3 is not in range)</li><li>File 2: event_id min=3, max=3 → <strong>read</strong></li><li>File 3: event_id min=4, max=4 → <strong>skip</strong></li></ul><p>Only one file is read. On a table with 10,000 data files, this metadata-driven pruning can eliminate 99% of file reads before touching any actual data.</p><p>This works for any column, not just partition columns. That’s a massive improvement over Hive, where predicate pushdown only works at the partition level for partition columns and at the row-group level within files.</p><h3>Snapshot isolation: how concurrent reads and writes work</h3><p>Every query reads from a specific snapshot. A SELECT statement pins to the current snapshot at the moment the query starts. If another process is inserting data simultaneously, the INSERT creates a new snapshot — but the running SELECT doesn’t see it. It continues reading from the snapshot it pinned to.</p><p>This means:</p><ul><li>No dirty reads.</li><li>No read locks needed.</li><li>Writers don’t block readers.</li><li>Readers don’t block writers.</li></ul><p>For concurrent writes, Iceberg uses optimistic concurrency. Both writers proceed independently. When the second writer tries to commit, Iceberg checks if the first writer’s changes conflict. If they wrote to different partitions or different files, both commits succeed (the second writer’s metadata is rebased on top of the first writer’s commit). If they conflict, the second writer retries.</p><p>In practice, this means you can run ETL inserts and ad-hoc queries against the same table simultaneously without coordination. Coming from Hive ACID (where concurrent writes frequently cause lock contention and timeouts), this is a relief.</p><h3>Format versions: v1 vs v2</h3><p>Iceberg has two format versions:</p><p><strong>Version 1</strong> supports append and overwrite operations. No row-level deletes or updates. Simpler, slightly less metadata overhead.</p><p><strong>Version 2</strong> adds row-level deletes (via delete files) and update operations. Supports both position deletes (marking specific rows by file + row position) and equality deletes (marking rows by column values). Merge-on-read is the default delete strategy, where delete files are written separately and merged with data files at read time.</p><p>On CDP 7.3.1, I recommend <strong>always using format version 2.</strong> The overhead is minimal, and having row-level delete capability available (even if you don’t use it immediately) avoids a painful format migration later.</p><pre>TBLPROPERTIES (&#39;format-version&#39; = &#39;2&#39;)</pre><h3>What this means for Hadoop administrators</h3><p>If you’re coming from HDFS/Hive administration, the operational model changes in two ways:</p><p><strong>Less filesystem-level management.</strong> You stop thinking about directory structures, partition directories, and file counts per directory. Iceberg manages all of that through metadata. Your job shifts from “manage files in HDFS” to “manage Iceberg table properties and maintenance procedures.”</p><p><strong>More metadata awareness.</strong> Metadata files, manifest lists, and manifest files accumulate over time. Without maintenance (which I’ll cover in Part 5), these files grow and query planning slows down. The expire_snapshots and rewrite_manifests procedures become part of your regular operational toolkit.</p><p>The tradeoff is worth it. You’re exchanging manual filesystem management (which is error-prone and unscalable) for automated metadata management (which is deterministic and self-describing).</p><p><em>In Part 3, I’ll walk through enabling Iceberg on CDP Private Cloud and creating your first tables — with the exact commands, configurations, and output from a real cluster.</em></p><p><em>All code and configurations: </em><a href="https://jaybilgaye.github.io/">https://jaybilgaye.github.io/</a></p><p><em>Follow for the rest of the series. I’m Jayprakash Bilgaye — I write about the operational side of Big Data at scale.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fee506601d76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Apache Iceberg Is Replacing Your Hive Tables (And What Took So Long)]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/why-apache-iceberg-is-replacing-your-hive-tables-and-what-took-so-long-600f2b453195?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/600f2b453195</guid>
            <category><![CDATA[icebergs]]></category>
            <category><![CDATA[apache-iceberg]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 10:30:11 GMT</pubDate>
            <atom:updated>2026-03-31T10:30:11.956Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 1 of 6 in the Apache Iceberg on CDP series</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wjErdZ-DJjLyaXRKRA53kg.png" /><figcaption>Iceberg</figcaption></figure><p>I’ve spent 15+ years managing Hadoop clusters — everything from 80-node CDH deployments to 3,000+ node HDP environments at PayPal. I’ve lived through the Hive table pain. The “someone ran DROP TABLE and deleted the actual data” pain. The “we need to change partitioning but can’t without rewriting 40TB” pain. The “there are 200,000 small files in this partition and Spark is dying” pain.</p><p>Apache Iceberg fixes all of it. And after working with it on CDP Private Cloud for the past several months, I’m convinced it’s not optional anymore — it’s the default.</p><p>This is Part 1 of a 6-part series where I’ll walk through everything: architecture, setup on CDP, time travel, schema evolution, table maintenance, and building the full Iceberg-on-Ozone lakehouse stack. All from a practitioner’s perspective, with actual commands and real output.</p><h3>The Hive table model was always a compromise</h3><p>Let’s be honest about what Hive tables actually are. A Hive “table” is a directory in HDFS. The Hive Metastore knows the schema and the partition structure, and that’s about it. The data files sitting in that directory? Hive trusts that they match the schema. It trusts that they’re in the right partition directory. It trusts that nobody went in and manually moved files around.</p><p>That trust gets violated constantly.</p><p>Here are the problems I’ve personally dealt with dozens of times:</p><p><strong>Partition management is manual and brittle.</strong> You define PARTITIONED BY (year, month, day) and now every query needs to know those exact columns. Want to change from daily partitions to hourly? Rewrite the entire table. Want to add a new partition column? Rewrite the entire table. In one project, a partition scheme change on a 12TB table took us three days of compute time and required coordinating downtime across four teams.</p><p><strong>Schema evolution is a nightmare.</strong> Adding a column to a Hive table technically works — Hive just returns NULL for old data that doesn’t have the new column. But renaming a column? Changing a type from INT to BIGINT? Reordering columns? All of these require rewriting data or creating a new table and migrating. I’ve seen teams maintain parallel tables for months during schema transitions.</p><p><strong>No reliable updates or deletes.</strong> Hive ACID transactions exist, but they’re slow and operationally complex. Running an UPDATE or DELETE on a Hive table backed by ORC with ACID enabled works, but the compaction overhead is significant and the performance penalty is real. Most teams I’ve worked with avoid Hive ACID entirely.</p><p><strong>Small files multiply endlessly.</strong> Every streaming micro-batch, every small INSERT, every failed-and-retried job creates more small files. NameNode metadata bloats, query planning time increases, and eventually someone has to write a compaction job to merge them. This is undocumented tribal knowledge at most organizations.</p><p><strong>The DROP TABLE disaster.</strong> In Hive 3.x on CDP, managed tables behave differently than they did on CDH. Dropping a managed table deletes the underlying data. I’ve seen this catch CDH-to-CDP migration teams completely off guard. More than one team has lost production data this way.</p><h3>What Iceberg actually changes</h3><p>Apache Iceberg takes a fundamentally different approach. Instead of “a table is a directory,” Iceberg says “a table is a metadata tree that tracks exactly which data files belong to this table at any point in time.”</p><p>That single architectural difference solves everything I listed above.</p><p><strong>Hidden partitioning.</strong> You don’t specify partition columns in your queries. Iceberg handles it automatically based on partition transforms (year, month, day, hour, bucket, truncate). Want to change from monthly to daily partitioning? One ALTER TABLE command. No data rewrite. Old data stays in monthly partitions, new data goes to daily. Iceberg’s query planning handles both seamlessly.</p><p><strong>Schema evolution without rewriting data.</strong> Add columns, drop columns, rename columns, reorder columns, widen types (INT to BIGINT, FLOAT to DOUBLE). All are metadata-only operations. The data files don’t change. Iceberg tracks which schema version each data file was written with and handles the mapping at read time.</p><p><strong>Snapshot isolation and time travel.</strong> Every write (INSERT, UPDATE, DELETE, MERGE) creates a new snapshot. The previous snapshot still exists. You can query data as it existed at any point in time with AS OF TIMESTAMP. You can roll back to a previous snapshot if something goes wrong. This is the feature that makes data engineers&#39; eyes light up when they first see it.</p><p><strong>Reliable updates and deletes.</strong> Iceberg supports row-level deletes and updates efficiently using either copy-on-write or merge-on-read strategies. No Hive ACID complexity. No special file formats required (though Parquet is recommended).</p><p><strong>Built-in table maintenance.</strong> Compaction (merging small files), snapshot expiration (cleaning up old snapshots), orphan file removal, and manifest rewriting are all built-in procedures you can call with SQL. No custom scripts, no external schedulers.</p><h3>Why Cloudera went all-in on Iceberg</h3><p>Cloudera’s “Iceberg Everywhere” strategy isn’t marketing fluff. They made a deliberate architectural bet:</p><p>Iceberg is supported across every compute engine in CDP — Spark, Hive, Impala, Flink, and NiFi. It works on both HDFS and Ozone storage. The Snowflake partnership (announced October 2024) uses Iceberg REST Catalog to let Snowflake query Iceberg tables on Cloudera’s on-premises Ozone storage without data duplication.</p><p>This matters because it means Iceberg is the common table format across your entire data platform. One table, readable by every engine, with consistent schema and partitioning semantics regardless of which engine wrote the data.</p><p>For Hadoop administrators, this is a significant operational simplification. Instead of managing Hive managed tables, Hive external tables, HBase tables, and Kudu tables (each with their own maintenance procedures), you’re moving toward a single table format with a unified set of management operations.</p><h3>Iceberg vs. Delta Lake vs. Apache Hudi</h3><p>I get asked this constantly, so let me be direct:</p><p><strong>Iceberg</strong> has the broadest multi-engine support. Spark, Hive, Impala, Trino, Presto, Flink, Dremio, Snowflake, BigQuery — all support Iceberg natively. It’s the most vendor-neutral option. If you’re on CDP, this is the only real choice.</p><p><strong>Delta Lake</strong> is excellent if you’re in the Databricks ecosystem. UniForm (Delta Lake’s interoperability feature) can expose Delta tables as Iceberg tables, which tells you everything about where the industry consensus is heading.</p><p><strong>Apache Hudi</strong> is strong for streaming/incremental workloads with its record-level indexing. But adoption breadth is narrower than Iceberg.</p><p><strong>Apache XTable</strong> (incubating) aims to provide interoperability between all three formats. But in practice, if you’re choosing today, Iceberg is the safe bet for multi-engine environments.</p><h3>What this series will cover</h3><p>Over the next 5 posts, I’ll walk through:</p><ul><li><strong>Part 2:</strong> Iceberg architecture — metadata files, manifest lists, manifest files, data files, and the snapshot model. With diagrams.</li><li><strong>Part 3:</strong> Setting up Iceberg on CDP Private Cloud — HMS configuration, Spark and Hive integration, creating your first tables with actual commands and output.</li><li><strong>Part 4:</strong> Time travel queries and schema/partition evolution — the features that change how you think about data.</li><li><strong>Part 5:</strong> Table maintenance — compaction, snapshot expiration, orphan file cleanup. The operational stuff nobody talks about.</li><li><strong>Part 6:</strong> Building the full stack — Iceberg on Ozone storage, migrating existing Hive tables to Iceberg, and troubleshooting.</li></ul><p>Everything will be based on CDP Private Cloud Base 7.3.1 with Cloudera Runtime 7.3.1, using real commands, real output, and real problems I ran into along the way.</p><p><em>Follow me for Parts 2–6. All code and configurations from this series are available on GitHub: </em><a href="https://jaybilgaye.github.io/">https://jaybilgaye.github.io/</a></p><p><em>I’m Jayprakash Bilgaye, a Senior Big Data &amp; Platform Engineer with 15+ years in distributed data systems. I write about Hadoop, CDP, Kafka, ClickHouse, and the operational side of Big Data at scale.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=600f2b453195" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with ClickHouse on Docker — Quick and Easy Guide for Mac Users.]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/getting-started-with-clickhouse-on-docker-quick-and-easy-guide-for-mac-users-e69dcc138c6e?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/e69dcc138c6e</guid>
            <category><![CDATA[clickhousedb]]></category>
            <category><![CDATA[clickhouse]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Sat, 09 Nov 2024 07:57:41 GMT</pubDate>
            <atom:updated>2025-05-05T10:57:03.059Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Getting Started with ClickHouse on Docker — Quick and Easy Guide for Mac Users.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZqwTALNz-Fti3HmHNzSLQ.png" /></figure><p>ClickHouse is a high-performance analytical database that’s optimized for handling large-scale data and delivering real-time insights. Running ClickHouse on Docker is a convenient way to experiment with it or even run it in production without worrying about installation complexities. This article will walk you through the process of setting up ClickHouse on Docker, specifically on a Mac using Docker Desktop.</p><p><strong>Why Use Docker for ClickHouse?</strong></p><p>Docker provides a standardized environment that makes it easy to run, manage, and scale applications. By using Docker for ClickHouse, you get the following benefits:</p><p>• <strong>Simplified Setup</strong>: No need to manually install ClickHouse or manage dependencies.</p><p>• <strong>Portability</strong>: Easily move your ClickHouse container between environments.</p><p>• <strong>Isolation</strong>: Docker runs ClickHouse in an isolated container, which helps avoid conflicts with other software on your system.</p><p>• <strong>Scalability</strong>: Docker makes it easy to scale ClickHouse instances across multiple environments.</p><p><strong>Prerequisites</strong></p><p>Before we begin, make sure you have:</p><p>1. <strong>Docker Desktop installed</strong> on your Mac. If you haven’t installed it yet, <a href="https://www.docker.com/products/docker-desktop">download Docker Desktop for Mac</a> and follow the installation instructions.</p><p>2. <strong>An internet connection</strong> to pull the ClickHouse Docker image.</p><p><strong>Steps to Set Up ClickHouse on Docker Desktop</strong></p><p>Follow these simple steps to get ClickHouse up and running in Docker on your Mac:</p><p><strong>Step 1: Pull the ClickHouse Image</strong></p><p>The first step is to pull the official ClickHouse image from Docker Hub. Open your terminal and run the following command:</p><pre>docker pull clickhouse/clickhouse-server</pre><p>This command pulls the latest ClickHouse image from Docker Hub to your local system. It may take a few moments, depending on your internet connection speed.</p><p><strong>Step 2: Run the ClickHouse Server in a Container</strong></p><p>Once the image has been downloaded, you can start ClickHouse by running it in a Docker container. Execute the following command:</p><pre>docker run -d  --name clickhouse-server -p 8123:8123 -p 9000:9000 clickhouse/clickhouse-server</pre><p>Here’s a breakdown of this command:</p><p>• -d: Runs the container in detached mode, so it runs in the background.</p><p>• — name clickhouse-server: Names the container “clickhouse-server” for easy identification.</p><p>• -p 8123:8123: Maps port 8123 on your Mac to port 8123 in the container, enabling access to ClickHouse’s HTTP interface.</p><p>• -p 9000:9000: Maps port 9000 on your Mac to port 9000 in the container, enabling access to ClickHouse’s native TCP interface.</p><p>This command starts ClickHouse and makes it accessible on your Mac. You can check if the container is running by typing:</p><pre>docker ps<br><br>(base) ~/Documents/projects/default ᐅ docker ps<br>CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                PORTS                                                      NAMES<br>c42f535fcc31   clickhouse/clickhouse-server   &quot;/entrypoint.sh&quot;         14 seconds ago   Up 13 seconds         0.0.0.0:8123-&gt;8123/tcp, 0.0.0.0:9000-&gt;9000/tcp, 9009/tcp   clickhouse-server<br>096c9142007c   louislam/uptime-kuma:1         &quot;/usr/bin/dumb-init …&quot;   12 days ago      Up 2 days (healthy)   0.0.0.0:3001-&gt;3001/tcp<br><br></pre><p>This command lists all running containers. You should see clickhouse-server in the list, confirming that ClickHouse is running.</p><p><strong>Step 3: Access ClickHouse via the Command Line</strong></p><p>You can access ClickHouse’s command-line interface by running:</p><pre>docker exec -it clickhouse-server clickhouse-client<br><br><br>Dempo Here:<br><br>(base) ~/Documents/projects/default ᐅ docker exec -it clickhouse-server clickhouse-client<br>ClickHouse client version 24.10.1.2812 (official build).<br>Connecting to localhost:9000 as user default.<br>Connected to ClickHouse server version 24.10.1.<br><br>Warnings:<br> * Linux transparent hugepages are set to &quot;always&quot;. Check /sys/kernel/mm/transparent_hugepage/enabled<br> * Delay accounting is not enabled, OSIOWaitMicroseconds will not be gathered. You can enable it using `echo 1 &gt; /proc/sys/kernel/task_delayacct` or by using sysctl.<br><br>c42f535fcc31 :) show databases;<br><br>SHOW DATABASES<br><br>Query id: 59df4917-acc9-45da-9935-a9b9db95725e<br><br>   ┌─name───────────────┐<br>1. │ INFORMATION_SCHEMA │<br>2. │ default            │<br>3. │ information_schema │<br>4. │ system             │<br>   └────────────────────┘<br><br>4 rows in set. Elapsed: 0.002 sec.<br><br></pre><p>This command opens a session inside the ClickHouse container, allowing you to interact with ClickHouse’s clickhouse-client tool directly. You can now execute ClickHouse commands, such as:</p><pre>show databases;<br><br>Demo Result:<br><br>c42f535fcc31 :) show databases;<br><br>SHOW DATABASES<br><br>Query id: 59df4917-acc9-45da-9935-a9b9db95725e<br><br>   ┌─name───────────────┐<br>1. │ INFORMATION_SCHEMA │<br>2. │ default            │<br>3. │ information_schema │<br>4. │ system             │<br>   └────────────────────┘<br><br>4 rows in set. Elapsed: 0.002 sec.</pre><p><strong>Step 4: Access ClickHouse’s Web Interface (Optional)</strong></p><p>ClickHouse provides an HTTP interface on port 8123. To access it, open a browser and navigate to:</p><p><a href="http://localhost:8123/">http://localhost:8123</a></p><p>This interface is minimal, but it allows you to execute queries directly from your browser.</p><p><strong>Step 5: Stop and Restart the ClickHouse Container</strong></p><pre>To stop the ClickHouse container, you can use:<br>docker stop clickhouse-server<br><br>Demo:<br>(base) ~/Documents/projects/default ᐅ docker stop clickhouse-server<br>clickhouse-server<br>(base) ~/Documents/projects/default ᐅ docker ps<br>CONTAINER ID   IMAGE                    COMMAND                  CREATED       STATUS                PORTS                    NAMES<br>096c9142007c   louislam/uptime-kuma:1   &quot;/usr/bin/dumb-init …&quot;   12 days ago   Up 2 days (healthy)   0.0.0.0:3001-&gt;3001/tcp   uptime-kuma<br><br><br><br>To restart it, simply run:<br>docker start clickhouse-server<br><br>Demo:<br>(base) ~/Documents/projects/default ᐅ docker start clickhouse-server<br>clickhouse-server<br>(base) ~/Documents/projects/default ᐅ docker ps<br>CONTAINER ID   IMAGE                          COMMAND                  CREATED         STATUS                PORTS                                                      NAMES<br>c42f535fcc31   clickhouse/clickhouse-server   &quot;/entrypoint.sh&quot;         6 minutes ago   Up 3 seconds          0.0.0.0:8123-&gt;8123/tcp, 0.0.0.0:9000-&gt;9000/tcp, 9009/tcp   clickhouse-server<br>096c9142007c   louislam/uptime-kuma:1         &quot;/usr/bin/dumb-init …&quot;   12 days ago     Up 2 days (healthy)   0.0.0.0:3001-&gt;3001/tcp                                     uptime-kuma<br>(base) ~/Documents/projects/default ᐅ<br><br><br></pre><p><strong>Interacting with ClickHouse: Example Commands</strong></p><p>Now that ClickHouse is running, let’s try some basic commands to interact with it:</p><p>1. <strong>Create a Sample Database</strong></p><p>Inside the clickhouse-client, create a new database:</p><pre>CREATE DATABASE test_db;</pre><p>2. <strong>Create a Sample Table</strong></p><p>Within test_db, create a sample table:</p><pre>CREATE TABLE test_db.sample_table (<br>id UInt32,<br>name String,<br>age UInt8<br>) ENGINE = MergeTree() ORDER BY id;</pre><p>3. <strong>Insert Data</strong></p><p>Add some sample data to the table:</p><pre>INSERT INTO test_db.sample_table VALUES (1, &#39;Alice&#39;, 25), (2, &#39;Bob&#39;, 30);</pre><p>4. <strong>Query Data</strong></p><p>Retrieve data from the table:</p><pre>SELECT * FROM test_db.sample_table;</pre><p>You should see output showing the data you just inserted.</p><blockquote>DEMO: Create a a table in Clickhouse.</blockquote><pre>c42f535fcc31 :) CREATE DATABASE test_db;<br><br>CREATE DATABASE test_db<br><br>Query id: a5af7e3b-f905-4fa5-a908-ade77b008862<br><br>Ok.<br><br>0 rows in set. Elapsed: 0.007 sec.<br><br>c42f535fcc31 :) CREATE TABLE test_db.sample_table (<br>id UInt32,<br>name String,<br>age UInt8<br>) ENGINE = MergeTree() ORDER BY id;<br><br>CREATE TABLE test_db.sample_table<br>(<br>    `id` UInt32,<br>    `name` String,<br>    `age` UInt8<br>)<br>ENGINE = MergeTree<br>ORDER BY id<br><br>Query id: 57db6c30-84f1-41f0-bf63-ebe22fc466fb<br><br>Ok.<br><br>0 rows in set. Elapsed: 0.007 sec.<br><br>c42f535fcc31 :) INSERT INTO test_db.sample_table VALUES (1, &#39;Alice&#39;, 25), (2, &#39;Bob&#39;, 30);<br><br>INSERT INTO test_db.sample_table FORMAT Values<br><br>Query id: 847e181d-a68e-497f-b200-ecaed8a2ba57<br><br>Ok.<br><br>2 rows in set. Elapsed: 0.007 sec.<br><br>c42f535fcc31 :) SELECT * FROM test_db.sample_table;<br><br>SELECT *<br>FROM test_db.sample_table<br><br>Query id: e78c24c7-bff4-4bfd-9c16-acdbbbd615e4<br><br>   ┌─id─┬─name──┬─age─┐<br>1. │  1 │ Alice │  25 │<br>2. │  2 │ Bob   │  30 │<br>   └────┴───────┴─────┘<br><br>2 rows in set. Elapsed: 0.009 sec.</pre><p><strong>Cleaning Up</strong></p><p>When you’re finished experimenting with ClickHouse, you can remove the container by running:</p><pre>docker rm -f clickhouse-server</pre><p>This command stops and removes the container from your system. You can always start fresh by pulling the image again.</p><p><strong>Conclusion</strong></p><p>Running ClickHouse in Docker on a Mac is a straightforward way to explore this powerful database. Docker Desktop makes it easy to get ClickHouse up and running with minimal setup, allowing you to experiment with its features and understand its performance for large-scale analytics. By following these steps, you’ll have ClickHouse ready to go in just a few minutes!</p><p>With this Docker setup, you’re ready to start using ClickHouse for high-speed analytics, whether it’s for personal exploration or integrating it into your production workflows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e69dcc138c6e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to ClickHouse — The Fast and Scalable Columnar Database]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/introduction-to-clickhouse-the-fast-and-scalable-columnar-database-4f2ec3e476a6?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f2ec3e476a6</guid>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Wed, 06 Nov 2024 11:22:22 GMT</pubDate>
            <atom:updated>2025-05-05T10:57:45.192Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction to ClickHouse — The Fast and Scalable Columnar Database</strong></h3><p>In today’s data-driven world, businesses are increasingly looking for ways to derive insights quickly from massive volumes of data. Traditional databases, while efficient for certain tasks, often struggle with real-time analytics, especially as data scales. Enter <strong>ClickHouse</strong>: a columnar database optimized for high-speed analytics. This article introduces ClickHouse, explaining what sets it apart from other databases and why it’s becoming a top choice for real-time analytics.</p><p><strong>What is ClickHouse?</strong></p><p>ClickHouse, short for “Clickstream Data Warehouse,” is an open-source, column-oriented database management system designed for online analytical processing (OLAP). Developed by Yandex, it was initially used internally for clickstream data but quickly became a popular choice for companies needing to analyze vast amounts of data in real time. Its architecture is built to handle millions, even billions, of rows per second, making it ideal for applications in industries such as finance, e-commerce, and telecommunications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZqwTALNz-Fti3HmHNzSLQ.png" /></figure><p><strong>Why ClickHouse?</strong></p><p>Unlike traditional row-based databases (such as MySQL or PostgreSQL), ClickHouse uses a <strong>columnar storage format</strong>. This design makes it particularly effective for read-heavy, analytical workloads where only a subset of columns is accessed in each query. By focusing on only the relevant columns, ClickHouse significantly reduces the amount of data read from disk, leading to faster query performance and reduced resource consumption.</p><p>But ClickHouse’s advantages extend beyond just columnar storage. Its <strong>data compression</strong> and <strong>advanced indexing techniques</strong> further enhance its performance, making it a powerful solution for real-time analytics. Companies that adopt ClickHouse often see dramatic improvements in query speed, making it easier to access insights without the delays common with traditional databases.</p><p><strong>Key Features of ClickHouse</strong></p><p>Here are some core features that set ClickHouse apart from other databases:</p><p>1. <strong>Columnar Storage</strong></p><p>In a columnar database, data is stored in columns rather than rows. This storage method is ideal for analytical queries, as it allows for reading only the necessary columns, optimizing both speed and storage.</p><p>2. <strong>Advanced Compression</strong></p><p>ClickHouse uses various compression algorithms (e.g., LZ4, ZSTD) that reduce data size and improve storage efficiency. Combined with columnar storage, this compression allows for significant reductions in disk I/O, a key factor in ClickHouse’s speed.</p><p>3. <strong>Materialized Views</strong></p><p>ClickHouse supports materialized views, which allow users to pre-aggregate data for faster access to commonly queried information. This feature is beneficial for dashboards and reports where certain aggregations are frequently accessed.</p><p>4. <strong>Data Partitioning and Indexing</strong></p><p>ClickHouse offers advanced indexing options, including sparse indexes and data skipping indexes, which minimize the amount of data scanned during a query. This design makes ClickHouse ideal for handling vast datasets and delivering consistent performance.</p><p>5. <strong>Distributed Processing and Scalability</strong></p><p>Built with scalability in mind, ClickHouse can be distributed across multiple servers, enabling horizontal scaling. This distributed architecture allows it to handle very large datasets and deliver fast query responses, even as data grows.</p><p><strong>ClickHouse vs. Traditional Databases: Key Differences</strong></p><p><strong>Feature</strong> <strong>ClickHouse</strong> <strong>Traditional Databases (e.g., MySQL, PostgreSQL)</strong></p><p><strong>Storage Type</strong> Columnar Row-based</p><p><strong>Primary Use Case</strong> Analytics, real-time reporting Transactional, general-purpose</p><p><strong>Data Compression</strong> Advanced, column-oriented Limited</p><p><strong>Scalability</strong> Horizontal scaling Primarily vertical scaling</p><p><strong>Data Consistency</strong> Eventual, configurable Strong (ACID compliant)</p><p>In traditional databases, row-based storage is efficient for transactional (OLTP) workloads where individual row operations are frequent. However, for analytical (OLAP) workloads where queries often focus on aggregating or filtering large datasets, columnar storage, like that in ClickHouse, performs better due to reduced data access and storage requirements.</p><p><strong>Use Cases for ClickHouse</strong></p><p>ClickHouse is best suited for use cases that require high-speed, real-time data analysis. Here are some scenarios where ClickHouse shines:</p><p>1. <strong>Time-Series Data</strong></p><p>For applications that handle time-series data, like IoT telemetry, server logs, and stock market data, ClickHouse is an ideal choice. Its high-speed ingestion and fast query response times make it a powerful option for tracking and analyzing data over time.</p><p>2. <strong>Event Logging and Monitoring</strong></p><p>Many companies use ClickHouse to store and analyze event logs due to its high data compression and fast read capabilities. This makes it possible to monitor user interactions, system performance, and error logs in real time.</p><p>3. <strong>Business Intelligence and Reporting</strong></p><p>With support for materialized views and pre-aggregated data, ClickHouse is well-suited for dashboards and reports. Teams needing fast data access for business intelligence can use ClickHouse to analyze large datasets without long wait times.</p><p>4. <strong>Financial Data Analysis</strong></p><p>The financial industry often requires the analysis of vast amounts of data quickly. ClickHouse’s columnar storage and advanced indexing make it a powerful tool for financial institutions looking to analyze trades, stock prices, or market trends in real time.</p><p><strong>Real-World Examples of ClickHouse in Action</strong></p><p>Many well-known companies have adopted ClickHouse to enhance their analytics:</p><p>• <strong>Uber</strong> uses ClickHouse for real-time analytics on millions of events generated every second.</p><p>• <strong>Cloudflare</strong> leverages ClickHouse to store and analyze server logs, enabling efficient tracking and monitoring of network performance.</p><p>• <strong>Spotify</strong> employs ClickHouse to manage and analyze user interaction data, providing insights for recommendations and improving user experience.</p><p>These companies, among others, have seen performance boosts by integrating ClickHouse into their analytics workflows.</p><p><strong>Conclusion</strong></p><p>ClickHouse is a powerful, scalable solution for companies seeking real-time insights from large datasets. Its columnar storage, data compression, and high-speed querying capabilities make it a standout choice for OLAP workloads. Whether you’re looking to analyze time-series data, monitor logs in real time, or power a business intelligence dashboard, ClickHouse provides a robust, efficient solution.</p><p>In the next article, we’ll dive deeper into <strong>ClickHouse’s architecture and performance optimizations</strong>, examining the key components that make it so efficient and discussing how you can leverage these features for your data needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f2ec3e476a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In the age of big data, businesses are increasingly challenged to handle large volumes of…]]></title>
            <link>https://medium.com/@jayprakash.bilgaye/in-the-age-of-big-data-businesses-are-increasingly-challenged-to-handle-large-volumes-of-d9c57bc5ea49?source=rss-2cdbc18b44ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9c57bc5ea49</guid>
            <category><![CDATA[clickhouse]]></category>
            <dc:creator><![CDATA[Jay Bilgaye]]></dc:creator>
            <pubDate>Wed, 06 Nov 2024 11:10:24 GMT</pubDate>
            <atom:updated>2024-11-06T11:23:54.399Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>ClickHouse v/s MySQL v/s MongoDB — The Fast and Scalable Columnar Database</strong></h3><p>In the age of big data, businesses are increasingly challenged to handle large volumes of information while maintaining speed, accuracy, and reliability. <strong>ClickHouse</strong>, a powerful columnar database, is quickly becoming a go-to solution for real-time analytics due to its impressive performance, scalability, and efficiency. This series will guide you through the ins and outs of ClickHouse, showing why it’s a game-changer for analytics and how you can use it to supercharge your data processing capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fNj-89Gj0i1GtK1L9z-wdw.png" /></figure><p>ClickHouse is a columnar database management system designed for high-performance data processing and analytics, distinguishing itself from other databases through several unique features:</p><ol><li><strong>Columnar Storage</strong></li></ol><p>• Unlike traditional relational databases (like MySQL, PostgreSQL) that use row-based storage, ClickHouse stores data in columns. This makes it highly efficient for read-heavy analytical queries, as only the relevant columns are read, minimizing disk I/O and memory usage.</p><p><strong>2. High-Speed Data Ingestion and Query Performance</strong></p><p>• ClickHouse is optimized for fast data ingestion and can handle massive amounts of data without significant performance degradation. It uses techniques like data partitioning, indexing, and data compression to speed up query performance, making it suitable for real-time analytics.</p><p><strong>3. Data Compression</strong></p><p>• ClickHouse uses advanced compression algorithms to store data efficiently. Its columnar nature, combined with compression, reduces storage costs and accelerates query processing by reducing the amount of data that needs to be read from disk.</p><p><strong>4. Materialized Views and Pre-Aggregation</strong></p><p>• It supports materialized views, which allow for pre-aggregating data. This is particularly helpful in use cases where aggregations are frequently queried, as it saves processing time by providing ready-to-use aggregates.</p><p><strong>5. Data Replication and Fault Tolerance</strong></p><p>• ClickHouse supports replication and sharding out of the box, allowing for horizontal scaling and distributed architecture. This improves fault tolerance and provides high availability, as data is replicated across nodes.</p><p><strong>6. SQL-Like Query Language</strong></p><p>• ClickHouse provides a SQL-like language, making it easier to adopt for developers familiar with SQL, though it includes extensions optimized for analytical workloads. This helps in performing complex analytical queries with familiar syntax.</p><p><strong>7. Efficient Use of Indexes and Projections</strong></p><p>• ClickHouse doesn’t use traditional B-tree indexes. Instead, it uses data skipping indexes and sparse indexes, which allow it to quickly locate data without scanning entire datasets. Projections (materialized data structures) further optimize queries by providing alternate storage layouts.</p><p><strong>8. Distributed Processing and Scalability</strong></p><p>• ClickHouse is designed to be distributed and can scale horizontally across multiple servers. It handles distributed queries and supports distributed aggregation, making it suitable for big data environments where scale-out architecture is needed.</p><p><strong>9. Designed for Analytical Workloads</strong></p><p>• ClickHouse is purpose-built for OLAP (Online Analytical Processing) rather than OLTP (Online Transaction Processing). It excels in scenarios where large volumes of data need to be aggregated and analyzed, such as time-series data, event logs, and business intelligence.</p><p><strong>10. In-Memory Processing</strong></p><p>• ClickHouse utilizes in-memory processing effectively, keeping frequently accessed or hot data in memory. This makes repeated queries on similar data exceptionally fast.</p><p><strong>Summary</strong></p><p>• <strong>ClickHouse</strong> stands out for <strong>real-time analytical</strong> workloads on large datasets, with <strong>excellent read performance</strong> due to columnar storage.</p><p>• <strong>MySQL/PostgreSQL</strong> are <strong>general-purpose relational databases</strong> suited for <strong>transactional (OLTP) use cases</strong> and provide robust <strong>ACID compliance</strong>.</p><p>• <strong>MongoDB</strong> is ideal for <strong>document-based applications</strong> that require <strong>schema flexibility</strong>, commonly used in web and content management.</p><p>ClickHouse is ideal for analytical use cases where read performance and high-speed data ingestion are priorities. Its design, centered around columnar storage and distributed architecture, makes it one of the best choices for real-time analytics on large datasets. However, for transactional workloads requiring strong ACID compliance or complex transactional logic, traditional row-based databases like MySQL, PostgreSQL, or NoSQL databases may be more suitable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9c57bc5ea49" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>