real world serverless

27
Real World Serverless Justin Wood

Upload: justin-wood

Post on 08-Feb-2017

82 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Real World Serverless

Real World ServerlessJustin Wood

Page 2: Real World Serverless

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

Page 3: Real World Serverless

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

Page 4: Real World Serverless

Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 4

Traditional Current Emerging

How

What

Where

Changes in the way we work

Page 5: Real World Serverless

Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 5

Infrastructure Infrastructure as Code No Infrastructure

Changes in the way we work

Page 6: Real World Serverless

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

Page 7: Real World Serverless

Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 7

Yay!It’s Simple and Works

Page 8: Real World Serverless

Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 8

Man, that was actually hard!It’s Sophisticated and works

Page 9: Real World Serverless

Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 9

Man, I should have thought that through!

I wasn’t that clever

Page 10: Real World Serverless

Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 10

Simple enoughLogshippers for APIs

Page 11: Real World Serverless

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

Page 12: Real World Serverless

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

Page 13: Real World Serverless

Presentation title[To edit, click View > Slide Master > Slide Master]

© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 13

Tip:

Less is more.

Page 14: Real World Serverless

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.

Page 15: Real World Serverless

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!

Page 16: Real World Serverless

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.

Page 17: Real World Serverless

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

Page 18: Real World Serverless

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

Page 19: Real World Serverless

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

Page 20: Real World Serverless

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

Page 21: Real World Serverless

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.

Page 22: Real World Serverless

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

Page 23: Real World Serverless

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

Page 24: Real World Serverless

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

Page 25: Real World Serverless

Presentation title[To edit, click View > Slide Master > Slide Master]

© 2016. For information, contact Deloitte Touche Tohmatsu Limited. 25

Tip:

Think about security early

Page 26: Real World Serverless

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

Page 27: Real World Serverless

Real World Serverless© 2017. For information, contact Deloitte Touche Tohmatsu Limited. 27

Questions

?