Part 16 / Topic 1 of 6
Why better-sqlite3: the same evidence DESIGN-NOTES.md already used
This course's own design notes picked better-sqlite3 over an ORM before a single line of Stage 4 code existed, on npm view-level evidence: better-sqlite3's latest dist-tag was a stable 13.2.0 with no pre-release markers, while prisma's latest tag was a release candidate (8.0.0-rc.36) with a 8.1.0-dev.* train already publishing behind it. Installing it for real today reproduces the same version and the same clean result:
$ npm install better-sqlite3
added 2 packages, and audited 367 packages in 4s
found 0 vulnerabilities
The installed package's own README.md states the specific reason a synchronous driver is the right fit for a single-process SQLite file, not merely "simpler to write":
"
node-sqlite3uses asynchronous APIs for tasks that are either CPU-bound or serialized. That's not only bad design, but it wastes tons of resources. It also causes mutex thrashing which has devastating effects on performance."
And its own benchmark table (same README) backs this with real numbers: a single-row get() is 11.7x slower on sqlite3/sqlite than on better-sqlite3, and inserting 100 rows in a transaction is 15.6x slower. SQLite itself only ever has one writer at a time, file-locked — wrapping that in an async API doesn't buy real concurrency, it just adds a promise and an event-loop round trip around work that was going to serialize anyway. The same README is equally honest about when this stops being true: "If you expect a high volume of concurrent writes (i.e., a social media site)... you should probably use a full-fledged RDBMS" — this course's guestbook, and the QuickCart capstone after it, are both well inside the "fine" side of that line.
Done here? The practice set for Part 16 — including the solutions — is on the part page.