Credits image: cloudflare
First of all, Serverless doesn't means without a server, yes, we need a running server for our applications, but there are some characteristics that helps us to define Serverless.
Serverless computing is an infrastructure method of providing backend services on an as-used basis. And it can grow up automatically based on the requests and has already our installed modules that are necessary to run the project.
Advantages of Serverless
Lower costs: Serverless computing is generally very cost-effective, as traditional cloud providers of backend services (server allocation) often result in the user paying for unused space or idle CPU time.
Simplified scalability: Developers using serverless architecture don’t have to worry about policies to scale up their code. The serverless vendor handles all of the scaling on demand.
Simplified backend code: With FaaS, developers can create simple functions that independently perform a single purpose, like making an API call.
Quicker turnaround: Serverless architecture can significantly cut time to market. Instead of needing a complicated deploy process to roll out bug fixes and new features, developers can add and modify code on a piecemeal basis.
As we can see in the image above, the microservice is clearly diferent when we refers to monolithic.
Advantages of microservices
Resilience: Because the application is divided up, one part of the application breaking or crashing does not necessarily affect the rest of the application
Selective scalability: Instead of scaling the entire application, only the microservices that receive a great deal of usage can be scaled
Easier to add or update features: Features can be rolled out or updated one at a time, instead of updating the entire application stack
Flexibility for developers: Microservices can be written in different languages and each have their own libraries
Explanation of System Design above
In this design we have a Frontend (User interface) that request something to our Backend API Microservices that are running in Lambda Serverless and could access data storage.
How would we decide to use Microservices on Serverless?
1 - When we want an easy way to deploy and has no team to maintain an infrastructure would be an example. In this context, we don't need to think about load balance, replication, cluster, master, slave, nodes, because it will do all necessary processing.
2 - If we are building a specific part that could be a bottleneck (many requests and database access) so that's really a great opportunity to Serverless works.
3 - When we can isolate a part of our design system and give it an opportunity to work in a dynamic environment and keep ours concerns just in business roles.
4 - Don't use it in Hype context, but make a real decision it is really necessary.
Contacts
Email: luizcalaca@gmail.com
Instagram: https://www.instagram.com/luizcalaca
Linkedin: https://www.linkedin.com/in/luizcalaca/
Twitter: https://twitter.com/luizcalaca
Top comments (2)
Excellent !!!
Thanks, Tony!