Skip to main content
100%

Gist 6791729

✓ Published0🌍 Public
Aalessioalex
Last edited Sep 13, 2013
Created on Oct 2, 2013

This example demonstrates an efficient pipeline for importing a large CSV dataset into a LevelDB key-value store. It streams the 1994.csv file (5.2 million lines) through `binary-split` to separate lines without creating JavaScript objects, then groups them into 16 MB batches via `byte-stream`. Each batch is written using LevelDB's batch API (`db.batch()`), with lines stored as raw binary values under incrementing integer keys. The process avoids object allocation entirely and completes the import in roughly 50 seconds.

AI-generated description

Similar vizzes