Serverless Architecture fueled for Digital Transformation
Serverless is one the hottest topic in the Industry which inline to the Digital Transformation. In the current realm of digital transformation, ‘customer experience’ is the next frontier, where the bulk of the experiences are being thought through by enterprises to inline their speed of change with new Digital Age. Technology innovations are powering new experiences, and the public cloud is truly operating as a foundation to make it real.
Enterprise IT has come a long way — from physical servers, to virtual machines, to containers as Traditional approach and it is still evolving faster than ever and now moving the wind towards Serverless Architecture, which enable businesses to quickly create their own, market-focused solutions while leveraging enterprise grade information and services and without having to get “hands on” with infrastructure.
What is Serverless?
Serverless means applications where some of the coding piece, logic is still written by the developer but unlike traditional architectures it executes in stateless compute containers that empowers even-based triggers and fully managed by 3rd party. Amazon AWS Lambda is one of the most popular implementation in this Serverless Service Architecture.
Traditionally, Application Architecture will look something like below which is 3-tier client oriented system with server-side logic.
Figure 1: Traditional Application Architecture
Under this Architecture, Client will only interact with application server for all logic like authentication, business processing, function calling and application will further interact with Database for Read/Write as Server Architecure.
Now if we transform the Traditional Architecture to Serverless Architecture, this is how it will look like. Which is using multiple services as individual components in place of application system as a single component in place and using multiple database services for different business services.
Note: In this article, all services I have covered is in referenced to AWS
Figure 2: Serverless Architecture
- Here we are referring to Authentication Services such as IAM (Identity access management) where a simple static page hosted onto S3 bucket can allow customer to browse an application and get his access control through Identity Access Management Cloud Service, which will enable customer to download his security profile for the client accessing functionality.
- Client makes a request through an entry API gateway to search Products using Product Catalog service and then makes a purchase request using purchase service. Here, we have implemented the API Gateway as entry checker so that rather than implementing any logic changes on client side we can simple replace or add more services behind the API Gateway. When an API Gateway receives a request it finds the routing configuration matching the request and then calls the relevant service function. Typically, the API Gateway will allow mapping from http request parameters to inputs arguments for the service function. The API Gateway transforms the result of the service function call to an http response, and returns this to the original caller.
What is Lamda?
AWS Lambda lets you run code without maintaining any server instances. You may think of an atomic, stateless function with a single task that may run for a limited amount of time (one minute, currently). The functions can be written in Javascript (Node.js), Python or Java.
If you upload your Lambda code, Amazon will take care of everything required to run and scale your code with high availability. Lambda executes in parallel. So, if a million requests are made, a million Lambda functions will execute without loss of speed or capacity. According to Amazon, “there are no fundamental limits to scaling a function”.
The best thing is, that from a developer’s perspective, Lambda functions are not even there when they don’t get executed. They only appear when needed. And what isn’t up, can’t come down.
Use Case 1: Event-driven Data Processing
Figure 3: Event-driven Data Processing
One of the most common applications for serverless architecture is to activate an action after an event occurs. In above use case (Event-driven processing), user is putting an object into Amazon S3 Bucket and using Lamda functionality in backed same object is passed to Lambda for compressing the file size and repush the object back to S3 bucket.
Use Case 2: Mobile Backend Social Media App
Figure 4: Mobile Backend Social Media App
In this use case, a user makes a status update, mobile app on user devices makes an API call to API Gateway, which will call Labda Function to ONLY push notification to his friends list. Lambda function will do a lookup of friends list of users associated to his friend list and pushes status update notification to user’s friends
Conclusion
Serverless is a smart Architecture where we get superior flexibility of relying on a smaller extent than usual on running our own server sides architecture as part of our applications. Serverless architecture replaces long-running virtual machines with ephemeral compute power that comes into existence on request and disappears immediately after use. Use of this Architecture can make much more efficient use of compute resources. As world is moving towards Digital Transformation to match it speed with customer experience and change Serverless Architecture fits right on the technology front to match digital speed as it reduces time-to-market.
Make Sure you give this post 50 claps with a follow if you have really enjoyed this post and want to see more such posts.