3 ms·
I don’t use SQLite as my main data store for any project that runs on a server because a dedicated DB server has advantages. But that doesn’t mean that I don’t
by IgorPartola 6y ago
I don’t use SQLite as my main data store for any project that runs on a server because a dedicated DB server has advantages. But that doesn’t mean that I don’t use it for production use. Here is an example from a few years ago:
I needed to pull in a large dataset from CSV (several dozen gigabytes), do a bunch of transforms on it, extract a small subset of data that I actually was interested in, and load that subset into the main DB. I needed to do this in a way where it wouldn’t bog down the main DB server (which stored less data than what was in the CSVs), and also in a way where I could potentially load diffs of the CSV files as updates. So the solution was that a dedicated job would run on a server where the SQLite database was used to load the CSVs and to manipulate the data with SQL because that was way more convenient than doing it with ad hoc objects in Python. Once done, extract rows from SQLite and load into Postgres. The local DB would stick around to use the diffs for incremental updates, but if it was lost it was easy to recreate it from the last full dataset. Not highly available but highly understandably, cheap, fast, and dead simple.
- chrisweekly 6y agoSounds like a job for lnav (https://lnav.org https://lnav.org), an awesome little CLI "mini-ETL" powertool with SQLite embedded.
- porker 6y agoInteresting, have you used it for more than log file analysis? A "mini-ETL" sounds exactly what I need each week.
- chrisweekly 6y agoI technically only used it for logfiles, but as a key part of a chain of scripts / utils forming a simple custom test automation suite I cobbled together. Having done that, I'd reach for it first for any ETL-like task given structured data on the order of a few hundred thousand or maybe a few million rows.
- pablobaz 6y agohttps://duckdb.org/ https://duckdb.org/ is good for these type of tasks