Coding & More 📱 Apps ℹ️ About
From Jamstack to Django
31-Aug-2021 - #jamstack #django
Since quiet a bit of time I am writing this article not on a code editor but on a form inside a cozy admin section. A bit like the web used to be and, for some large parts still is. The few readers of this blog will know that I experimented by changing the backend (and often the frontend) many times. I genuinly believe that the only way to know a bit more abotu a technology is to try it and this blog has always been the ideal playing field.
For the past months I enjoyed the benefits of Jamstack and still manage several sites using Nextjs or HTML static pages created with one of the many generators.
A static website presents several benefits: security, cheap to host and deploy, often with zero configuration. Cloudflare pages, Vercel and Netlify do offer reliable and (in some cases) totally free hosting for your static website. Using a "monolithic" system makes almost no sense nowadays.
Until it does: in my case I already had a system available and I invested many hours in learning to code that it almost made no sense to stay in a Jamstack static website. In practice I also found the following downsides:
1) Unless you use and online based CMS (e.g. Forestry or ButterCMS) you are stuck in editing files manually whenever you want to make an update. Which means also linking images by hand✍🏻 (which will translate in less content, trust me).
2) The CMS for a static website is yet another moving piece and often is not free 💸;
3) ☁️Delivering your site on the Edge - in a number of distributed servers on the cloud - has several benefits but if you site is not that big latecy is not a major issue. Or if it is you can always use cloudflare or cloudfront to cache your pages;
4) Static generators are not all that simple. If you use a system like Gatsby or Nextjs you need to deal with the learning curve of react and, something I despise, the impossibility to edit HTML templates as you can easily do on Django. To me the web starts with HTML and CSS and if your framework/fancy generator/platform doesn't let me deal with plain HTML in templates then no. Just no. 🙅🏻♂️
5) My latest static site generator (in Swift) was wonderful but...you had to write Swift to generate HTML. So as above no. 🙅🏻♂️
6) Where is the fun ? You can launch your site in minutes using Netlify, Vercel, or Github pages but where is fun in coding your own solution and messing with the webserver configuration files? 😁
7) Where is my site? 🕵🏻♂️ if you deploy through one of the major providers your site is everywhere and nowhere. In the ☁️ but where ? Perhaps this is not important but there is something conceptually beautiful 🧖🏻 in knowing where all your files are, how they are deployed to your visitors and how to handle them!
8) Limitations: 🧟♂️ no matter what you can't run a fully fledged website on a Jamstack. Yes you can use an external database in the cloud like Fauna or even KV cloudflare. You can use serverless functions but in the end a complex system (or even not that complex, just with users and authentication) will inevitably results in more moving pieces.
This doesn't mean that Jamstack is not great. It is a great solution to many people especially if you don't plan to update your pages that often. I am still using for some apps micro-sites. I don't need to updated them often and it is perfectly fit for purpose. But also "older" systems like Django have several benefits. You know where your site is, you control your files, you control your database.
You can develop almost anything you want without an external service (subscription here, subscription there 💳) but setting it up and maintaing the system comes at a cost too. Perhaps an higher cost than any Jamstack deployment (you can't beat free) but so far I am happy of my move. As a site note formatting all these markdown files can be a real pain. With a database backend you can just export all your data, import it in another table and you ready to go!
Let's see if I will change my mind again 😁