r/lua • u/COLDWAR_1980 • Aug 28 '26
I wrote an RDBMS engine 100% from scratch in pure Lua (B+Trees, WAL, Postgres wire protocol, S3 storage)
Hey r/lua!
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.luaand connect withpsql) - Native JSONB operators (
details->'address'->>'city') - Foreign Keys with
ON DELETE CASCADEandALTER TABLEmigrations - Master-master cluster replication with hinted handoff
Check out the GitHub repo: https://github.com/jncastilho/luadb
Would love to hear your thoughts and feedback!
9
Upvotes
2
u/DestroyedLolo Aug 28 '26
Link broken.
37
u/K4milLeg1t Aug 29 '26
Ah yes I too put emojis and other unicode symbols in my code and write an entire RDBMS in 3 commits. This was vibe coded from the bottom to the top.
Also 1 day account age and no post history doesn't help with the credibility.
21
u/Lagger625 Aug 29 '26
Is it vibe-coded?
4
u/sozesghost Aug 30 '26
Sloppity slop.
1
u/ACRM64 Sep 02 '26
Does it work?!
-4
u/Snoo28720 Aug 29 '26
Maybe switch to c or Odin
-5
u/AutoModerator Aug 28 '26
Hi! It looks like you're posting about Roblox. Here at /r/Lua we get a lot of questions that would be answered better at /r/RobloxGameDev or the Roblox Developer Forum so it might be better to start there. However, we still encourage you to post here if your question is related to a Roblox project but the question is about the Lua language specifically, including but not limited to: syntax, language idioms, best practices, particular language features such as coroutines and metatables, Lua libraries and ecosystem, etc. Bear in mind that Roblox implements its own API (application programming interface) and most of the functions you'll use when developing a Roblox script will exist within Roblox but not within the broader Lua ecosystem.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.