by stuckinhell · 3y ago · 0 comments
Edit: Since I got extremely downvoted for this comment. Here is why:
You should use static site generators for new blogs in 2023.
Performance: Static sites typically load faster than database-driven ones.
Security: Without a database, the risk of SQL injection attacks is eliminated.
Scalability: Static sites can handle high traffic without complex hosting solutions.
Maintenance: No database means fewer maintenance tasks and potential failures.
Hosting and Costs: Static sites often have cheaper and more flexible hosting options.
Decoupled Architecture: Modern trends prefer separating frontend and backend, reducing the need for databases.
Development Simplicity: Static site generators offer a straightforward content writing environment.
Backup and Portability: Static sites are easier to backup and migrate.
Edge Hosting: Static sites benefit from faster load times with distributed hosting solutions.
Source: the fastcomments docs, blog, and several of my sites are SSG. I don't like it anymore.
I'd call the let's-insert-an-unnecessary-database-here outlook the crazy thing. Not to mention, basically a violation of the Principle of Least Power <https://www.w3.org/DesignIssues/Principles.html#PLP>.
K. Ignoring that...
None of those are prerequisites. They're not listed by the author of the post linked here as among the features that he considers "essential for a blog in 2023" (nor are they even present on the Datasette Cloud blog that is the subject of the post), and it's not a "crazy optimization" to not go out of your way to introduce them.
(Is he, in your view, not actually running a blog?)
Plus tag pages, archive-by-date-pages, series pages and more.
I don't particularly want to have to wait for all of that to build!
It also offers faceted search against all of that, powered by PostgreSQL: https://simonwillison.net/search/?q=static%20site%20generato...
I use SQLite FTS for full-text search (it’s the only non-static endpoint).
A full site re-render on a Raspberry Pi takes 5 minutes, and a full reindexing - FTS plus linkmap - plus publishing around 10, but I only do that yearly or when I update things like CSS, layout, etc.
It all runs off a Git hook, uses SQLite to hold all the FTS, base HTML and metadata, and is as asynchronous as can be (including my own asyncio blob upload library). Costs me effectively zero.
That said, personally, I love PG and enjoy using a DB. But I can see pro's to both sides.
Code: https://github.com/hparadiz/technexus/blob/release/public/js... https://github.com/hparadiz/technexus/blob/release/public/js...
IMHO, it's true that a static site generator should be the way to go in 2023, instead of using a web framework with a db.
I am personally running a hugo blog, on netlify, with netlify CMS. I have 0 costs, great performances, everything needed out of the box. What else to ask for ?
Also, for a company blog, an SSG likely means a requirement to know Git, which could be inconvenient.