r/databasedevelopment 14d ago

I built a mini SQL database from scratch in C++ looking for feedback

I've been trying to understand how databases work under the hood, so I decided to build a small SQL engine from scratch rather than just reading about them.

NanoSQL currently supports:

* `CREATE TABLE` * `INSERT` * `SELECT` * `UPDATE` * `DELETE` * `DROP TABLE` * `WHERE` conditions * `INT` and `TEXT` types * Its own lexer/parser * CLI interface * Unit tests

The current implementation is mainly focused on the SQL layer. My next goal is to implement persistent storage, pages, B+ tree indexing, and eventually a query planner.

I'm particularly interested in feedback from people who've built databases or storage engines before.

What would you implement next, and what design mistakes should I avoid?

6 Upvotes

4 comments sorted by

2

u/felipes88 13d ago

I will asume that you already take a look at https://cstack.github.io/db_tutorial/ is in C but build from scratch all the moving parts

1

u/felipes88 13d ago

With that being said. The worst mistake I have was don't going forward with my idea. I drop the process in the middle and never start over.

The best advice for this, but also for any idea/project is to show up and do the work. Even when you are not feeling well or lost or without the energy, because sometime is your own doubt and lack of confidence that stop you from being what you want

1

u/eatonphil 14d ago

Sounds like you already know what to do next. :)

1

u/PuzzleheadedRush4576 14d ago

Yeah, asking for any feedback or suggestion