A reusable framework for large CSV imports and exports
I designed and implemented a reusable framework for large CSV imports and exports. It uses streaming, partitioned processing and persistent checkpoints to limit memory use and support recovery after interrupted processing. It handles hundreds of thousands of records, whether CSV rows or MongoDB documents, on workers limited to 400 MB of memory or less.
How it moves the data
CSV or MongoDBimport or export
Streaminglimits memory use
parts, one after another
Part 1Part 2Part 3
Checkpointspersistent
Supports recovery after interrupted processing
Swipe to see the full diagram
At a glance
- Worker memory
- 400 MB or less
- Volume
- Hundreds of thousands of CSV rows or MongoDB documents
- Sources
- CSV files and MongoDB
- Uses
- Streaming, partitions, checkpoints
- Recovers
- From the first unfinished part