SERVERLESS ARCHIECTURE ON AWS CLOUD

Tejas Joshi
Petabytz
Published in
6 min readJun 26, 2019

WHAT DO YOU MEAN BY SERVERLESS?

Serverless computing is a cloud-computing execution model in which the cloud provider runs the server, and dynamically manages the allocation of machine resources. Pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity.

WHAT IS AWS LAMBDA ?

AWS Lambda is a compute provider that helps you to run code without provisioning or coping with servers. AWS Lambda executes your code simplest when wished and scales robotically, from some requests in keeping with day to heaps per second. You pay handiest for the compute time you consume — there’s no charge while your code isn’t always running. With AWS Lambda, you may run code for surely any kind of utility or backend service — all with zero management. AWS Lambda runs your code on a excessive-availability compute infrastructure and plays all of the administration of the compute assets, along with server and running machine preservation, capacity provisioning and automated scaling, code monitoring and logging.

You may use AWS Lambda to run your code in response to events, which include modifications to statistics in an Amazon S3 bucket or an Amazon DynamoDB table; to run your code in reaction to HTTP requests using Amazon API Gateway; or invoke your code using API calls made the usage of AWS SDKs. With those talents, you can use Lambda to effortlessly construct facts processing triggers for AWS services like Amazon S3 and Amazon DynamoDB, system streaming data stored in Kinesis, or create your personal returned end that operates at AWS scale, performance, and safety.

How To Create a Lambda function with Python:

Considering Python is a scripting language, you can create the script at once within the AWS console. Log in in your AWS Account, and navigate to the Lambda console. click on Create feature. We’ll be creating a Lambda from scratch, so pick out the writer from scratch choice.Input the proper name in your Lambda function, select a Python runtime and outline a function on your Lambda to use. since we received’t be the use of any outside resources, we don’t need unique permissions, however this is in which you would add a position with those permissions.

Once everything is set, click on the Create function button.

Let’s take a TDD approach to this. We’ll start by setting up a new test event. Click on the Select a test event drop-down and choose Configure test events.

Amazon provides a significant collection of test templates. We’ll modify the Hello World template with data of our own. We’ll add a new event name and then click on Create to create the new test event.

Once the take a look at is created, we will cause it with the test button. The end result is a a hit execution, but we’re searching out a response aside from “howdy from Lambda.” allow’s upload some code to the Lambda to accomplish what we need. you could use the code below or use your python-foo to create some thing greater elegant.

Once you’ve entered the code, click on Save, and then click on the Test button to try it out. You should see a successful result like the one shown below:

Serverless App:

A Serverless solution consists of a web server, Lambda functions (FaaS), security token service (STS), user authentication and database.

Client application — The UI of your application is rendered purchaser facet in modern-day Frontend Javascript App which allows us to use a simple, static web server.

net Server — Amazon S3 presents a strong and easy web server. all of the static HTML, CSS and JS documents for our software can be served from S3.

Lambda capabilities (FaaS) — they are the key enablers in Serverless architecture. some popular examples of FaaS are AWS Lambda, Google Cloud features and Microsoft Azure capabilities. AWS Lambda is used in this framework. The software services for logging in and accessing data could be built as Lambda functions. those features will study and write from your database and provide JSON responses.

protection Token carrier (STS) — generates transient AWS credentials (API key and secret key) for users of the software. those temporary credentials are used by the customer utility to invoke the AWS API (and for that reason invoke Lambda).

person Authentication — AWS Cognito is an identity provider that’s integrated with AWS Lambda. With Amazon Cognito, you can without problems upload consumer sign-up and sign-in on your cellular and web apps. It also has the options to authenticate users thru social identification carriers including fb, Twitter or Amazon, with SAML identification solutions, or the usage of your personal identification system.

Database — AWS DynamoDB offers a fully managed NoSQL database. DynamoDB isn’t critical for a serverless utility however is used as an instance here.

Advantages of Serverless architecture

From Business angle

The value incurred by using a serverless software is based at the quantity of function executions, measured in milliseconds in preference to hours.

procedure agility: Smaller deployable units bring about quicker delivery of capabilities to the marketplace, increasing the capacity to conform to change.

price of hiring backend infrastructure engineers goes down.

reduced operational charges

From developer angle

decreased legal responsibility, no backend infrastructure to be liable for.

zero machine administration.

less difficult operational management.

Fosters adoption of Nanoservices, Microservices, SOA principles.

faster installation.

Scalable, no want to fear approximately the quantity of concurrent requests.

monitoring out of the box.

Fosters innovation.

From User perspective

If companies are the usage of that aggressive area to ship functions faster, then clients are receiving new functions quicker than before.

it’s far viable that users can greater easily provide their own storage backend(i.e Dropbox, Google power).

It’s more likely that those varieties of apps can also provide purchaser-aspect caching, which presents a better offline experience.

Conclusion:

With the proper architectural considerations and due diligence, serverless might also present industry incumbents with an exit strategy to move from legacy infrastructure to undertake public cloud fashions — this become not determined earlier. however, enterprise incumbents will need pass far from the fame-quo and embody the alternate. A dependent technique with a described roadmap is required to transport away from the cutting-edge software program architecture paradigms that is primarily based on the legacy monolithic version with the serverless paradigm where the attention isn’t on infrastructure however on handing over the specified business functionalities which in flip changes the economic version for IT service delivery. There are concerns although with regard to seller lock-in and adherence to enterprise unique compliance requirements in a serverless model. Like all rising generation, Serverless will undergo its cycle earlier than mainstream adoption happens. Serverless has the capability to trade the monetary version of IT consumption of businesses leading to great cost discounts related generally with IT help and maintenance(which can be a tremendous 50–60%of the overall IT price range of firms),reduce time-to-market and foster innovation to aid converting commercial enterprise necessities and offer an edge over competition.

--

--