Of Pelicans and Clouds
Thrift for solo operators
My monthly hosting bill for running this website has hovered around $0.52 for the past couple of years. The way I do it is an example of how I’m trying to survive without a conventional job while keeping my people and the cats fed. Especially the cats.
This is a short one but it contains a couple of tips for the shrewd ones and may save you some green.
Ancient blogger on the loose
I began to share my thoughts on the web in 2004, around the time the world replaced the verb write with blog, and like most early adopters I started with Movable Type and moved on to WordPress soon after. Throughout the years and depending on the projects I was working on I migrated to other content management systems, like Drupal, and later developed a blog application using Python and Django, like everybody else into publishing and web frameworks.
Along the way I tried many hosting options, from crappy boxes running Apache at home to very expensive dedicated servers, and eventually settled for a few years on a setup running off two AWS Linux instances with Nginx and Gunicorn behind a load balancer and a PostgreSQL database for about fifty dollars a month. And it was just fine until the containers revolution knocked on my door and then I had to configure a few Docker images and put everything inside a Kubernetes cluster to get some of that automation and fault tolerance everybody was speaking of. Just like that I had passed the hundred-dollar mark in monthly hosting costs. I was content and twelve hundred down a year.
But I didn’t do all of that just to serve my prose to a few visitors, no, this has always been my playground, the space where I tried different web development and infrastructure ideas. No matter if it’s writing, making music, programming or taking photos; it’s all an experiment all the time and you must keep on learning. It’s not wasting time and money—it’s evolving and adapting.
And now that I’m using those chops and experience to bootstrap an application and continue the exploration into fintech and Web3 I’ve decided it’s time to return to the basics—and the cheapest—for this writing corner of mine.
I’m going static.
The careful management of resources
I’ve reserved the esoteric knowledge and expensive resources for my more complex projects and got rid of unnecessary complexity and migrated to a static website generator, Pelican, for this blog.
These changes have helped me to reduce the monthly cost from a little more than a hundred dollars to just around fifty cents. This is how it works.
I type all my silly words into reStructuredText, just plain text with some markup, and Pelican creates HTML files that I can preview on a local HTTP server and host wherever I want. And as I don’t need a database I don’t have to worry about caching or intricate optimizations anymore.
I’ve always crafted not just my code but also my stories in text editors—Vim for as long as I remember and Visual Studio Code nowadays—so I can use just one Git repository to keep track of content, code and configuration, and do my writing on any decent computer. It’s a very portable and convenient setup.
To make my life easier I put Pelican in a Docker image and included a Bash script to automate content generation and deploying to Amazon S3 and CloudFront. That’s cheap fault tolerance for yuh.
Do I need a little extra? Perhaps a contact form so that a friendly reader—or some spammer bastard—can hit me with an email message once every few moons? Not a problem, I’ll just throw in a little React, a short AWS Lambda function with an API Gateway call to SES and look, I got your letter.
“Yes, but now you are locked to Amazon, you idiot!”
Thank you for the comment, hostile imaginary reader. That’s right, I have to rely on the services of Jeff and company but who doesn’t? And I’m just managing a bunch of text files with very little code and dependencies so I can easily port everything anywhere (all right, all right, to Google Cloud).
As my days of working with those who just threw money at every problem are over, I have to be frugal and every penny I save is a very precious penny. I can continue sharing my gibberish with the universe and I’m still in control.
My using a static website generator to run Zinibu may not sound like much but I see it as a good example of what I’m trying to do with more demanding endeavors: use my wits and skills instead of money to get as far as I can.
If everything goes according to plan I may continue making a living answering to no one.
It better works; it’s seven already and I can hear the cats’ dirty paws scratching the door.