2 ms·
One big advantage is in publishing data online: that as one of Datasette's key original features, and it's something I use constantly: datasette publish ve
by simonw 4y ago
One big advantage is in publishing data online: that as one of Datasette's key original features, and it's something I use constantly:
datasette publish vercel til.db --app simon-tils
It can deploy databases directly to Cloud Run, Heroku, Fly and Vercel. It can cost pennies per month depending on database size and traffic.
My https://til.simonwillison.net https://til.simonwillison.net site (and many other sites I run) is deployed like that, using GitHub Actions: https://github.com/simonw/til/blob/81fdedb8e9b047cb059ef22c600b95f6f6ef9c73/.github/workflows/build.yml#L83 https://github.com/simonw/til/blob/81fdedb8e9b047cb059ef22c6...
See also the baked data pattern where I talk about this kind of deployment in a lot of detail: https://simonwillison.net/2021/Jul/28/baked-data/ https://simonwillison.net/2021/Jul/28/baked-data/
For ad-hoc data analysis - assuming you already know your way around PostgreSQL - your pgAdmin in Docker solution is hard to beat.
How often do you create a new database?
My favourite thing about working with SQLite is that the overhead of new database creation is equivalent to the overhead of creating a file. In a given day I might casually create dozens of new databases, then throw away most of them. I never found myself doing that with MySQL or PostgreSQL.
- sally_glance 4y agoThat publish command looks sweet! For confidential data I'd have to setup some integration with our infra to get the required access control though. Maybe rather go with the package option using docker and a pipeline that deploys to our k8s where I could handle auth using an existing proxy... My current workflow doesn't really involve creating databases, I mostly just create foreign tables, normal tables and views in a default DB. From time to time I then just dump-backup everything away and start fresh. Thanks for the response and your tools in general though, I liked how everything just worked when I tried it :-)
- simonw 4y agoFor confidential data you could use one of the plugins that add authentication - datasette-auth0 or datasette-auth-github or datasette-auth-passwords are options there - but yeah, you're probably better off deploying to internet hosting if you already have an auth proxy setup somewhere.
- sally_glance 4y agoOh wow thx for the pointer, I overlooked those. For business I would need a more generic oauth- or saml-based one to work with our Keycloak, but for quick private/hobby sharing the password one looks perfect.
- simonw 4y agoMeant to say internal hosting, not internet hosting.
- kreelman 4y agoYour preaching to the choir Simon. ...But the tenor ...whose pitch is a little off... up the back, Is listening even though he's heard it before :-) I think the ability to so quickly create and consume an SQLite DB is one of the big advantages here. I need to use bigger DBs like PostGres and MSSQL (in previous roles) for bigger tasks, but SQLite is down there with fopen in terms of time to create a DB. I find myself imagining schemas for problems that I'd like to put into SQLite and possibly DataSette. Thanks for making DataSette Simon.