1 month ago 🥁 for day 236, 2021 with 487 words.

Workers R US

Exercise: None
Piano Song of the day: Waka Waka (151 / 167 @ 80%)


This playing in D is driving me nuts, but I figure it is probably good for me and Waka Waka is a happy tune anyway.


I've never been greatly interested in serverless computing - not that it is actually serverless of course but not your servers at least. It came to most engineer's attention with AWS Lambda. You could have a piece of code sitting at a URL address that when you called it would execute and return some results. It had some uses, but generally, they ran in isolation. You could have built a simple website that displayed the time just using a lambda function. With lambda's, instead of paying Amazon by the hour to ruin a virtual server, you paid them by the execution. So if your site wasn't busy it wasn't costing you anything. But if busy could cost you more than your server. You pick your architecture and you pay your price. I've built one lambda, the experience put me off for life - partly because I had to code it in Python, but mainly doing anything on AWS is torture.

Then Cloudflare announced Workers. Like Lambdas, they were serverless code that ran in the Cloudflare infrastructure, of which they have 300+ of them around the globe. The code will execute really close to the user, regardless of where they are.

Plus they supported lots of languages, including JavaScript and COBOL - not that I'm itching to write anymore COBOL you understand. Then they added a Key/Value distributed store so you had a way to store and share information.

And I was itching to play with workers, but I had a problem. I didn't have a good use case, and by good I mean "there isn't a better way to do it than with CF Workers" instead of a "we could because we can" good use. For years I couldn't come up with good use.

Until today, when I was presented with a problem and a short deadline and I was about to write back to the customer to tell them that the impossible deadline was just that, impossible when it hit me, I could do this with either an AWS Lambda or a Cloudflare Worker. I instantly discounted the lambda solution and a few hours later having known nothing about Cloudflare workers - other than that they exist - I had a fully working and finished solution working and deployed everywhere Cloudflare has a node.

And the icing on the cake. As long as you have a Cloudflare account and you don't receive bazillions of hits, the cost is FREE, as in reality they won't charge or upsell you or anything FREE.

It was a good day.

NB: Full disclosure I own shares in Amazon and Cloudflare and don't intend selling anytime this decade

dreamer

Start writing today, for free

Write Together is a safe space to blog, think, feel, and share together. Learn to write, or find a new home for your words, and join our passionate community.

Sign up Learn more
User Photo

By Yorick Phoenix 🥁

Chief WriteTogether Bug Finder & character stringer. Generally, to create computer code, but sometimes actual words and paragraphs. Listens to lots of music, takes lots of photos, & invests in stocks for the long haul.

Get Yorick Phoenix's newsletter

Almost there! Check your inbox and click the link to confirm.

Subscribe to Yorick Phoenix's latest writing to get it right in your inbox.