GRAPH.BULK endpoint to import nodes and relationships efficiently in binary batches — much faster than issuing individual CREATE queries.
Requirements
- Python 3.10 or later
- A running FalkorDB instance (see Get Started)
Installation
Quick Start
Given two CSV files —Person.csv (nodes) and KNOWS.csv (relationships) — import them into a graph named SocialGraph:
Connecting to FalkorDB
By default the loader connects toredis://127.0.0.1:6379. Use --server-url to point it at a different instance:
Key Options
Enforcing a Schema
By default the loader infers each property’s type. Use--enforce-schema (-d) when you want explicit control. Column headers must follow the name:TYPE format:
User.csv
ID, START_ID, END_ID, IGNORE, STRING, INT / INTEGER / LONG, DOUBLE / FLOAT, BOOL / BOOLEAN, ARRAY.
Bulk Updates
The companion commandfalkordb-bulk-update reads a CSV in batches and issues a parameterized Cypher query for each row — useful for incremental updates or when you want full control over the Cypher:
Note: falkordb-bulk-update commits changes incrementally. Sanitize your CSV inputs beforehand to avoid leaving the graph in a partially-updated state.
Diagnostics
Bothfalkordb-bulk-insert and falkordb-bulk-update install a SIGUSR1 handler at startup. Sending SIGUSR1 to a running loader process writes the tracebacks of all Python threads to stderr, which is useful for diagnosing hangs or unexpectedly slow loads without attaching a debugger:
faulthandler module and is only available on platforms that support SIGUSR1 (i.e., not Windows). On unsupported platforms, registration is silently skipped.
Further Reading
- GitHub repository — full CLI reference, input constraints, and ID namespaces
- GRAPH.BULK specification — technical wire-format specification for the underlying endpoint
Frequently Asked Questions
How much faster is the bulk loader compared to individual CREATE queries?
How much faster is the bulk loader compared to individual CREATE queries?
The bulk loader uses the
GRAPH.BULK endpoint to import data in binary batches, which is orders of magnitude faster than issuing individual Cypher CREATE queries. For large datasets (millions of nodes/edges), expect 10-100x speed improvements.What Python version is required for the bulk loader?
What Python version is required for the bulk loader?
The falkordb-bulk-loader requires Python 3.10 or later. Install it with
pip install falkordb-bulk-loader.How are node labels and relationship types determined from CSV files?
How are node labels and relationship types determined from CSV files?
By default, the filename determines the label or relationship type. For example,
Person.csv creates nodes with label Person, and KNOWS.csv creates relationships of type KNOWS. Use -N or -R flags to specify explicit labels/types.Can I update existing data with the bulk loader?
Can I update existing data with the bulk loader?
Use
falkordb-bulk-update for incremental updates. It reads a CSV in batches and executes a parameterized Cypher query for each row. Note that it commits changes incrementally, so sanitize your CSV inputs beforehand.What data types are supported in schema-enforced mode?
What data types are supported in schema-enforced mode?
When using
--enforce-schema, supported types include: STRING, INT/INTEGER/LONG, DOUBLE/FLOAT, BOOL/BOOLEAN, ARRAY, plus special types ID, START_ID, END_ID, and IGNORE.