Achieving Continuous
Delivery with AWS
Timeline
• Ajay Nair from AWS
Introduction to AWS Lambda
• Florian Motlik from Codeship
Introduction to Codeship and Deploying
to AWS Lambda
• Martin Tajur
How Pipedrive uses Codeship and AWS Lambda
• Q&A
FAQ
• We’re recording
and will share the recording
soon after
• Tweet with #awslambdawebinar
Introduction to
Lambda
AWS Lambda
COMPUTE SERVICE
EVENT DRIVEN
Run code without thinking about
servers
Code only runs when it needs to run
AWS Lambda: Benefits
EVENT-DRIVEN SCALE
AWS Lambda: Capabilities
BRING YOUR OWN CODE COMPUTE “POWER LEVELS”
AWS Lambda: Putting it to work
… and the list will
continue to grow!
Amazon Echo skills File processing with Amazon S3 Amazon Dynamo DB triggers Amazon Kinesis processors Microservices with API Gateway AWS CloudFormation custom resources Customized notifications with Amazon SNS Amazon Cognito triggers
Mobile and Web backends
AWS Lambda: How it works
AUTHOR CONFIGURE
Codeship and Lambda
Build - Release Cycle
Build
Test
Release
!
„ The top lesson that Cockcroft
learned at Netflix is that speed wins
in the marketplace. If you ask any
developer whether a slower
development process is better, no
one ever says yes.“
AWS Lambda on
Codeship
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "lambda:UpdateFunctionCode", "lambda:UpdateFunctionConfiguration", "lambda:InvokeFunction", "lambda:GetFunction" ], "Resource": [ "arn:aws:lambda:YOUR_AWS_REGION:YOUR_AWS_AC COUNT_ID:function:YOUR_FUNCTION_NAME" ] } ] }
Support any Software
?
?
?
? ?
?
?
?
?
?
?
Parity between
How we use AWS Lambda to process incoming emails
Martin Tajur
● Web-based CRM for small teams with big ambitions. ● Founded in 2010.
● Web-based CRM for small teams with big ambitions. ● Founded in 2010.
● Web-based CRM for small teams with big ambitions. ● Founded in 2010.
● Used by well over 10,000 businesses worldwide.
● Web-based CRM for small teams with big ambitions. ● Founded in 2010.
● Used by well over 10,000 businesses worldwide.
● 100+ employees, venture funded (BVP, Series A in 2015) ● Very end user focused, helping the actual sales person do
What we do with Lambda
TL;DR: We process incoming emails in Lambda.
What we do with Lambda Gmail
What we do with Lambda
What we do with Lambda
What we do with Lambda
What we do with Lambda
Gmail Receive Process Store
We process incoming emails in Lambda.
Pipedrive Gmail integration
Pipedrive Gmail integration
● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM
Pipedrive Gmail integration
● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM
Pipedrive Gmail integration
● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM
● Contact history stored
Pipedrive Gmail integration
● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM
● Contact history stored
● No juggling between apps ● Keep your focus
Pipedrive Gmail integration
● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM
● Contact history stored
● No juggling between apps ● Keep your focus
Pipedrive Gmail integration
● Work with your deals and contacts straight in the CRM ● Send and receive emails within the CRM
● Contact history stored
● No juggling between apps ● Keep your focus
● Close more deals ● $$$
Our Lambda function
Our Lambda function
● Called mail-message-parser
Our Lambda function
● Called mail-message-parser
● Node.js, Javascript based application
Our Lambda function
● Called mail-message-parser
● Node.js, Javascript based application
● Takes in regular HTML, returns nicer HTML ● Covered with 105 unit tests
Our Lambda function
● Called mail-message-parser
● Node.js, Javascript based application
● Takes in regular HTML, returns nicer HTML ● Covered with 105 unit tests
What we do with Lambda
What we do with Lambda
● Fix broken HTML emails
● Filter out unwanted parts of HTML (<script>, attached event handlers, etc)
What we do with Lambda
● Fix broken HTML emails
● Filter out unwanted parts of HTML (<script>, attached event handlers, etc)
300,000 emails
per day on average We process
300,000 emails
of the
per day on average We process
4,000 users
Processing incoming emails is... ● Highly fluctuating in volume
Processing incoming emails is... ● Highly fluctuating in volume
● High peak hours (20k+ emails per hour), lower on
Processing incoming emails is... ● Highly fluctuating in volume
● High peak hours (20k+ emails per hour), lower on
weekends (2k per hour), bursts up to 200 emails/sec. ● CPU intensive
Without Lambda,
Without Lambda, we would either...
...provision as much as instances as needed to serve the peak hours
Bad. Waste of resources during less busy hours. Est. cost around
Without Lambda, we would either...
...provision as much as instances as needed to serve the peak hours
Bad. Waste of resources during less busy hours. Est. cost around
$150/mo.
...set up instances as autoscale group
Bad. Complexity. Lots of moving parts to manage. Complex deployments. Est. cost up to $100/mo.
Without Lambda, it would cost us $100-$150/month.
Our monthly spend on Lambda?
Without Lambda at scale?
Without Lambda at scale?
4K users, 300K emails/day = $150/month
With Lambda at scale?
With Lambda at scale?
4K users, 300K emails/day = $8/month
Without Lambda, it would take
Lambda production deployment setup through Codeship took us
Lambda production deployment setup through Codeship took us
Time spent on “scaling it” down the road —
How we deploy to Lambda
● GitHub based workflow
How we deploy to Lambda
● GitHub based workflow
branch out › write code › pull request › merge › repeat ● Unit tests executed on each pull and commit on Codeship.
How we deploy to Lambda
● GitHub based workflow
branch out › write code › pull request › merge › repeat
● Unit tests executed on each pull and commit on Codeship.
Works perfectly for us
● 0 hours spent on provisioning VMs, worrying about setting up autoscaling or other fine-tuning.
Works perfectly for us
● 0 hours spent on provisioning VMs, worrying about setting up autoscaling or other fine-tuning.
Works perfectly for us
● 0 hours spent on provisioning VMs, worrying about setting up autoscaling or other fine-tuning.
● 0 hours spent on configuration management.
Works perfectly for us
● 0 hours spent on provisioning VMs, worrying about setting up autoscaling or other fine-tuning.
● 0 hours spent on configuration management.
● $$$ saved on having the resources be provisioned 24/7. ● 20 minutes spent on setting up continuous delivery.
Works perfectly for us
● 0 hours spent on provisioning VMs, worrying about setting
up autoscaling or other fine-tuning.
● 0 hours spent on configuration management.
● $$$ saved on having the resources be provisioned 24/7.
● 20 minutes spent on setting up continuous delivery.
● Developers can focus on the parser, not the deployment or supporting tools.
Thank you. Martin Tajur
@tajur on Twitter
With this promo code
CODESHIPROCKS
2 months free
Q&A
• Ajay Nair - @ajaynairthinks
• Florian Motlik - @flomotlik
• Martin Tajur - @tajur