r/programming • u/StellarNavigator • Sep 10 '24
SQLite is not a toy database
https://antonz.org/sqlite-is-not-a-toy-database/255
u/Apoema Sep 10 '24 edited Sep 10 '24
I am a data scientist. I use a bunch of datasets that are mostly read only and infrequently used I found that the simplicity and flexibility of sqlite is a lot better for me than using something like postgresql.
181
u/keepthepace Sep 10 '24
I think it was SQLite's author who was saying that there is a misunderstanding about his lib. It is not a competitor to DBs like MySQL or postgres, it is a competitor to open(...) and file IO.
SQLite is not a database, it is a lib to do SQL requests to a local file.
DBs handle concurrency and this is their main feature and their main problem. SQLite does not handle it and does not care. And neither should you if you only have one user at the time.
63
u/anti-state-pro-labor Sep 10 '24
This is a great call-out and fits with how I understand SQLite. It's a wrapper over a file that just so happens to be a SQL interface. Glad to hear it's not far off from the intent of the lib!
38
u/xebecv Sep 10 '24
SQLite allows multiple processes safely write to the database (provided file locking works properly) and it provides atomic transactions using journaling, allowing for process crash resilience, so it's pretty much a database - not just "a lib to do SQL requests to a local file". What it lacks is the ability to be a distributed database. Backups, synchronization and failovers are on you
13
u/Kaelin Sep 10 '24
SQLite does not support parallel writes.
8
u/crozone Sep 11 '24
No, but it locks the database for you so that they're serialised safely.
2
u/MaleficentFig7578 Sep 11 '24
Remember to set
pragma busy_timeout = 5000;or so. Otherwise the transaction will fail immediately if a lock is already held.1
-1
u/keepthepace Sep 10 '24
Do you have a source for that? Last time I checked, it provided no such guarantees and one had to provide concurrency manually or accept that no reads could happen to the DB while a write was going on.
And I do think concurrent writes are a big no?
2
u/MaleficentFig7578 Sep 11 '24
It uses locks to ensure concurrent transactions are safe. However, one still has to wait for another to finish. They do not execute concurrently. You may need to restart the transaction if you get SQLITE_BUSY due to deadlock.
2
u/alwon1s Sep 11 '24
Last I was looking at it I believe it could do concurrent writes but you had to explicitly configure it. I believe it worked by creating temp files is the same directory that then would be added to the main file opportunisticly or when closed
21
u/tom-dixon Sep 10 '24
DBs handle concurrency and this is their main feature and their main problem. SQLite does not handle it and does not care.
That's false.
https://www.sqlite.org/draft/faq.html#q5
Q: Can multiple applications or multiple instances of the same application access a single database file at the same time?
A: Multiple processes can have the same database open at the same time. Multiple processes can be doing a SELECT at the same time. But only one process can be making changes to the database at any moment in time, however.
SQLite uses reader/writer locks to control access to the database.
...
However, client/server database engines (such as PostgreSQL, MySQL, or Oracle) usually support a higher level of concurrency and allow multiple processes to be writing to the same database at the same time. This is possible in a client/server database because there is always a single well-controlled server process available to coordinate access. If your application has a need for a lot of concurrency, then you should consider using a client/server database. But experience suggests that most applications need much less concurrency than their designers imagine.
They also have WAL-mode, which allows really fast operation when there's many concurrent readers and writers. Orders of magnitude faster than
fopen()with manual locking.2
u/keepthepace Sep 10 '24
OK, I remembered concurrent writes were not possible, but looks like it handles that more gracefully than I thought. Still I don't recall it was possible to have different applications write concurrently on the same file? Is it handled correctly? (And by that I just mean that a locking is happening automatically and that transactions wont leave the DB in a corrupt state?)
13
u/tom-dixon Sep 11 '24
Yes, the database file is locked during writes by default on every OS that supports it. It's borderline impossible to leave an SQLite database in a corrupt state, no matter what you do.
Their test suite includes tests for IO errors, power loss, file system damage, out-of-memory situations, hard drive errors, etc.
https://www.sqlite.org/testing.html
SQLite is used in the flight control system of the Airbus A350, and NASA uses it in on several space crafts. It's extremely robust and reliable.
6
u/casualops Sep 11 '24
Yes absolutely SQLite handles locking across process boundaries. So multiple processes can write to the same SQLite file and SQLite will take care of synchronization.
5
u/Apoema Sep 10 '24
I do believe that is the case and for a long time I was naively trying to use postgresql for one of my large datasets, it was a pain to setup and almost every time I was going to use it postgres had updated and nothing was working properly, it was also a pain to backup and restore.
I finally resolved to just use sqlite and break the database up in different files depending on years and that basically solved all my problems.
3
u/PabloZissou Sep 10 '24
What problems did you face setting up PSQL? I run it in a few production systems with a basic setup and has no problem running some few thousand concurrent users.
3
u/Apoema Sep 10 '24
It was mostly because I used only sporadic, so I forgot about all the psql commands when I was back to it and I didn't do the proper maintanaince. I use arch so by the time I went back to postgres arch had updated it and it was imcompatible with my dataset, I had to then downgrade postgres and/or dump and restore it.
It was my fault, I did things I shouldn't have done. But it was because I wasn't in it to have a proper database server all I really wanted was a database to do sporadic select queries.
2
u/tom-dixon Sep 10 '24
Administrator@MyPC:~/AppData/Roaming/Mozilla/Firefox/Profiles> \ > find . -iname \*.sqlite | wc -l 1491Firefox uses the same approach. They make hundreds/thousands of slqlite databases in the user's directory. Every site's persistent data is stored in an sqlite database. They have separate databases for cookies, bookmarks, preferences, navigation history, form history, etc.
1
u/GaryChalmers Sep 12 '24
If you compared it to what Microsoft offers than Postgres is like SQL Server while SQLite is more like SQL Server Express LocalDB. SQL Server Express LocalDB is a solution for local storage like what would be used in a desktop application.
1
u/boomybx Sep 11 '24
SQLite is not a database, it is a lib to do SQL requests to a local file.
Great line. Never thought about it this way.
29
u/TheBananaKart Sep 10 '24
Pretty much my goto unless I know something will have a-lot of concurrent users. Works really well for a sales-estimation app I’ve made for work since I don’t have the bother of dealing with IT just put the file on a shared drive and alls good. Also works great for data logging for industrial applications, used in a few SCADA projects.
6
u/syntaktik Sep 10 '24
How are you handling the concern in the FAQ: https://www.sqlite.org/faq.html on section 5? No concurrency issues at all?
24
u/TheBananaKart Sep 10 '24
Simple we have like 3 engineers, normally only one is estimating at a time 😂 GO and my setup makes it fairly trivial to migrate the DB to something like postgres if it becomes an issue.
3
u/Herover Sep 10 '24
The same faq claims that it's thread safe, so as long as you don't have multiple separate processes writing simultaneously you'll be fine.
9
u/syntaktik Sep 10 '24
Different threads would only matter if on the same machine. If the database file lives on a network share, then according to the FAQ you'd be at the whims of your NFS implementation or Windows cooperating. This guide looks pretty dated though; one would think modern operating systems have this figured out by now.
4
u/tom-dixon Sep 10 '24 edited Sep 11 '24
This guide looks pretty dated though
It's not really dated, last modified on 2023-12-22 14:38:37 UTC .
one would think modern operating systems have this figured out by now
File locking on network drives is just a bad idea with a lot of security, stability and performance concerns. It's avoided on purpose for good reasons.
SQLite is extremely reliable and resilient, it's the only database certified for use by NASA in space, where they need to be able to handle stuff like bits getting flipped on drives or RAM by radiation.
2
1
u/myringotomy Sep 10 '24
Most people would need multiple processes accessing the data though. For example an analytics dashboard or some process that moves the data to a warehouse or whatnot.
3
u/tom-dixon Sep 11 '24
https://www.sqlite.org/faq.html#q5
Q: Can multiple applications or multiple instances of the same application access a single database file at the same time?
A: Multiple processes can have the same database open at the same time.
→ More replies (2)1
u/MaleficentFig7578 Sep 11 '24
Sqlite is safe for concurrent use, but implements it with a lock, so there is no actual concurrency and writers take turns. Shared drives may break locking and corrupt the database.
1
u/Habba Sep 11 '24
If you say concurrent users, what do you mean? Concurrent users of an API that uses SQLite as its database is only 1 "user", the API. SQLite is perfect in that scenario.
If you have multiple services that need to access the same DB, then you should probably not use it.
29
u/JustFinishedBSG Sep 10 '24
You need to try duckdb
3
u/darkcton Sep 10 '24
We're likely going to try it soon. Is it good? How easy is it to host?
11
u/FujiKeynote Sep 10 '24
DuckDB is insanely good. To me, they've ticked all the checkboxes for what makes a piece of software great. Self-contained, smart design choices, great language bindings, and zero fluff.
A lot of it feels like magic, and part of that magic is in the fact there's no bloat and no added complexity to the stack. I actually have had legitimate use cases for extremely wide tables (bioinformatics at scale, you have like 60k genes in rows and an arbitrarily large number of datasets and samples in columns) and DuckDB chews through it like a champ.
And no need to think about your indexing strategy! Well, I guess almost no need—it does support explicit indexing—but for the vast majority of cases it "just works."They also hit 1.0 recently, I can't name a reason not to use it.
13
u/longshot Sep 10 '24
It's the OLAP answer to SQLite
It is awesome
11
u/TryingT0Wr1t3 Sep 10 '24
What's OLAP here?
19
u/longshot Sep 10 '24
So really it's just column store instead of row store. So if you're doing aggregates over lots of data DuckDB will win but if you're trying to pluck individual rows (like finding a customer record) you'll find that SQLite wins.
So yeah, no OL.
2
u/jbldotexe Sep 10 '24
So is it good to have both available in your enterprise? I can imagine plenty of scenarios where I would want the two pretty interchanging depending on what queries I'm throwing at it?
I'm sure the response will be, "they can both do that thing but one works better for the other scenario than the other one"
So my question is: Is this beyond simple configuration inside the program itself?
I feel like I'm not asking the right question(s) but hopefully you can parse what I'm trying to ask
→ More replies (1)6
u/sib_n Sep 11 '24 edited Sep 11 '24
SQL database workloads are often divided in two categories, OLTP and OLAP.
OLTP:
Online Transactional Processing.
Fast atomic changes of records, for example INSERT/UPDATE/MERGE the value for specific primary keys.
This is the main orientation of traditional databases like MySQL, PostgreSQL and SQLite.
They are mainly designed for single machine and rely on indexes for optimization.
This is the typical design adapted to handling a payment service transactions.
OLAP:
Online Analytical Processing.
Long running queries performing aggregations over a large number of rows, for example COUNT GROUP BY.
This is the typical use case for data analytics. For example: how many new paying users today?
This the main orientation of distributed SQL databases, historically the Hadoop ecosystem, now all kinds of cloud SQL like Amazon Redshift and Google BigQuery and more.
Optimization is generally more complex, there's Hive style partitioning, clustering/bucketing, columnar file formats and other details specific to the tools. That's an important part of the job of data engineers.
Until DuckDB, having a proper OLAP database meant using those distributed tools that are either hard to deploy like Hadoop or expensive like cloud SQL, similarly to the situation for small OLTP workloads before SQLite when you had to bother with deploying a proper database to use SQL.
Now DuckDB provides you a great in-process solution for OLAP workloads. It is not distributed, but it has the other optimizations that were made for OLAP, so if your need is not huge, it should work. Additionally, a single machine processing power has increased a lot since when Hadoop was designed 15 years ago, so workloads that used to require Hadoop at this time can probably run fine on DuckDB on a beefy VM for a fraction of the complexity of Hadoop. This last point is described in this DuckDB blog: https://motherduck.com/blog/big-data-is-dead/.
P.S.: Since Hadoop, there's continuous work to close the gap between OLTP and OLAP. OLAP solutions are getting more OLTP features like transaction isolation (Apache Hive ACID) and UPDATE/MERGE capacities (Apache Iceberg). There are also databases providing both engines at the same time. I guess than in the future, you will not have to bother with this choice anymore and the database automatic optimizer will make the smart choices for you like it already does for SQL execution plans.
2
1
3
u/leros Sep 10 '24
I build small mostly read-only datasets (< 100MB). I'll put them in sqlite and even commit them to git alongside my code.
1
107
u/EmergencyLaugh5063 Sep 10 '24
I worked at a company that stored hard drive backups in a sqlite database. What originally started as a quick way to get the product to market turned into a 10+ year abusive relationship.
I have a lot of respect for sqlite as a result. It processed enormous amounts of data and we were often limited more by just the speed of our drives than the database technology.
However, before adopting it developers should carefully consider what their long-term plans are. If they predict constant growth and a need to scale their solution then sqlite may not be the best solution and I would recommend just biting the bullet and going with something that has scaling in mind from the start.
For example:
At that company we reached a point where we needed concurrent access because we needed to start separating workloads amongst different processes. So we enabled WAL mode. At the time WAL mode was still kind of new so it's probably a lot better now, but we started to run into pretty big issues with checkpointing not working. This resulted in .wal files growing to sizes far larger than we were comfortable with and then when we finally forced a checkpoint the database would become unusable for long periods of time while it tried to process the large .wal file. WAL mode is simply not a solution to the concurrent access problem, it's more of a workaround and it comes with some additional costs to consider.
3
Sep 11 '24
Why is it so hard to migrate a database? Isn't it just
go offline mysqldump ... > db.sql CREATE DATABASE db mysql ... db < db.sql go online?
89
Sep 10 '24
Sharded SQLite is very common for systems that require embedded data stores. It’s far from a toy, it was also designed for computerized missiles
54
u/avdgrinten Sep 10 '24
I'm a bit confused by the title. Why would it be a toy?
sqlite is the right solution if you need the processing offered by a database (say, CRUD operations, ACID semantics, queries) but you don't need a remote database because only a single service will ever connect to it anyway.
55
u/kherven Sep 10 '24
Some people who have worked exclusively with the "big" databases are sometimes horrified to see SQLite being used. It hits their ears the same way "We use a text file for our database" might to yours.
Of course that isn't a fair assessment, but I'm assuming that's the kind of person the article's assertion is trying to get through to.
20
0
u/dagopa6696 Sep 10 '24
I think they're horrified when they see that most of what they do for a living can be made irrelevant.
5
u/MaleficentFig7578 Sep 11 '24
SQLite has its limitations. Big databases are still relevant.
1
u/dagopa6696 Sep 16 '24 edited Sep 16 '24
Doesn't explain why the big database people freak out when they see SQLite. SQLite has more deployments than any other db engine in existence, by the way. The question is why people freak out when they learn about this and write lots of butthurt comments, not about whether or not "Big Data" is still relevant.
→ More replies (2)→ More replies (1)2
14
u/Weird_Suggestion Sep 11 '24
Here is what SQLite authors have to say about when and when not to use SQLite. https://sqlite.org/whentouse.html
10
u/gnahraf Sep 10 '24
Yes. Also used at scale as units of sharded data both locally (e.g. on Android) and in the cloud (e.g. a db per user to store "user-state" on a game app or platform.) The sharding can be applied in other areas too. E.g. a db per game instance where players take turns to play. The basic requirement for such scaling is that the data flow is organized in such a way that there is at most one writer per db.
2
u/turbothy Sep 10 '24
(e.g. a db per user to store "user-state" on a game app or platform.)
Ooh. Neat idea.
2
u/Fabiolean Sep 11 '24
Web browsers do stuff like this. Use unique SQLite databases for each site you visit to store cookies and user data and more
8
u/FJ_Sanchez Sep 10 '24
It's getting trendy lately with projects like Turso (libsql) and LiteFS. There are also rqlite and Litestream. I recommend reading this https://fly.io/blog/all-in-on-sqlite-litestream/
10
u/hudddb3 Sep 10 '24
rqlite[1] creator here, happy to answer any questions.
4
u/FJ_Sanchez Sep 10 '24
You compare it to multiple other projects in the FAQ but not to Turso DB, how are they different? What do you think of libsql?
3
14
u/wvenable Sep 10 '24
I don't think of it as a toy but I find the fact that (almost) everything is a string to be somewhat toy-like.
8
u/sidneyc Sep 10 '24
Well that's just not true. SQlite has a bunch of supported types.
11
u/wvenable Sep 10 '24 edited Sep 10 '24
That article describes the issue even better. "Flexible typing" for serious projects is not my jam.
→ More replies (8)8
u/Mognakor Sep 10 '24
Thankfully it supports strict tables as of November 2021
4
u/wvenable Sep 10 '24 edited Sep 10 '24
That's great but it's also a bit of mess. And it still only supports the meagre set of SQLite data types.
6
u/Takeoded Sep 11 '24 edited Sep 11 '24
SQLite is a perfect tool for you
$ sqlite3
SQLite version 3.45.1 2024-01-30 16:01:20
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE tbl(str STRING);
sqlite> INSERT INTO tbl VALUES('0123');
sqlite> SELECT * FROM tbl;
123
sqlite> My biggest issue with SQLite is that the default affinity type is NUMERIC, it should have been "BLOB".
... used to have 3x of these retarded sqlite behaviors where data would be silently corrupted with no warnings/errors but I can't find my notes :( this is the only one I remember off the top of my head.
Remember one of the SQLite developers saying "we can't fix that now, it would break backwards-compatibility", though. As in, "we can't fix silent data corruption now, it would break apps that rely on silent data corruption."
Edit: found another one!
$ sqlite3 '' "SELECT 'foo' || x'00' || 'bar'" | wc -c
4
(it should have been 7)
sqlite3 '' "SELECT '123'" | wc -c
4
(it should have been 3)
$ sqlite3 '' "SELECT x'00'||'123'" | wc -c
1
(it should have been 4)silent data corruption righ there. Data integrity is not important for SQLite 😔
5
u/Bognar Sep 11 '24
Thanks for this, it was my experience as well. Everyone goes on about performance and reliability, but I find it hard to care when there are basic problems with correctness.
I've used SQLite with wrapper libraries that try to account for these quirks and make it invisible to your chosen language, but I still worry about edge case correctness problems leaking through the abstraction.
28
u/garfield1138 Sep 10 '24 edited Sep 10 '24
We have all been there. "It's just a small project and SQLite will suffice" and 3 days later we're migrating to MariaDB/PostgreSQL.
58
u/vanKlompf Sep 10 '24
We have also been in „make it future proof, use enterprise Postgres”. And project is dead after 3 days
9
u/tothatl Sep 10 '24
Whenever feature creep starts going towards sharing the sqlite database state, the migration should be planned.
If it's not, get away from that rat hole.
3
u/bwainfweeze Sep 11 '24
So here's the trick that most of us miss out on.
Expensive changes that have to be made to retain your existing revenue stream tank your company, and generally negatively affect morale of the people who pay attention.
Expensive changes that have to be made to attract or retain new revenue are costs of doing business. There's new money to pay for the new work. I was about to say, "this is fine" but even I don't entirely believe that. This can be fine. Some people call these, "good problems to have".
"Oh no! We have so many customers we need to upgrade our database so we can keep raking in cash hand over fist! Anyway..."
4
1
8
u/tothatl Sep 10 '24
It's also pretty darn fast.
You can feed it tables of millions of rows and do queries that would bring a lesser professional DB to its knees.
1
u/donatj Sep 11 '24
a lesser professional DB
I guess name the "lesser db". FoxPro or Bento? Sure.
Every time I've migrated from sqlite to mysql or mssql it's been for performance and the gains have been decent , even with the database running on the same machine
-1
u/garyk1968 Sep 10 '24
Not really. I worked in the city for 7 years in finance, we were building reg reporting repositories using mssql. Typical throughout was 10-15 million records per day…that need to be stored for 7 years. Not hating on SQLite as it’s awesome but mssql/oracle/postgresql would easily handle this volume.
13
u/bwainfweeze Sep 10 '24
I worked in the city for 7 years in finance
You are not the target audience for this thread. There's a giant space between 'not a toy' and 'golden hammer'.
1
u/tothatl Sep 10 '24
Sure, but it's probably significantly pricier to get such a DB server up and running, unless you have already a powerful server only needing to install the software.
I'm not telling a professional DB server isn't an advantage. I'm telling that among the options for running locally and cheaply with sizeable data sizes, sqlite is among the best.
1
u/MaleficentFig7578 Sep 11 '24
So, 40 billion records in total. sqlite can handle it although you'd be looking at migrating off it.
1
u/anacrolix Sep 11 '24
Yeah that's a big ask for SQLite. It can do it but it will hurt.
1
u/MaleficentFig7578 Sep 11 '24
It works fine, but you're likely to run into bottlenecks getting the data in and out, and you're likely to want more advanced management tools that more advanced databases give you.
2
u/LIGHTNINGBOLT23 Sep 11 '24
One of the biggest issues I have with SQLite is that it doesn't support compressed rows/columns by default (not the same as entirely compressing and decompressing the whole database file). There's only a few half-baked extensions to do this, and then there's ZIPVFS which is offered by the SQLite developers, but you have to pay $4000 for it.
→ More replies (2)
2
u/Carighan Sep 11 '24
SQLite is not a toy database
That's just what a toy database would say! 😑
Jokes aside, I feel people aren't all that often even in this situation. I can count on one hand the times I had to introduce a new database without the decision having already been made by some circumstance or another.
2
5
u/scottix Sep 10 '24
I don't think anyone considers it a toy. It depends on the use case and how you plan to use it.
1
3
Sep 11 '24
I think the name is the problem. To me, “lite” makes me think “less than” or “not as good”, which I guess I’ve seen in other products that have been marketed as “lite”.
4
u/MaleficentFig7578 Sep 11 '24
But it is lite. It's very simple, a drop-in library, no complex administration, and with fewer features.
2
u/PabloZissou Sep 10 '24 edited Sep 10 '24
"This is a myth. In the write-ahead log mode (available since long ago), there can be as many concurrent readers as you want. There can be only one concurrent writer, but often one is enough."
That might be the case for some types of applications and very specific ones but that sounds like strong biased information, from that point on how can I know if the rest of the claims are accurate?
SQLite has its uses but it is not useful for everything.
1
1
u/Drakonluke Sep 11 '24
I manage a postgresql database with about a dozen tables and a few hundred records. At this point using postgres seems excessive to me and this post was very convincing. It's important data, but it will never reach millions of rows (it's an IT Hardware, Network and consumables management app for my work). How can I convert the database to sqlite?
1
u/bulletrhli Sep 11 '24
In our case we are adding roughly 3 to 5 million rows a year right now, with the possibility of increasing. We thankfully don't have a lot of traffic but the data is really important to retain long term for analysis. We just use mariadb, mostly due to familiarity. Not quite sure what the best case for us is. We maintain two databases with a total of maybe 10 tables but they are just densely packed. We will never have to change the amount of columns, and we have a decent index setup for our queries but by no means perfect.
1
u/nesh34 Sep 11 '24
So I'm a bit out of the game with respect to starting new professional projects, as I've been in big tech for 6 years.
Please correct me on the following understanding:
If you want an online transactional database that you may want to scale in future, use PostGres.
If you want an offline database (that for example lives on the client device), use SQLLite.
1
u/ElMachoGrande Sep 11 '24
Yep. Sometimes, small and simple is what is needed.
The same goes for Access. I've used Access a lot for single user desktop application with small (say, a few GB) databases, and for "database on file server" applications with few (2-3) users. I only use the database, I build front end in other tools.
I think the problem is that people tend to think in human scales. "My customer database is huge, it has thousands of customers!", when not even millions would count as anything but a small database.
Being able to install a program without having to add a database service, just a database file and some DLLs is a great thing in many cases.
1
u/ProjectInfinity Sep 11 '24
It's a decent database but I really dislike writing applications using it. It's just harder than it should be to avoid concurrency locking issues.
1
u/HoratioWobble Sep 11 '24
I use it for isolation applications and mobile apps quite often. Never had any issues. Never understood the hate for it to be honest.
If you have local, relational data, why wouldn't you?
1
u/audentis Sep 11 '24
I find it funny to say: "When you are [Role], [Technology] is perfect for you". Where's the use case in this consideration?
SQLite is great and I love it, but literally the first statement in the article is something I deeply disagree with.
1
u/Voidrith Sep 11 '24
I have a service that reads in a lot of metrics / telemetry data from a lot of different customers and needs to keep them isolated from eachother due to the wild differences in structure. Every customers dataset is a series of sqlite files, while all the administrative/orchestration is in a single big postgres db
sqlite is great for what i need it for. Its not perfect for everything.
1
u/st4rdr0id Sep 11 '24
100% of the interviewers for backend positions I've encountered don't acknowledge this. Having worked mostly in mobile development, I've worked with ORMs and SQL a lot, and that experience apparently doesn't count as real experience.
1
u/hughk Sep 11 '24
If you use the Adobe product Lightroom for photographic image management and processing uses SQLite. You can even do your own queries in it. The problem is that it isn't designed for multiuser.
1
u/The-Dark-Legion Sep 11 '24
You lost me on "Native JSON". If you store JSON documents in a relational database, you did something wrong along the way.
Normal forms, people. If your data doesn't conform to a schema, you chose the wrong technology!
1
1
u/anacrolix Sep 11 '24
I built this on SQLite, give it a spin (C, Go and Rust bindings provided): https://github.com/anacrolix/possum
1
u/TCB13sQuotes Sep 11 '24
I just want Wordpress to officially support SQLite out of the box. Will work fine for 70% of the WP websites out there.
1
u/crusoe Sep 11 '24
For embedded tough to beat,
But SQLITE is pretty loosey-goosey when it comes to enforcing data types.
Oh, they finally added datatype enforcement in 2021. Cool
1
u/00nu Sep 12 '24
SQLite for simplicity, speed and maintenance.PG when tcp connections are needed (instead of api calls?!)
1
u/AbbreviationsFlat976 Jul 31 '26
Everyone talks about SQLite as the "little guy" of the bunch—and in a way, it is. But people also mistakenly assume that companies with fewer than 50 employees don't exist; there are companies whose databases barely reach 100 MB. There are scenarios where the requirements are simple: a local database for fewer than 10 users that works without an internet connection.
1
u/wjrasmussen Sep 10 '24
Look at that, SQLite is all grown up and out on the town.
Now go get your shinebox.
1
1
u/New_Computer3619 Sep 11 '24
Look left and right around you. If you see an electronic device like your phone, your security camera or even your car, it’s more likely than not that this device use SQLite.
0
u/Aedan91 Sep 10 '24
As is the case with 90% opinionated posts in this community, the answer is "it depends". It's certainly a toy for some use cases, it's more than enough for others.
→ More replies (1)
0
u/2urnesst Sep 11 '24
I’m actively using SQLite in production and haven’t found a reason to get off of it yet, especially with LiteFS
607
u/bastardoperator Sep 10 '24
I keep trying to push SQLite on my customers and they just don't understand, they think they always need something gigantic and networked. Even when I show them the performance, zero latency, and how everything is structured in the same way, they demand complexity. Keeps me employed, but god damn these people and their lack of understanding. The worst part is these are 2 and 3 table databases with the likelihood of it growing to maybe 100K records over the course of 5-10 years.