maxakawizard/json-collection-parser
memory_limit or standing up a queue worker farm?" If yes, an entire class of enterprise/partner-integration requests becomes a normal feature ticket instead of an infrastructure project.JSON_TABLE, Postgres jsonb gymnastics, S3 Select, Athena, or a DuckDB sidecar — each of which adds an operational dependency for what may be a one-off import.mongoexport dumps, vendor catalog feeds, GDPR/data-subject export processing, seeding staging from production extracts, replaying event archives, and one-off migrations where the source system only speaks "array of objects."Adopt when all of the following hold:
json_decode — a practical rule of thumb: anything above ~10–25 MB, or anything where peak memory is more than a few times the file size. json_decode needs roughly the whole document plus the decoded array resident at once.Look elsewhere when:
halaxa/json-machine, which also offers a writer and far broader adoption) is usually the better-fitting and better-supported choice for line-delimited feeds.json_decode plus array_chunk is simpler, has zero dependencies, and will not be slower in any way that matters.Non-negotiable evaluation gates regardless of choice: measure peak RSS and throughput on a real 100 MB+ sample; confirm behavior on a truncated or malformed file (partial writes into your database are the real failure mode — plan idempotency keys or checkpointing); confirm it plays nicely with queue worker timeout/maxExecutionTime; and add counters (records processed, bytes read, duration) before the first production run.
For executives: We have a recurring class of requests — "import this large vendor/legacy export" — that currently either fails on memory limits or gets scoped as an infrastructure project. This MIT-licensed library lets us process arbitrarily large JSON files with flat memory, so those requests become normal feature work. Cost is zero in license terms and roughly a day of engineering to integrate; the risk is contained because we wrap it behind our own interface, so replacing it later is a one-file change. The trade-off is that it is a small, single-maintainer open-source project — appropriate for a parsing utility, not something we should build a platform on.
For engineering: It is a streaming reader for a top-level JSON array of objects with a callback/iterator-style API — constant memory, no ext-* tricks, no framework coupling. It is not Laravel-aware and not a document model: you get record-in, callback-out, which is exactly the shape our import pipeline wants. Two asks: (1) put it behind an adapter so we can swap to a more widely-adopted streamer if we later need NDJSON or a writer, and (2) treat malformed-input behavior and queue timeouts as part of the integration, not an afterthought — streaming imports fail midway, so define idempotency and progress reporting up front. Before committing, benchmark peak memory and records/sec on a real production-sized sample and compare against json_decode at our actual p95 file size; if the files are small, we should just use the standard library and save ourselves the dependency.
How can I help you explore Laravel packages today?