QueryLite: a SQL database
A SQL database written from scratch — parser, B+ tree indexes, a query planner, joins and transactions — running live on 22,000 rows in your browser.
How it works
- 1A hand-written parser turns SQL into a syntax tree. Errors point to the exact spot: “Expected FROM near FORM”.
- 2Every index is a B+ tree. The planner picks an index lookup when a condition can use one — unless it would match most of the table, when reading every row is cheaper.
- 3Joins run as an index nested loop, a hash join or a plain nested loop, depending on what is indexed. The plan shown is the one that ran, with real row counts.
- 4BEGIN, COMMIT and ROLLBACK use an undo log, and indexes are kept in step. Your changes are saved in this browser.
More demos
All demosRaft consensus, live
The algorithm that keeps etcd and Kubernetes consistent. Five servers elect a leader and replicate a log — crash them and split the network while it runs.
Live collaborative editor
Real-time editing with no server. Three devices share a note — take one offline, edit everywhere, reconnect, and they merge. Open a second tab and it syncs live.
Split the bill
Add friends and who paid for what. Get the fewest payments that settle everyone — and copy it for WhatsApp.