real world serverless
TRANSCRIPT
Real World ServerlessJustin Wood
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 2
A lie gets halfway around the world before the truth has a chance to get its pants on.
- Winston Churchill
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 3
AWS Lambda is a zero-administration compute platform …
- AWS Lambda Documentation
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 4
Traditional Current Emerging
How
What
Where
Changes in the way we work
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 5
Infrastructure Infrastructure as Code No Infrastructure
Changes in the way we work
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 6
Traditional Old Current
How
What
Where
ZeroOps
Functions
Serverless Computing Network Operating System
Emerging
Changes in the way we workWe rewrite this ... because we like the bleeding edge
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 7
Yay!It’s Simple and Works
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 8
Man, that was actually hard!It’s Sophisticated and works
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 9
Man, I should have thought that through!
I wasn’t that clever
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 10
Simple enoughLogshippers for APIs
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 11
The explosion of eleganceLogshippers for APIs (2)
1 API1 Lambda1 Trigger2 Buckets
When you deploy an API DevOps some lambdas to go with it!
APIs Functions Triggers BucketsStart 1 1 1 2
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 12
The explosion of eleganceLogshippers for APIs (3)
That was easy lets ramp up:
APIs Lambdas Triggers BucketsStart 1 1 1 2Add CPU log shipper 2 2 2 4Add 6 more APIs 14 14 14 28Deploy to Pre-prod 28 28 28 56Other API’s are in build 34 34 34 68
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 13
Tip:
Less is more.
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 14
Tip:
Serverless is still maturing be prepared for change.
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 15
• Environment variables• Serverless Application Model (use Cloud Formation it only took 2 years)• Step Functions• Dead letter queue• X-Ray• C#• Lambda Edge • Lots of integrations to other AWS services e.g. Lex• Will run on devices! i.e. push to IOT• Serverless micro frameworks• 3rd party tool innovations• Heaps of other stuff …
It’s a long listSome BIG changes in Lambda this year
All in the last 3 months!
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 16
Tip:
Rethink using Java for Lambda … seriously.
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 17
Lots of BIG java codeLots of Lambdas
e.g. 40 * 25MB
~1 GB! of ‘Uber’ Jars
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 18
Tip:
Start with a serverless DevOps framework that’s integrated with your infrastructure as code
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 19
• What is your Infrastructure as Code Approach?
• Dockerised builds?• Potentially working across clouds?• Using AWS DevOps?• Do you need support for shims i.e.
‘non-standard’ code?• Per environment configuration?
Carefully …Choose a serverless famework
VIP
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 20
•DevOps friendly•Has shims so I could write Lambda in Go• Integrates with Terraform
I’m moving to ApexServerless Framework
$ curl https://raw.githubusercontent.com/apex/apex/master/install.sh | sh$ apex deploy$ echo ‘{“api_name”,”battleships”}’ | apex deploy aplog
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 21
Tip:
More on DevOps … make your functions independently manageable.
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 22
Tip (probably the most important one) :
Remember serverless is an event driven / message based architecture
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 23
Lambda App ExampleMessage Flow
https://devpost.com/software/clive-a-serverless-slack-bot-for-aws
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 24
Lambda App ExampleMessage Flow
https://aws.amazon.com/step-functions/
• Design appropriately• Respond to events• ‘Think async’ • Always return a message• Issue events• Orchestrate with Step Functions• Always throw errors and use the DLQ• Monitor across the flow
Presentation title[To edit, click View > Slide Master > Slide Master]
© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 25
Tip:
Think about security early
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 26
Function security
More SecureBut More ‘AppOpps’
• Typical AWS resource style security all environments in one place … no tagging :-(• Think carefully about Downstream services
Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 27
Questions
?