# LuaDB: A pure Lua embeddable SQL database for game save files, state tracking, and cloud sync

> Source: <https://dev.to/cold_war/luadb-a-pure-lua-embeddable-sql-database-for-game-save-files-state-tracking-and-cloud-sync-l0p>
> Published: 2026-08-28 23:39:58+00:00

Wanted to share a project I've been building called LuaDB: a lightweight, zero-dependency embeddable database system written in pure Lua.

Why pure Lua? Cross-platform embedding without needing C bindings or compiling native SQLite shared libraries (great for LÖVE, Roblox, OpenResty, or embedded devices).

What it includes:

Full B+Tree index engine on 4KB slotted binary pages

Write-Ahead Logging (BEGIN, COMMIT, ROLLBACK)

Native PostgreSQL wire protocol gateway (run luajit bin/luadb_server.lua and connect with psql)

Native JSONB operators (details->'address'->>'city')

Foreign Keys with ON DELETE CASCADE and ALTER TABLE migrations

Master-master cluster replication with hinted handoff

Check out the GitHub repo: [https://github.com/jncastilho/luadb](https://github.com/jncastilho/luadb)

Would love to hear your thoughts and feedback!
