Skip to Content

Why commit per-resource during a big database seed?

Category: DevOps & Deployment

Answer

Monolithic commits hide silent failures. Committing per customer / per account / per transaction means one bad row doesn’t abort the whole batch. The expected-vs-actual report at the end tells you exactly what survived.

Concrete examples from the fca project context

Example 1

products commit once; accounts commit per customer; transactions commit per account.

Example 2

Catches FK violations at the smallest unit.

Example 3

Variance report reads “94/100 customers, 100% products” — actionable in one glance.

Data flow / flow chart

for row in chunk: -> INSERT -> commit
  -> variance_report(expected, actual_succeeded)

Takeaway

Per-row commit + variance report = “did it really run?” without grepping logs.