r/lua • • 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.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

Would love to hear your thoughts and feedback!

9 Upvotes

30 comments sorted by

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? 

24

u/zeroxff Aug 29 '26

100% pure slop.

Written in less than a day, the entire repo has literally 3 commits.

The author (the Reddit account is less than a day old) has absolutely no clue about what they're doing.

Maybe they are simply trolling.

1

u/TomatoCo Aug 29 '26

At least it has tests. Tho I'd like to see a script that fires some standard test suites from outside the project against this. I don't trust LLM stuff when the bot writes both the implementation and the tests.

2

u/zeroxff Aug 29 '26

honestly i see no reason to trust it too.

it's like asking a big tobacco company if the cigarettes are good for your health

-3

u/jimmiebfulton Aug 29 '26

What qualifies as vibe-coded? Do you distinguish between that and agentic engineering?

1

u/TomatoCo Aug 29 '26 edited Aug 29 '26

It's how much you write the business logic. Agentic uses of AI are more likely to be vibe-coded. Whereas, if you give a bot an interface you wrote and tell it to make an implementation using (for example) a particular HTTP library, that's not vibe-coded.

-2

u/[deleted] Aug 31 '26

[removed] — view removed comment

1

u/TomatoCo Aug 31 '26

I feel like I'm misunderstanding your point because I'm about to explain what business logic is? But in case I'm not, here we go.

By business logic here I mean the actual concerns of your application. If you're making a game and have the agent write the gameplay, that's vibecoded. But if it writes the networking or save serialization or the OpenGL, that's not the main thrust of the project and so that part, while important, doesn't matter so much to the core of what you're making. You could hypothetically swap the sound engine for a dozen different implementations and not notice any changes to the game itself.

0

u/[deleted] Aug 31 '26

[removed] — view removed comment

2

u/TomatoCo Aug 31 '26

Okay I really hate to do this but I'm just gonna link the Wikipedia article for Business Logic. https://en.wikipedia.org/wiki/Business_logic

-1

u/[deleted] Aug 31 '26

[removed] — view removed comment

1

u/TomatoCo Aug 31 '26

Yes, it is clear we're not talking about the same thing. You don't know what business logic is, after all. If you think you know it better then I encourage you to correct Wikipedia, the free encyclopedia that anyone can edit.

0

u/[deleted] Sep 01 '26

[removed] — view removed comment

→ More replies

-15

u/SoCalSurferDude Aug 29 '26

Does it matter? Lua is such an easy language for AI, so I have switched to generating all of my Lua code using AI.

19

u/hawhill Aug 29 '26

It is a bad faith false lead to write “I wrote” when that is not true at all.

-2

u/SoCalSurferDude Aug 29 '26

True, he should have said: "I designed ...." assuming he used AI.

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.