I have to admit that I have been stuggling a back and forth between static and dynamic blogging in the whole 2021😁. Just before Christmas I even moved this blog back to Django as I was charmed by the added flexibility of a dynamic site.
Search can be done directly in the database, you have a nice web interface to add articles. In my quest for finding comfort in my choice I also stumbled upon an article where the author of a static generator moved back to dynamic.
The arguments are pretty logical so I was persuaded by the logic. Are static blog really less likely to get updated than dynamic ones? Are the benefits of static websites really overstated?
Just today I wanted to make a simple change to another blog writted by myself in Django. It was a very simple change to the model: I added a field published but the migration failed with the strange error:
django.db.utils.IntegrityError: (1062, Duplicate entry '0' for key 'PRIMARY')
Like why? I am not even touching the primary key. I altered the model with a new column..
After spending 1 hour or so googling + stackoverflowing I managed to remove some of the migrations but then I got another error:
django.db.utils.OperationalError: (1091, "Can't DROP COLUMN ``; check that it exists")
like really 🧐? So, as I do believe everything happens for a reason I realised that it was time to switch back to my amazing static version, powered by Saga and Vercel. So my failures and trials are to your advantage. If you are thinking to launch a static website or blog in 2022 🚀 just do it. It will work faster, better, it will be more secure and it won’t stand between your enthusiasm to update it as often as you can.
A quick list of of disadvantages in dynamic websites:
So with static you get:
In conclusion, I recommend static solutions vs dynamic ones especially for blogs and unless your site requires dynamic functionality (clearly not every site can be static 😁).
Happy development in 2022 🚀!