Bulk Import (LOAD CSV / neo4j-admin import)

LOAD CSV for incremental loads, neo4j-admin import for cold-start at terabyte scale.

0/4 done

Overview

Bulk Import (LOAD CSV / neo4j-admin import)

LOAD CSV for incremental loads, neo4j-admin import for cold-start at terabyte scale.

Why it matters

LOAD CSV runs as a normal transaction (with batching via CALL IN TRANSACTIONS). neo4j-admin database import rebuilds store files from CSV at maximum speed but only on an offline DB.

Going deeper

Two import paths for two situations:

ToolRuns onSpeedUse for
LOAD CSV (with CALL { } IN TRANSACTIONS)Live DBTransaction-boundIncremental / ongoing loads
neo4j-admin database importOffline DBBuilds store files directly, fastestOne-time cold start at huge scale
LOAD CSV WITH HEADERS FROM 'file:///orders.csv' AS row
CALL { WITH row
  MERGE (c:Customer {id: row.customerId})
  CREATE (c)-[:PLACED]->(:Order {id: row.orderId, total: toFloat(row.total)})
} IN TRANSACTIONS OF 10000 ROWS;

neo4j-admin import is dramatically faster because it bypasses the transaction log and writes store files directly — but it requires an empty/offline database, so it's a cold-start tool, not a daily ETL one. Choosing it for incremental loads means taking an outage you didn't need.

Analogy

LOAD CSV vs neo4j-admin import is restocking a shop while it's open vs building the warehouse before opening day. LOAD CSV slips new stock onto the shelves during trading (a normal, batched transaction on a live DB). neo4j-admin import builds the entire store from raw materials at maximum speed — but only with the doors locked (DB offline).

Pitfalls — what breaks when this is weak

  • neo4j-admin import for daily loads. Requires an offline DB → needless outage. Fix: LOAD CSV for incremental.
  • LOAD CSV without batching. One giant transaction → heap blowup. Fix: IN TRANSACTIONS OF N ROWS.
  • No constraints before import. Creates duplicates at scale. Fix: declare uniqueness constraints first so MERGE is correct and fast.

Make it stick

Use the prompts below to anchor bulk import (load csv / neo4j-admin import) to a real graph you own.

  • Is your initial data load a one-time cold start (admin import) or ongoing (LOAD CSV)?
  • Are uniqueness constraints declared before bulk loading so MERGE stays correct?
  • Where is a LOAD CSV running unbatched and risking a heap blowup?

Reading in progress · 0 of 4 activities done