FaaS, Fonction As A Service, is the new way to make your applications serverless.
If serverless is a new word for you, keep in mind that it’s like a microservice but smaller, processing only one task. This service is executed every time you make a request.
Why I have to use a function instead of a standard service hosted in a server ?
Because hosting your own service involves:
- Waste of money: For some processes, you don’t necessarily need a server running 24/24 7/7. With a FaaS, you pay what you want, it’s “on demand”
- Stateful system: States are horrible, it’s difficult to scale. All your functions are stateless.
- Operation’s nightmare: Sometimes it’s difficult to sleep without worrying about the availability of our services. Serverless still need monitoring but you don’t have to worry about scalability and availability.
Now, you know why serverless is cool. Especially with the JAMStack.
To host your functions you have several providers:
- AWS Lambda
- Azure Functions
- Google Cloud Functions
- IBM OpenWhisk
- OpenFaaS to build your own FaaS
AWS Lambda, the ancestor
Amazon Web Services was the first to popularize FaaS with Lambda.
I started with AWS Lambda. To develop your functions you can:
- Use the embedded code editor: awful.
- Develop on your local machine, zip the function and upload it with
aws cli: awful.
- Send the zip directly from the user interface: awful.
The developer experience is terrible. Testing your function is a nightmare and needs a lot of configurations.
We don’t want to waste our money, and so our time.
Moreover, AWS interface is so ugly with a bad UX (UI is OK but UX is more important for this kind of service).
When I tried to calculate the cost of a project, Lambda was the more expensive one. It’s cheap if you connect your function to other AWS services, but when you need to go outside of their system, they want your entire wallet.
Azure Functions on my way
By comparing providers, I discovered Azure Functions.
I wasn’t keen on the idea of going with Microsoft.
But I was impressed ! Of course we know that Microsoft is a real software company, and their Azure dashboard prove it.
I didn’t struggle to find what I was looking for. Everything is intuitive, so the UX.
Calculating costs for your project is very easy with their calculator (AWS cost calculator has been released recently, too late).
Azure Functions development workflow is life changing !
When I created a new function, Azure shows me all the steps to start developing my function:
- VS Code integration, because it’s their product so they are taking advantage of it.
- Installing a NPM package including the kit to develop our functions.
- And all the workflow, inside VS Code !
I developed, tested and deployed my function in an hour ! Compared to Lambda, it was day and night.
Just after the deployment, Azure comes with the monitoring dashboard and explain you carefully how to use it.
Free tier is waiting for you, with open arms ;)
Try Functions, it’s more worth than Lambda… if you don’t have an AWS architecture already in place.