r/programming • • Sep 10 '24

SQLite is not a toy database

https://antonz.org/sqlite-is-not-a-toy-database/
811 Upvotes

309 comments sorted by

View all comments

Show parent comments

-23

u/jjolla888 Sep 10 '24

coming up with your own file format vs defining your table structures is doing effectively the same thing.

where a db becomes more than a fs is in the indexing - when you need to look up your info in different ways.

33

u/itsjustawindmill Sep 11 '24

Not only indexing. Also query planning, locking (on local filesystems at least), constraint enforcement, integrity checking, schema changes… not to mention rolling your own file format is going to be either inefficient or error-prone or both, and an extra maintenance burden

11

u/SirClueless Sep 11 '24

Also: Durable writes, incremental writes, writes from multiple threads.

Even if you're not using any of the "database-y" features at all and are just treating it as a collection you can restore from disk when your application starts, it's far easier to get right than your own file format.

5

u/elsjpq Sep 11 '24

let's also include atomic updates

→ More replies (2)