Hacker News new | past | comments | ask | show | jobs | submit login

With JSON/XML the app owner decides the schema of the saved file, as they should. One day Sqlite will do some perfectly fine change that’ll break people who outsource their file format to it. Own your file format!

That said there is some nuance and it depends what the user expects. Is you app more of an MSWord where people expect a format that is decades backward compatible and only changes on explicit save, or is it more like a live app with a db back end. If the latter there should be no save concept around the DB file but perhaps a backup and restore function that exports to a controlled format.




In sqlite the on-disk file format does not matter.

All that matters is that you should be able to issue sql to the sqlite embedded library and get back the results.

Freeing you from the overhead of owning (thus inventing and then maintaining) your own file format is almost the entire point of using sqlite in this manner.


It matters for 2 reasons. One, the expectation that the file changes only when you click Save is broken (as mentioned in another comment), and Two, unless you pin the version of sqlite forever then the file format may have braking changes or your need to deal with migrations.


> expectation that the file changes only when you click Save is broken

This has nothing to do with sqlite. You can have (or not have) gradual saves in any file format. It's a choice that the developers of that app made.

> file format may have braking changes

The sqlite file format is unchanged for 19 years now. A world of features and capabilities have been added since. Don't hold your breath waiting for the sqlite format to change.


This is not gradual saves. File changes when nothing has saved even, according to that comment.

Fair enough about the history of it not changing and you can always embed a frozen copy if it does. But this is a pragmatic assumption not a guarantee.


XML and JSON are for serialization. zip and sqlite, and file-system files, are for lossless persistence. They're separate issues.

An app can go bananas with serialization and use, I dunno, binary JSON or Matroska / ebml or .mp4 containers or whatever, and still serialize any way it wants.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: