4 ms·
I am not sure how this differs from a static site generator that also has some backend functionality? E.g. I've seen static sites with server-side search etc,
by mattlondon 3y ago
I am not sure how this differs from a static site generator that also has some backend functionality? E.g. I've seen static sites with server-side search etc, comments systems etc which submit each post/comment as a separate flat file and then regenerate static pages automatically from those etc.
Is it more that your approach stores stuff in sqlite and builds from that, rather than markdown files? That seems to be the only meaningful difference I can see compared to normal static sites with backend/server-side functionality?
- simonw 3y agoIt's a variant on that pattern. The key idea here is that your server-side stuff is completely read-only - so comment systems aren't supported - because the server-side data is treated as a deployment asset. Have you used platforms like Vercel? Their one big limitation is that you can't use persistent storage with them - if you want to talk to a database of some sort you need to add an extra database vendor. The baked data pattern works around that by bundling read-only data (usually a SQLite file) with your deployment.
- mattlondon 3y agoOh ok so you still have a "dynamic" site that is database driven, but that database is read-only and stored in a pre-generated sqlite file that is deployed with the rest of the site assets? I don't want to piss on your parade here - perhaps I just don't get this pattern - but isn't this all of the downsides of a dynamic site but without any of the benefits? You are still running slow server side stuff that relies on doing per-request database stuff and all the complexity and security headaches that go along with it (upgrading PHP or Wordpress or whatever), but with none of the benefits of server side functionality and databases (i.e. it is all read-only).
- simonw 3y agoI talk about the benefits of the approach in quite some detail here: https://simonwillison.net/2021/Jul/28/baked-data/#benefits-of-baked-data https://simonwillison.net/2021/Jul/28/baked-data/#benefits-o... - does that help clarify?