Skip to content

importkit v0.3.0

Choose a tag to compare

@Rokem89 Rokem89 released this 03 Nov 11:11

ImportKit 0.3.0 adds optional byte-bounded import batches for CSV and JSON Lines, alongside the existing record-count limit.

npm install @altitud-studio/importkit@0.3.0

Supply maxBatchBytes together with a synchronous measureRecordBytes(value, context). Both limits apply; an individually oversized result fails before flushing the previous partial batch. A byte-triggered flush checkpoints only the delivered prefix, preserving a mapped record waiting for the next batch. Stable IDs, checkpoint schema and at-least-once delivery remain unchanged.

The byte budget counts the application's declared encoding size. It is not a generic JavaScript heap measurement. Keep mapped values stable until the destination finishes, and keep source files immutable. Destinations still own idempotency.

Verified file sizes and memory

Each file was fully written, then verified by exact byte count and SHA-256. The bounded destination verifier checks order, values, count and digest without retaining the dataset. It simulates destination acknowledgments; it is not a database benchmark. ImportKit checkpoints use the real filesystem.

Format Source bytes Records Importer OS peak RSS
CSV 1,000,000,000 244,141 81.91 MiB
CSV 10,000,000,000 2,441,407 85.39 MiB
JSON Lines 1,000,000,000 244,141 88.18 MiB
JSON Lines 10,000,000,000 2,441,407 81.86 MiB

Profile: Node 24.11.1, Linux x64 / WSL2, nominal 4 KiB ASCII records, maximum 1,000 records and 1 MiB measured payload per batch. Each case ran in its own 512 MiB cgroup with swap disabled; workers used 128 MiB V8 old-space. No OOM events occurred. Both formats met the preset criterion of no more than 64 MiB additional importer peak RSS from 1 GB to 10 GB.

The 1 MB and 1 GB cases ran validation and import in separate fresh processes. The 10 GB cases ran import only. One observation per case; up to two cases overlapped and filesystem caches were not cleared. Timings include contention and verifier/checkpoint overhead. These results are evidence for this workload and environment, not universal memory or throughput guarantees.

Validation and artifacts

  • Linux: 90/90 tests passed. Windows: 89 passed; the existing symlink test could not run because of OS permissions. Validation and SQLite recovery demos passed on both.
  • An external consumer installed the final tarball and passed JavaScript behavior checks and TypeScript strict NodeNext contracts, including byte limits and recovery with a pending record.
  • The aggregate checks independently rederive 201 acceptance conditions from the raw reports; all passed.
  • Attachments include all six raw reports, analysis JSON, a technical report, SVG/PNG figures, the analysis script, the npm-compatible archive and SHA-256 checksums.

The README documents time and space costs. Coordination is linear in source bytes and records plus batches, with callback and durability work accounted separately. Complete validation and import normally read 3N and 2N source bytes respectively. Recovery reparses the source. Retained measured payload can approach 2K because a full pending batch and one mapped next record may coexist; arbitrary callback-owned allocations remain outside that budget.