Hacker News new | ask | show | jobs
by pscanf 457 days ago
Hurray for this approach! I want most software that works with my personal data to work like that. And I'm actually working on a hobby project to make it possible: a local database + platform to run "local" apps on it.

I haven't gotten to implementing the data layer yet, but my idea was indeed to go for "simple files in folders". But I'm wondering, what format should I use for files containing structured data used by a specific app? For a photo app, using image formats is the obvious and easy choice. But what about, for example, a meal tracking app? What file format would you use to store nutrition facts about a certain food?

My first thought is JSON, but that's not really user-friendly. For a non-technical user a JSON file is basically useless without the app that generated it. YAML is maybe a bit less cryptic for a non-technical user, but still mostly useless. A TXT with a specific, more user-friendly format? Then you risk the app breaking because the user changed its content. And still, as a user what would I do with a bunch of TXT files containing nutrition facts? Without the app that generated them, there's a high chance they become useless.

My project also wants to solve that issue actually, ensuring that you always retain access to the apps that generated those files. But I would love to find a way to store data so that it keeps being useful and accessible even "app-less".

1 comments

IMO the best file format for this set of requirements is SQLite. It's the world's most widely deployed database engine, the file format is simple and the spec is public domain. The entire database engine has been re-implemented in multiple languages. SQLite is a "recommended storage format"² (along with XML, JSON, and CSV) of the library of congress because of it's long term sustainability, among other factors³.

1. https://sqlite.org/mostdeployed.html 2. https://sqlite.org/locrsf.html 3. https://www.loc.gov/preservation/digital/formats/fdd/fdd0004...