I feel this article misses out on "why". I tend to store stuff as csv or json, then slurp it into python to operate on it. It's not clear what benefit putting your csv into sqlite gets you, from this article.
An sqlite db file is probably as light as your json or csv AND better formed/typed
A Minimalist Guide to SQLite
11–20 of 127 posts
Re: A Minimalist Guide to SQLite
#12Earlier quoted context omitted.
An sqlite db file is probably as light as your json or csv AND better formed/typed
It’s easier to compare it to CSV than JSON, because the former is tabular while the latter can have deep imbrications that aren’t well represented in SQL(ite).
Re: A Minimalist Guide to SQLite
#13Earlier quoted context omitted.
An sqlite db file is probably as light as your json or csv AND better formed/typed
It’s easier to compare it to CSV than JSON, because the former is tabular while the latter can have deep imbrications that aren’t well represented in SQL(ite).
Of course, SQLite can also emulate a key-value store quite well, with a table with 'key' and 'value' columns.
Re: A Minimalist Guide to SQLite
#14Earlier quoted context omitted.
It’s easier to compare it to CSV than JSON, because the former is tabular while the latter can have deep imbrications that aren’t well represented in SQL(ite).
Can but probably won't.
Re: A Minimalist Guide to SQLite
#15Earlier quoted context omitted.
Can but probably won't.
You don’t need to go deep: `{"name": "Bob", "hobbies": ["soccer", "cinema", "music"]}`. That’s 3 tables in SQL(ite): one for the people; one for the hobbies; and one to join both.
Re: A Minimalist Guide to SQLite
#16Re: A Minimalist Guide to SQLite
#17Earlier quoted context omitted.
You don’t need to go deep: `{"name": "Bob", "hobbies": ["soccer", "cinema", "music"]}`. That’s 3 tables in SQL(ite): one for the people; one for the hobbies; and one to join both.
Not an SQL expert but pretty sure two tables joined together is extremely normal and well represented in RDBMS
If you needed it all in one flat table for some reason, SQLite supports views.
Re: A Minimalist Guide to SQLite
#18My understanding (although I can no longer find the page in the sqlite3 docs) was that because of caching, using :memory: is unlikely to make much difference in practice.
Re: A Minimalist Guide to SQLite
#19SQLite is one of the best pieces of software I have used in my career as a developer. It is performant, reliable, simple and consistent. There is a reason sqlite3 is deployed in so many places.
I mean Postgres is a fine piece of software but if your website gets 500 visits a day, you don't need Postgres; just use SQLite.
Re: A Minimalist Guide to SQLite
#20Earlier quoted context omitted.
It’s easier to compare it to CSV than JSON, because the former is tabular while the latter can have deep imbrications that aren’t well represented in SQL(ite).
I'd argue that the more large/complicated/nested the JSON structure, the more it would benefit from using a "real" database instead of a JSON file sitting on disk. If not SQLite due to document-relational mismatch, then LevelDB, RocksDB, or one of the other embedded key-value stores. Of course, SQLite can also emulate a key-value store quite well, with a table with 'key' and 'value' columns.