Our Blog

AWS Lambda Tutorial: Step by step instructions to create a scalable web application – Part 1

Arunbalan
January 27, 2016

Building scalable systems is often unmanageable even with cloud computing. Normally we  use Amazon AWS with  EC2 , load balancer and autoscaling. This approach is inconvenient and sudden traffic spikes cannot be handled with autoscaling. Additionally some infrastructure should be always kept in reserve.

Aws Lambda can be used to  solve these hassles of  AWS load balancing.  AWS Lambda is quite promising, easy to use  and does not have the above limitations. The trick of using AWS Lambda with Amazon API gateway can help you  build and scale web-applications with no infrastructure reservations.

AWS Lambda

AWS Lambda is a platform to make completely scalable applications with less effort and without the hassles of virtual machines. You need to upload your application code as “Lambda” functions to AWS. AWS Lambda runs your code on high-availability compute infrastructure and performs all the infrastructure functions, such as administration of the compute resources, capacity provisioning and automatic scaling. Those Lambda functions can be triggered by Amazon API endpoint, thereby exposing to the web. All you need to do is upload your code in one of the languages that AWS Lambda supports (currently Node.js or Java).

 

The Scenario

 

This document includes stepwise procedure for Building a completely scalable and reliable cloud based application using AWS Lambda.In this part we will see working example of scalabe lambda application.This involves creating a web Interface for app, construct AWS Lambda function, configure APIs in Amazon API Gateway and invoke the application from web browser.

This demo application is a poor man’s facebook. The source code is available at github  (https://github.com/Nethram/LambdaDemoApplication) It has 3 functionalities. Those are

  1. Creating user account with username and password.
  2. Update the user’s status.
  3. View every user’s status.

Use this link to test this application. It opens the following interface.

 

 

index_page

 

  • Provide a username and password to create your account.
  • Once an account is created, you may submit your username, password and your status in the second box.
  • You can then see the status of every user by submitting your username and password.

 

2nd

Source Code :https://github.com/Nethram/LambdaDemoApplication.

 

We will cover the nuts and bolts of connecting AWS resources with Lambda in Part2

Leave a Reply

Your email address will not be published. Required fields are marked *