3 ms·
And, at the same time, it's a very underused piece of tech Every time you think you need a custom file format for a given piece of software... you most likely
by outworlder 6y ago
And, at the same time, it's a very underused piece of tech
Every time you think you need a custom file format for a given piece of software... you most likely don't. Just use SQLite. You can use the standard OS file Open/Save dialog box and users will never know the difference.
Yes, that means you now have to write SQL statements to manipulate your data. But that also means that you can get lots of complicated data structures on disk and can manipulate them easily, even outside your own software - just fire up the sqlite CLI and point to your file. There are GUIs as well.
Things like UNDO/REDO can also be had almost trivially (see https://www.sqlite.org/undoredo.html https://www.sqlite.org/undoredo.html)
Sometimes this also means you don't need an external RDBMS even for web apps. I've seen so many apps which co-locate a small database in the same box that might as well have been a single sqlite file. I'm actually maintaining one right now that, although relatively important, will only ever be a single box. But sqlite wasn't 'enterprisey' enough, had to use PG. For a couple of tables.
https://www.sqlite.org/whentouse.html https://www.sqlite.org/whentouse.html
Subscribe for my next rant on another underused piece of tech... Lua :)
- nneonneo 6y agosqlite3 is now very heavily used in the Apple ecosystem - all of Core Data is built on it, and many of Apple’s own apps use it to store all kinds of data. It’s a godsend for tinkerers like me too - just point the SQLite CLI at one of the internal DBs (like the Photos database) and all sorts of cool stuff comes spilling out. For on-disk document storage I think Apple mostly uses a mix of plain folders with magic extensions (“packages”) and ZIP files nowadays, although there are definitely a lot of exceptions. SQLite isn’t that great for binary blob storage (relatively speaking) so a folder structure is still more useful there, IMO.
- cryptonector 6y agoSQLite3 is one of the most widely used pieces of software ever. Every browser, every mobile OS, many many apps, all use SQLite3. It is absolutely essential.