An ORM that does not need a database
24 May 2026
DB/JSONDB lets a model run on a plain JSON file. One model, one table, one file, and the rest of the ORM does not notice.
The reason it works is a small one: JSON.result implements enough of PDOStatement to be indistinguishable from one. fetchAll, fetchObject, FETCH_KEY_PAIR, FETCH_CLASS combined with FETCH_UNIQUE. Because the model layer only ever talks to that interface, full CRUD, filters and the record cache work unchanged on top of flat files.
static DB => %JSONDB(data.'poll.json')
One line on the model, naming its file. That is the whole switch, and it is what the tour on this site runs on, which is also the best argument for it: a demo app that needs no database server is a demo people can actually run.
The design settled the same day it landed. It began as a directory of tables inside one store and became one file per model, because a file per table is the thing you can inspect, copy, diff and delete by hand, which is most of the value of using files at all. Writes take LOCK_EX.
The limits are stated rather than papered over: no joins, no transactions, no schema introspection, and the IN list matching has a documented restriction with commas and quotes. It is for small, mostly-read datasets, and it says so.
Engine 1.0. See JSONDB in the manual.