How can we avoid the headache of having too many and too heavy features or services? Add more resources? Do some refactoring? Pile up external services? But what if users keep coming back with more requests for new features?
Imagine adding new features to a project that has to do with images. Maybe it’s a platform for sharing photos. Features we need are storing images and assigning URLs to them. Simple. But then users want to add cropping and resizing features. Fine. We find an appropriate solution on the web and link it to our project. The users come back again – now they would like us to implement an image recognition feature, which would store the results somewhere. Things are starting to look complicated. Especially when the prices come into play.
We can connect all these services and remember the correct logic sequences and exceptions. The service must be asynchronous, of course, because only after a successful upload will we be able to send an image to the crop service, and later on to the recognition service. We’re smart, and we see the problem: many vulnerable dependencies and ‘heavy’ features.
It takes (too much) time to develop anything new in such a complex environment. And it’s costly to pay for so many external services.
Our answer and solution is:
Node.js + Lambda(AWS) + Serverless = a lightweight project
Lambda(AWS) “is a compute service that lets you run code without provisioning or managing servers. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second.”
So where is the catch? Well, there is no catch!
Using Lambdas is fully transparent. You pay only for the functions that get triggered:
First 1 million requests per month are free
$0.20 per 1 million requests after that ($0.0000002 per request)
The Perfect Mix
Combining the three tools will let you create flexible, fast and lightweight features on a single platform. No need to worry about complexity, because Lambda has an automatic rescale function – Lambda is able to handle almost an infinite amount of requests and respond to all of them. With Serverless, we obtain a tool for building new functionalities in one place. We connect Serverless directly to Amazon Web Services and don’t worry about setting up AWS manually. We can find everything we need in the Serverless framework.
Interested in trying this approach yourself? Drop us a line and we’ll help you get started.