Poem: SQLite ain't bad
SQLite is not so bad It has a couple perks But so does every other file — Be sure to use what works
With all my recent mentions of SQL, the title may seem clickbait-y or a little tongue-in-cheek, but I mean it: SQLite is not all that bad.
How did I come to this new conclusion? I read an article of course. It speaks about some of the superpowers of SQLite and to be honest, I was impressed. Here are a few:
- Data is stored on a single file. (I've always known this, but the article reminds me of how big of advantage it is.)
- Data access is relatively fast when compared to the file system.
- It uses weak typing, making it throw errors less and easier to adapt by beginners.
- It accepts JSON now.
- There is a workaround for its read/write locking nowadays.
However, with all that said, I still believe that we have to choose the tools we use carefully. SQLite would not always be the best solution; sometimes a simple text/JSON/CSV file would suffice. Every situation should be carefully examined before you make a decision.
Moreover, most of the time the decision you make can always be changed; there are many ways to convert SQLite data to other forms and vice versa.
For me, I will stick to using the file system for most of the websites I run, since I don't have a lot of files to store. However, for my clients that I design websites for, I most likely would use SQLite as it makes the development process a little easier. I get the added benefit that all their data is in a single file. (It sounds kinda eerie if I keep repeating that to myself.😨)
Bottom line? Use what you need when you need it.