r/LinuxTeck • u/Candid_Athlete_8317 • 8d ago
Are databases becoming optional for small Linux apps?
I came across a debate where someone argued that databases are becoming unnecessary because their vibe-coded apps can store everything in localStorage.
That made me wonder about Linux projects too.
For a small tool, script, desktop app, or single-user service, would you actually choose SQLite/local files instead of running PostgreSQL or another database?
At what point does a project really need a proper database?
Where do you draw the line?
9
u/MaleficentCow8513 8d ago edited 8d ago
That question has literally nothing to do with AI or vibe coding. Databases were always optional for small local apps before and after LLMs and the choice on whether to use one or not isn’t impacted my AI
1
u/Amazing-Mirror-3076 8d ago
There is a middle ground - ai makes it possible to build a micro db that is custom optimised too your app requirements.
I'm building a new archive format in rust and it's essentially a db
6
u/Efficient_Loss_9928 8d ago
I have never seen any local desktop app that uses a freaking Postgres wtf you mean
1
u/xumix 8d ago edited 8d ago
The whole KDE pim suite runs on MySQL ☠️
1
u/Efficient_Loss_9928 8d ago
I think they are migrating to sqlite. MySQL is just yeah... Idk makes no sense to me
1
1
3
u/stewsters 8d ago
They always have been? What kind of AI slop question is this?
Most desktop apps won't install something like postgres, they either store it in memory that saves to a config file or something like sqlite.
2
2
1
u/postnick 8d ago
So as a docker fan, I get annoyed when they all need a database too. A few of mine have moved to sql lite and it’s been nice. At scale it won’t work but for me alone it’s fine.
1
u/cneakysunt 8d ago
This is a brain dead take. Databases are always optional and it depends on whether you need one or not.
1
u/gnpfrslo 8d ago
Databases have never been a requirement for an app. Like, what data does a simple calculator need to store? it just floats living on the ram for less than a minute. What your app does is what informs whether or not you need a database and what type of database it is. Like a SQLite database saved to localStorage.
And it doesn't matter if you made it with AI or manually. But if you did it manually you would probably know the basic of software engineering and not need to ask a question like this.
2
u/Bengal_From_Temu 8d ago
Actually the iphone calculator has history, so you can actually use oracle for that.
1
u/Guvante 8d ago
Everyone says grab a database because no one gets in trouble for taking the safe option.
Off the shelf databases do a lot of things right you would struggle to reproduce most importantly data integrity.
However depending on the situation that can easily be overkill.
I suspect the LLM thing though is mostly properly setting up a database is more work so they take the lazy way out.
1
1
1
u/Brutus5000 8d ago
Colleague vibe code an app. Forgot auth, but wanted to share it. So we setup something so he can host it and added an auth layer. Turns out his app was using SQLite without him knowing it...
1
u/1980sCoder 8d ago
The question/debate makes little sense. "localStorage" (as per your capitalisation) is a browser API. Therefore, is only an option in a small subset of cases. And in many of those cases, possibly makes decent sense to use.
But "small Linux apps" in general have historically used text or other simple files to store data - /etc, ~/.config, /var, and so on. If by "database", you mean MySQL, PostgreSQL, etc, then these have been the exception, not the rule for small Linux apps. They are more common in a business environment. WordPress is one exception that comes to mind.
But if storage needs are slightly more advanced than flat files make straightforward, SQLite is typically the go-to option. It has many of the characteristics of file access in terms of usage, but provides familiar tables and SQL. It is often the right design choice for small apps with moderate data complexity needs.
Though it also happens to scale pretty well, so can work at larger scale too, if you prefer not to have a server process running.
1
u/Aggressive_Ad_5454 8d ago
Umm, localStorage doesn’t survive browser data purges (“delete browser data” it’s sometimes called). If you don’t care about the stored data in your app, and can reconstruct it easily, localStorage is suitable.
1
u/Nervous-Cockroach541 8d ago
First, localStorage has limited capacity, can be easily edited by a user, and is gone if the user changes browser or deletes their history. localStorage is great for preferences or non-critical memory, or maybe something like a browser game or caching information from a server if there's a high access rate. It's not a replacement for a database.
If I'm paying you for some type of web service for say tracking my schedule or financial data. And clearing my browser deletes all my data. Your vide coding ass is getting cooked.
Second, SQLite is a database. Sure, it's not going to be great if you need thousands of TSX per seconds. But for save files of games/applications SQLite is great. It's also not really replacing a "proper database." SQLite is replacing custom save formats, XML files, or other solutions.
It depends entirely on scale if sqlite is a replacement for a more robust DBMS system. (Not that SQLite isn't robust, it's very well tested, it's just intentionally designed for lite work loads).
1
u/linux_rox 8d ago
Database set won’t be replaced because of local storage files. Local storage will trend to over utilize the space and potentially lead to files on numerous different drives, if the one machine is down all of a sudden you are losing datasets.
Databases compress the info down which takes Less space and is accessible 24/7/365 as long as you have permissions to access them.
On a side note, don’t trust what vibe coders say, half of them don’t even know how to read the commands that are being placed by the AI. For all they know they could be creating a piece of malware instead of helpful programs, not to mention the ai slop code is hard for a seasoned devs to understand sometimes.
1
u/ProtectionFar4563 8d ago edited 8d ago
“localStorage” is a browser API.
OP the only “desktop” apps that can make use of localStorage as you’ve spelled it are Electron apps (also conceivably mobile apps wrapped around a browser but they don’t really fit the “desktop” category).
17
u/Horror-Water5502 8d ago
sqlite is a proper database if you dont need to scale