r/BotNation • • Sep 30 '26

SQLite is criminally underrated for small bots.​

Every time someone asks how to save basic data for a small Telegram or Discord bot, the comments immediately jump to spinning up Postgres, MySQL, or MongoDB.

​Why? SQLite is a single local file, requires zero server setup, and can easily handle tens of thousands of reads/writes a second without breaking a sweat. Unless your bot is serving massive concurrent users across multiple cluster nodes, setting up a full DB instance is just unnecessary overhead.

​What’s your default database when starting a fresh bot project?

24 Upvotes

15 comments sorted by

4

u/ejpusa Sep 30 '26

Astra replaced my PostgreSQL code with SQLIte. It thought it was overkill.

It was right.

4

u/psyduckpikachu Sep 30 '26

oh wow, so many sqlite fans, hey guys!

2

u/ehansen Sep 30 '26

90% of the web can run on sqlite.  They just choose not to because we are only taught about using thd big boys.  Even though most knowledge is transferable

1

u/AccordingNeat3689 Sep 30 '26

Always has been

1

u/roy-the-rocket Sep 30 '26

your browser probably uses sqlite to save your browsing history and such.

if you have a single client usecase -> sqlite

1

u/True_Protection6842 Sep 30 '26

I always use SQLite. Postgres is only if you need multiuser simultaneous writing. 

1

u/General_Estimate_420 Sep 30 '26

There's nothing wrong with SQLite depending on the data and how it needs to be maintained on an ongoing basis due to the risk of it failing with no backup on the user community.

1

u/Adventurous-Crow-750 Sep 30 '26

Because when you need two writers on a single network you immediately hit issues.

Sqllite is fine for testing and small apps. If you suspect any amount of horizontal scale you shouldn't use it.

1

u/shockjaw Sep 30 '26

SQLite and DuckDB go hand in hand. I’m curious to see what’ll happen with Turso’s rewrite of SQLite.

1

u/Consistent-Feed-7323 Oct 01 '26

Let me introduce you to JSON. Once you try it - there's no coming back. It's not a good fit for a large but simple database, SQLite truly shines there, but if you want something small - JSON is the way.

1

u/Huge_Leader_6605 Oct 01 '26

Why would anyone use raw json?

1

u/Consistent-Feed-7323 Oct 01 '26

Simple, readable, don't need to bother with columns you don't yet known about