aws lambda and accesing aws rds - clouddictive

17
AWS Lambda and RDS Clouddictive https://blog.clouddicti ve.com [email protected]

Upload: clouddictive

Post on 11-Jan-2017

130 views

Category:

Software


1 download

TRANSCRIPT

Page 2: Aws lambda and accesing AWS RDS - Clouddictive

Agenda❖ What is Serverless Compute❖ Benefits of Serverless Compute❖ AWS Lambda❖ How It Works❖ RDS❖ Employee Service❖ Setup RDS❖ Setup maven project❖ Create and Test lambda function – Demo❖ Resources

Page 3: Aws lambda and accesing AWS RDS - Clouddictive

Serverless Compute❖ Next step in the evolution of Cloud Computing❖ Capability to run your code or a function in the

cloud without the need to manage any server in the cloud.

❖ Big Players ❖ Amazon - AWS Lambda❖ Google - Google Cloud Function❖ Microsoft - Azure Functions

Page 4: Aws lambda and accesing AWS RDS - Clouddictive

Benefits of Serverless Compute❖ No servers to administer

❖ No Need Maintain and Manage Server - applying updates

❖ Pay for only code execution❖ No charge when the code is not running

❖ Automatic Scaling

Page 5: Aws lambda and accesing AWS RDS - Clouddictive

AWS Lamba❖ Function in the Cloud❖ Automatic Scaling❖ Pay as you go

❖ Pricing – 1M requests for free and then $0.20/1m requests.❖ Supported languages – Java, Python, and JavaScript❖ Deployment – direct zip uploads lambda or from S3.❖ Event Driven – Different source can trigger your function.❖ RESTful invocation capability using AWS API Gateway.❖ Logs management on CloudWatch.❖ Maximum execution time – 5 minutes.

Page 6: Aws lambda and accesing AWS RDS - Clouddictive

How It Works

❖ Source - https://aws.amazon.com/lambda/

Page 7: Aws lambda and accesing AWS RDS - Clouddictive

AWS RDS❖ Amazon RDS is the “RDBMS” (Relation Database

Management System) in the cloud. ❖ Consumer can launch resizable instances of

different database engines in the cloud and handles the management of admin task for you like automated backups and applying software patches.

Page 8: Aws lambda and accesing AWS RDS - Clouddictive

AWS RDS – Database Engines❖ RDS support following Database engines:

❖ Amazon Aurora – Amazon version of MySQL cheaper and faster.

❖ MySQL❖ PostgreSQL❖ Oracle❖ SQL Server❖ Maria DB – Community-developed fork of MySQL

RDBMS (Free under GNU GPL)

Page 9: Aws lambda and accesing AWS RDS - Clouddictive

Employee Service- Stack

Page 10: Aws lambda and accesing AWS RDS - Clouddictive

Employee Service- Sequence

Page 11: Aws lambda and accesing AWS RDS - Clouddictive

Demo- Setup RDS

Page 12: Aws lambda and accesing AWS RDS - Clouddictive

Setup Maven Project - SPRING❖ Create a Spring maven project in STS (jar). Add following

dependencies to POM❖ MySQL❖ Spring – context❖ Spring – core❖ Spring – TX (Transaction)❖ Spring – jdbc ❖ Spring – test❖ Jackson libraray (Jackson-mapper-asl)❖ Junit❖ Aws Lambda (aws-lambda-java-core)

Page 13: Aws lambda and accesing AWS RDS - Clouddictive

Setup Maven Project - Classes

Page 14: Aws lambda and accesing AWS RDS - Clouddictive

Setup Maven Project- Spring Context

Page 15: Aws lambda and accesing AWS RDS - Clouddictive

IAM Role and VPC - Demo

❖ IAM role should have full access to RDS.❖ VPC (ip-address range) in which the lambda

function resides have access to RDS.❖ Demo

Page 16: Aws lambda and accesing AWS RDS - Clouddictive

Demo – Create and Test Lambda Function

Page 17: Aws lambda and accesing AWS RDS - Clouddictive

Resources

❖ https://blog.clouddictive.com/2016/07/21/serverless-compute-series-part-4-aws-lambda-and-rds/

❖ https://youtu.be/9CH5UerBtDA❖ https://youtu.be/wRg_PwuBpFk❖ https://youtu.be/mQwmX8weOsY❖ https://youtu.be/c79ytPC_Lco