DE//AGENT
Explore
Tutorial Lesson 4 of 10 · The Lakehouse Series community intermediate

ACID and concurrent writes — why compaction and ingestion collide

What ACID on object storage actually guards, and where it stops: Delta commits transactions on files, but compaction is also a writer, and the two meet in the ingestion window. Learn the schedule rule, the write-path/layout-path separation, and how a guardrail blocks maintenance from running in the wrong window.

At a glance

When Compaction and ingestion keep colliding on one table; You are writing the maintenance calendar and need the rules written down
Where Lakehouse
Why ACID protects writers from each other, but maintenance is also a writer — the ingestion window is the contract that keeps them apart.

Learning objectives

  • Say what ACID transactions on object storage guarantee concurrent writers
  • Schedule compaction outside the ingestion window and explain the contention
  • Handle a contending OPTIMIZE — compaction is additive, so halt it, no rollback

What you need

  • A Delta or Iceberg table with real ingestion traffic
  • An ingestion window you can schedule around
  • [object Object]

Steps

  1. Ground truth first: Delta's official docs cover ACID transactions on object storage, time travel, OPTIMIZE and Z-ORDER clustering, Delta Live Tables, and Unity Catalog integration. (from ref-delta-docs )
  2. The classic conflict: do not run compaction during peak ingestion — it conflicts with concurrent writers. (from skill-iceberg-maintenance )
  3. The schedule rule: compact after the ingestion window, never during it. (from runbook-small-files-explosion )
  4. The pattern behind the rule: separate the write path from the layout path — writes make many small files, scheduled compaction makes 128-256 MB files — and do it outside the ingestion window so compaction and writers don't contend. (from pattern-small-files-compaction )
  5. When contention happens anyway: compaction is additive, so there is nothing to roll back — halt any concurrent OPTIMIZE that contends with the ingestion window. (from runbook-small-files-explosion )
  6. Guardrail it: Lakehouse Guard is a Delta/Iceberg table maintenance advisor plus a guard that blocks compaction or snapshot expiry during peak ingestion windows. (from plugin-lakehouse-guard )

Check yourself

  • You can point at the ingestion window on a calendar and say when compaction may run.
  • A compaction plan issued during peak ingestion is blocked by the guard instead of executing.
  • You can explain why halting a contending OPTIMIZE needs no rollback.

Worked example

The do-not that ends most contention stories — from skill-iceberg-maintenance

Do not run compaction during peak ingestion; it conflicts with
concurrent writers.

Write path vs layout path — from pattern-small-files-compaction

writes ─▶ many small files ─▶ [scheduled compaction] ─▶ 128-256 MB files
Compact on a schedule (or auto-compact), targeting a file size that
matches your read pattern. Do it outside the ingestion window so
compaction and writers don't contend.

Sourced from

Security scan

Last sweep 2026-10-24: 0 finding(s), 0 marked as examples.

Common gotchas

  • Compaction during peak ingestion conflicts with concurrent writers — schedule it after the window.
  • ZORDER rewrites the whole table — only worth it on a real query predicate.
  • Compaction is additive: halt the contending OPTIMIZE, do not attempt a rollback.

Production considerations

  • Separate the write path from the layout path: let writers be small and fast, and let scheduled compaction own file size.
  • Enforce the window with a guardrail (Lakehouse Guard) rather than a calendar reminder.

Diagram

acid + concurrent writes
   |
   |- writes --> many small files --> peak window: writers only
   |
   |- after the window --> [compaction] --> 128-256 MB files
   |
   |- contending OPTIMIZE? --> halt it (additive, no rollback)
   |
   |- guard --> blocks compaction/expiry during peak ingestion

Registry stats

Verification community · Oct 23, 2026
Completeness 81
Trust multiplier ×1.25
Composite 34.15 · adequate
Freshness 1 days since last source check
Difficulty intermediate
Version 0.1.0
License CC-BY-4.0
Security flags none