Storage of the blog articles
For those using a RSS reader, subscribe here: rss.xml
The infrastructure behind this website is kept relatively simple to other modern websites.
In the early days of this website, about five years ago, it had a mongodb database for the blog articles. It made a request to that database each time someone was trying to access a blog article. Quickly I figured out that static was the way to go, which removed much of the complexity and made the infrastructure almost boring in a good way.
Do I miss the database?
Recently I looked at SQL again, and wondered what tools I would use in a larger project. One need that can be overlooked is the need for proper migration tools. For personal projects that I only use myself, it does not matter if it is offline for a while to migrate some data manually.
But I wanted to dive more into modern tooling, because for other projects I was used to schema migration frameworks. One language I had not tried that in yet was Rust.
In Rust there is Diesel, which comes with a CLI for exactly this migration management. I used it in combination with a PostgreSQL database and DBeaver for viewing the database. The getting started guide has an example on a blog demo, which is why I mention it here.
When I was done with that guide I had a piece of software that I could use for this personal website. So it left the question, should I actually integrate it into the website?
The filesystem is enough
To spoil the conclusion, I did not change the original infrastructure to have a database (again). As an exercise, I did make a migration script that could read all the blog posts into the database.
The purpose of the database would mainly be for backups of the original posts. Which is currently already possible by just copying the entire posts folder with the org and generated html files.
Other reasons for just using the file system is that there is no business logic to the blog posts. The guide mentions a boolean field for publishing or not, which I currently implement by drafting a post and not generating the html yet. And the volume of blog posts is relatively small, even if it were to become thousands of articles it would not be an issue. So the conclusion is that, while I briefly missed the database, that I stick to the filesystem.