Apache Hudi is an open table format and data lake platform that adds record-level upserts, deletes and incremental processing to collections of files stored in cloud object storage or HDFS. Among modern data formats, Hudi sits one layer above file formats such as Parquet and Apache Avro: it does not replace them but organizes them into transactional tables with a commit history, indexes and table services.
The name stands for Hadoop Upserts Deletes and Incrementals. Hudi was created at Uber in 2016 to keep large analytical tables fresh within minutes instead of hours, and it became a top-level project of the Apache Software Foundation in 2020. It is usually compared with Apache Iceberg and Delta Lake, the other two widely used lakehouse table formats.
How Apache Hudi organizes files into tables
Hudi turns a directory of data files into a table by maintaining a timeline of actions in a hidden metadata folder. Every write, compaction, clean or rollback is recorded as an instant with a timestamp and a state (requested, inflight or completed), and readers only see data from completed instants. This timeline provides atomic commits and snapshot isolation without a separate database server.
Data is grouped into partitions and, inside each partition, into file groups. A file group is identified by a file ID and contains successive file slices; each slice holds a base file (normally Parquet) and, for some table types, log files (normally Avro) with later changes. Because every record key maps to exactly one file group, Hudi can locate and rewrite the right file during an update instead of scanning the whole table.
The main building blocks and their roles are summarized below.
| Component | What it stores | Purpose |
|---|---|---|
| Timeline | Instants with action type and state | Atomic commits, rollback, time travel |
| Record key | Unique key per record | Identifies rows for upserts and deletes |
| Partition path | Directory derived from a field | Prunes data during queries |
| File group | Base files and log files per file ID | Unit of update and versioning |
| Metadata table | File listings, column statistics, indexes | Avoids slow object store listings |
| Precombine field | Ordering value such as a timestamp | Picks the latest version of duplicates |
Copy-on-write and merge-on-read table types
Hudi offers two table types that trade write cost against read cost. In copy-on-write (CoW), every update rewrites the affected Parquet base file, so reads are fast and simple but writes amplify. In merge-on-read (MoR), updates are appended to row-based log files and merged with base files either at query time or later by compaction, which keeps ingestion latency low.
The choice depends on the update rate and on how readers query the table.
| Property | Copy-on-write | Merge-on-read |
|---|---|---|
| Update mechanism | Rewrite whole base file | Append to log files |
| Write latency | Higher | Lower |
| Write amplification | High for scattered updates | Low until compaction |
| Snapshot read cost | Lowest, pure Parquet | Higher, merges logs on read |
| Read-optimized view | Same as snapshot | Base files only, possibly stale |
| Typical workload | Batch updates, read-heavy analytics | Streaming ingestion, frequent updates |
A MoR table exposes three query types: a snapshot query that merges logs for the freshest data, a read-optimized query that reads only compacted base files, and an incremental query that returns only records changed after a given instant. The incremental query is the feature that most clearly distinguishes Hudi from plain file formats.
Indexing, incremental queries and table services
To apply an upsert, Hudi must know which file group already contains each incoming key, and it uses an index for this lookup. Options include Bloom filter indexes stored in file footers, simple indexes that join against existing keys, bucket indexes that hash keys into a fixed number of buckets, and a record-level index kept in the metadata table. Choosing the wrong index is a common cause of slow upserts on large tables.
Hudi also runs table services that keep the layout healthy over time: compaction merges log files into new base files, clustering rewrites small files and sorts data for better pruning, and cleaning removes file slices older than the retention policy. These services can run inline with each write or asynchronously in separate jobs.
| Index type | Lookup method | Best suited for |
|---|---|---|
| Bloom index | Probabilistic key filters per file | Keys with time ordering, late updates rare |
| Simple index | Join incoming keys with stored keys | Random updates on moderate tables |
| Bucket index | Hash of key to fixed bucket | Very high write throughput |
| Record-level index | Key to file mapping in metadata table | Large tables with random upserts |
Apache Hudi compared with Iceberg and Delta Lake
All three open table formats provide ACID transactions, schema evolution and time travel over Parquet files, so the differences lie in emphasis. Hudi was designed first for record-level mutation and incremental pipelines, Apache Iceberg for engine-neutral analytics on very large tables, and Delta Lake for tight integration with Apache Spark. Interoperability projects such as Apache XTable can expose one table through the metadata of another format, which reduces lock-in.
| Aspect | Apache Hudi | Apache Iceberg | Delta Lake |
|---|---|---|---|
| Original focus | Upserts and incremental ingestion | Large-scale analytic tables | Reliable Spark tables |
| Update strategy | CoW or MoR per table | Copy-on-write or delete files | Copy-on-write or deletion vectors |
| Built-in indexing | Several index types | Statistics, no key index | Statistics, no key index |
| Change feed | Native incremental queries | Incremental scans between snapshots | Change data feed |
| Bundled table services | Compaction, clustering, cleaning | Mostly external procedures | OPTIMIZE and VACUUM |
When to choose Apache Hudi and common pitfalls
Hudi fits best when a lake table must absorb frequent updates and deletes, for example change data capture from operational databases, GDPR erasure requests or late-arriving events. Its DeltaStreamer utility, now called Hudi Streamer, ingests from Kafka or database logs with little custom code. For mostly append-only data with many query engines, Iceberg or plain Parquet may be simpler.
Most production problems come from configuration rather than the format itself.
| Symptom | Likely cause | Remedy |
|---|---|---|
| Slow upserts | Bloom index on random keys | Switch to bucket or record-level index |
| Many tiny files | Small commits without clustering | Enable clustering and file sizing |
| Stale MoR reads | Compaction lagging behind ingestion | Schedule asynchronous compaction |
| Storage growth | Retention set too long | Tune cleaner commits retained |
| Duplicate records | Wrong record key or precombine field | Redefine keys and rewrite table |
Hudi also has a steeper learning curve than its alternatives because it exposes many tuning options. Teams should treat the record key, partition path and index as long-term design decisions, since changing them later usually means rewriting the table.
In simple terms
Imagine a huge archive of folders where you can normally only add new pages. Correcting a single line would mean finding and reprinting a whole folder by hand. Apache Hudi acts like a careful archive clerk with an index card system: it knows which folder holds each record, keeps a dated log of every change, and lets you ask what changed since yesterday.
The data still lives in ordinary files, but Hudi adds the bookkeeping. The key takeaway is that Hudi lets a cheap file store behave like an updatable table.
A practical example
A regional ride-sharing operator stores about two billion trip records in cloud object storage. Trips are updated after completion when fares, tips and ratings arrive, often hours later. The data team captures changes from its PostgreSQL database with a change data capture tool, publishes them to Kafka, and uses Hudi Streamer to upsert them into a merge-on-read table partitioned by trip date, with a record-level index on the trip ID.
New changes become queryable within about five minutes, while asynchronous compaction runs every hour. Downstream finance jobs use incremental queries to read only the trips changed since their last run instead of rescanning the full history. The result is that nightly reprocessing of entire partitions disappears and compute costs for the reporting pipeline drop substantially.