Why a Cloudflare Serverless Worker should be a martech devs best friend and what has ants got to do with it? you might ask
If you ask me, I'm going to say ... FAST, SMALL & VERY VERY VERY SCALABLE.
The purpose of this post is to provide:
- Brief introduction to Cloudflare serverless workers and Q&A.
- Simple example for how to make a QR code generator.
- List of digital marketing use cases.
Brief introduction and Q&A
So what is a Cloudflare serverless worker you might ask? the quick answer is that it is just a function on a server that is managed for you.
For the official pitch and docs have a read of Cloudflare Serverless Workers.
🧐 Q&A about Cloudflare Serverless Workers
Feel very welcome to put your questions in the comments.
OK, are they just for tech geeky people? no, read the answer to the next question.
Why are Cloudflare Serverless Workers so interesting? whilst they are highly scalable and very very very fast, they are inexpensive and you only pay for what you use, so that means that Cloudflare Serless Workers will be of interest to all sorts of people.
Do Clourflare Server Workers scale for enterprise requirements? Yes, Shopify has embraced Cloudflare Serverless Workers in a big way.
What can I do with a Cloudflare Serverless Worker? to learn more about use cases have a read of the official Cloudflare examples, and of course checkout the list of digital marketing use cases.
Are Cloudflare serverless workers the same as AWS Serverless Lambda functions? no, a Cloudflare serverless worker is by design a very small script size, whereas an AWS Serverless Lambda function can contain magnitudes of code.
How to make QR code generator
Follow along with this tutorial.
You can either use the Wrangler deploy or copy the compiled code into a serverless worker created with the UI.
Then for me to get this to work I make a postman call like so to the serverless worker URL.
Digital marketing use cases
- API Router - use the worker to act as a middleware between services.
- Orchestrate API request caching - for example, make a request to an API service and the cache the result using Cloudflare's cache so that subsequent calls don't have a cost on the origin.
- Anywhere where private keys are used - use a Cloudflare serverless worker for where private environment variables need to be hidden.
- Custom URL and specific country redirects.
- Custom URL shortner.