Skip to main content

AWS Lambda and the Serverless Cloud

Lambda manages capacity planning, provisioning, auto scaling and updates without interventention

You get all these features but you loose control over platform, you have to use AMAZON OS
The idea of lambda is out sourcing your compute, so that you can focus on your application
Lambda is a function as a tool service or FAAS

Use Cases

·      ETL Jobs: These are data driven jobs, which take in some kind of S3 files, something from external service like a DB and perform some kind of operations on it.

·      API(API Gateway):it provides the front end to lambda function,so that you can accept http request, send responses without having to have a webserver

·      Mobile backends: Either as a api or directly from AWS sdk on your mobile device , depending upon how you would like to develop

·      Infrastructure Automation: You can use it to make your infrastructure smarter. I would like to use lambda as a smart glue for the infrastructure because it ties in well with other AWS services, thus making it really easy to develop little pieces of automation

·      Data validation: with Dynamo DB, you can use it as  storage procedure

AWS Lambda How It Works

 Under the hood
When using lambda, you are using containers that are running on EC2 instances. These EC2 instances are not accessible by you. In terms of management and administration, they download your code from lambda and run it inside isolated container.
So it looks to you that you have isolated machine, even though there maybe many lambda functions executed at the same time on that machine

These containers force resource isolation, so you are only allowed to use the amount of RAM you have configured and they enforce 100ms execution limits for the purpose of billing and also the time outs.
Once created the lambda function, you ca set time outs and at the end of the time out container will be killed regardless of your process

 Anatomy of an application

·      Code- your application consists of code and any dependencies of the code such as libraries
·      Event- event that comes from external source
·      Output-Output is what your functions provides whether it send it to external service or returns it as a\the output of the function
 Event Sources
In the above anatomy of application, we discusses Events as part of an application
There are many event sources. Some of them are:
·      Schedules: You can use schedules similar to cronjob
·      S3 Events: which hand information about new file, updated file or delete file in to lambda
·      DyanmoDB streams:  is another way you can interact dynamo with lambda. When change is made to DyanmoDB, that change is given to lambda function to trigger
·      Kinesis streams: are similar to dyanmoDB streams but they can be added to arbitrary services using kinesis SDK
·      SNS topics: are simple notification service for messages that come from web tools or any other sources
·      API gateway: Is the mapping between http request that might be coming in & events sent to your lambda functions
·      SDK invocationsL From any AWS SDK, you can invoke a standard lambda function

Accessing Amazon CloudWatch Logs for AWS Lambda
AWS Lambda automatically monitors Lambda functions on your behalf, reporting metrics through Amazon CloudWatch. To help you troubleshoot failures in a function, Lambda logs all requests handled by your function and also automatically stores logs generated by your code through Amazon CloudWatch Logs.
You can insert logging statements into your code to help you validate that your code is working as expected. Lambda automatically integrates with CloudWatch Logs and pushes all logs from your code to a CloudWatch Logs group associated with a Lambda function, which is named /aws/lambda/<function name>.
You can view logs for Lambda by using the Lambda console, the CloudWatch console, the AWS CLI, or the CloudWatch API.

Using AWS Lambda with AWS CloudTrail
You can enable CloudTrail in your AWS account to get logs of API calls and related events history in your account. CloudTrail records all of the API access events as objects in your Amazon S3 bucket that you specify at the time you enable CloudTrail.
You can take advantage of Amazon S3's bucket notification feature and direct Amazon S3 to publish object-created events to AWS Lambda. Whenever CloudTrail writes logs to your S3 bucket, Amazon S3 can then invoke your Lambda function by passing the Amazon S3 object-created event as a parameter. The S3 event provides information, including the bucket name and key name of the log object that CloudTrail created. Your Lambda function code can read the log object and process the access records logged by CloudTrail. For example, you might write Lambda function code to notify you if specific API call was made in your account.
In this scenario, you enable CloudTrail so it can write access logs to your S3 bucket. As for AWS Lambda, Amazon S3 is the event source so Amazon S3 publishes events to AWS Lambda and invokes your Lambda function 

Popular posts from this blog

Data Center Migration

Note: This blog is written with the help of my friend Rajanikanth
Data Center Migrations / Data Center Consolidations
Data Center Consolidations, Migrations are complex projects which impact entire orgnization they support. They usually dont happen daily but once in a decade or two. It is imperative to plan carefully, leverage technology improvements, virtualization, optimizations.
The single most important factor for any migration project is to have high caliber, high performing, experienced technical team in place. You are migrating business applications from one data center to another and there is no scope for failure or broken application during migration. So testing startegy should be in place for enterprise business applications to be migrated.
Typical DCC and Migrations business objectives
Business Drivers
·Improve utilization of IT assets ·DC space & power peaked out - business growth impacted ·Improve service levels and responsiveness to new applications ·Reduce support complexi…

HP CSA Implementation

I know the above picture is little confusing but don’t worry I break it down and explain in detail. By the time I am done explaining you all will be happy. HARDWARE AND SOFTWARE REQUIREMENTS 1.VMware vSphere infrastructure / Microsoft Hyper V: For the sake of Simplicity we will use VMware vSphere. We Need vSphere 4.0 /5/5.5 and above and vCenter 4.0 and above ready and installed. This is the first step. 2.We need Software medias for HP Cloud Service Automation, 2.00, HP Server Automation, 9.02, HP Operations Orchestration (OO)9.00.04, HP Universal CMDB 9.00.02, HP Software Site Scope, 11.01,HP Insight Software6.2 Update 1 3.DNS, DHCP and NTP systems are already installed and configured. NTP information should be part of VM templates 4.SQL Server 2005 or Microsoft® SQL Server 2008 or Microsoft® SQL Server 2012 , Oracle 11g, both 32-bit and 64-bit versions may be used for CSA database.
5.We will install  HP Cloud Service Automation, 2.00, HP Server Automation, 9.02, HP Operations Orchestra…

Openstack- Its importance in Cloud. The HP Helion Boost

Every enterprise expects few things from cloud computing, mainly:

· Auto scaling: The workload should increase and decrease as needed by the IT environment.

· Automatic repair: If there is any fault or crash of the application or the server, it automatically fix it

· Fault tolerant: The application or underlying technology is intelligent enough to make itself fault torrent

· Integrated lifecycle: It should have integrated lifecycle

· Unified management: Its easy to manage all different aspects of technology

· Less cost

· Speed

Its year 2014. till now only 5% to 7% enterprises are using cloud computing. Such a small number. Its a huge opportunity and a vast majority for anyone who is interested in providing cloud computing services.
Current IT environment is very complex. You just cant solve all your problems with cloud computing.
There are legacy systems, databases, data processors, different hardware and software. You name it , there are so many technology available in just o…