1 of 47

Microservices in a serverless world

Microservices Meetup Sep 2017

@exortech

2 of 47

Microservices

vs.

Serverless

Cloud functions

FaaS

@exortech

3 of 47

@exortech

4 of 47

Physical servers

Virtual machines

Containers

Serverless

@exortech

5 of 47

System / Application

Services

Cloud functions

@exortech

6 of 47

@exortech

7 of 47

Design

Tools

Process

Future

@exortech

8 of 47

Design

Design • Tools • Process • Future

@exortech

9 of 47

Design • Tools • Process • Future

Microservices

Cloud functions

@exortech

10 of 47

Design • Tools • Process • Future

Serverless

Microservice

ephemeral

long-lived

250+ ms latency

low latency

jobs < 5 mins

short requests to batch processing

events / stream

HTTP / REST

@exortech

11 of 47

High coupling

Low coupling

High cohesion

Low cohesion

Monolith

Distributed Monolith

Remote objects

Design • Tools • Process • Future

@exortech

12 of 47

High coupling

Low coupling

High cohesion

Low cohesion

Monolith

Design • Tools • Process • Future

Bounded Context

@exortech

13 of 47

Design • Tools • Process • Future

Queue / Stream

Integration middleware

Use Case #1

@exortech

14 of 47

Design • Tools • Process • Future

API

Application

Use Case #2

@exortech

15 of 47

Tools

Design Tools • Process • Future

@exortech

16 of 47

@exortech

17 of 47

DesignTools • Process • Future

AWS SAM

@exortech

18 of 47

DesignTools • Process • Future

Considerations

portability

abstraction

community / momentum

language

testability

deployment / provisioning

complexity

@exortech

19 of 47

DesignTools • Process • Future

  • Most popular open source framework for serverless applications
  • YAML-based configuration (serverless.yml)
  • Multi-lingual: python, node.js, java, scala or C#
  • Provision using CloudFormation (or equivalent)
  • Cross-platform: supports AWS, Google, Azure and IBM
  • Large library of open source plugins
  • Custom web console - unified view

@exortech

20 of 47

DesignTools • Process • Future

service: catalog

functions:

getCatalog:

events: ...

getItem:

listItems:

...

catalog/serverless.yml

@exortech

21 of 47

DesignTools • Process • Future

@exortech

22 of 47

DesignTools • Process • Future

AWS SAM

  • Built and maintained by Amazon
  • Used internally
  • Natively support provisioning all AWS event sources and stores
  • SAM local for local testing

@exortech

23 of 47

DesignTools • Process • Future

  • Infinite scalability without the cloud function constraint
  • HTTP server running as child process in serverless container
  • Heroku style-PaaS experience
  • Open source project by TJ Holowaychuk

@exortech

24 of 47

persistence?

DesignTools • Process • Future

@exortech

25 of 47

DesignTools • Process • Future

Relational DB

@exortech

26 of 47

DesignTools • Process • Future

Key-value store

@exortech

27 of 47

DesignTools • Process • Future

Event stream

@exortech

28 of 47

Process

Design ToolsProcess • Future

@exortech

29 of 47

Any organization that designs a system will produce a design whose structure is a copy of the organization's communication structure.

Design • Tools • ProcessFuture

Melvin Conway

@exortech

30 of 47

Design • Tools • ProcessFuture

@exortech

31 of 47

Design • Tools • ProcessFuture

@exortech

32 of 47

Design • Tools • ProcessFuture

Inverse Conway Maneuver

@exortech

33 of 47

Design • Tools • ProcessFuture

@exortech

34 of 47

Design • Tools • ProcessFuture

@exortech

35 of 47

Design • Tools • ProcessFuture

@exortech

36 of 47

Design • Tools • ProcessFuture

Inverse Conway’s Law

Systems and tools also shape the structure and processes of the organizations that use them.

@exortech

37 of 47

Design • Tools • ProcessFuture

@exortech

38 of 47

Design • Tools • ProcessFuture

@exortech

39 of 47

Programmer

narchy

@exortech

40 of 47

Design • Tools • ProcessFuture

“Threw out the Agile Playbook”

fast-failure (MTTR)

defect prevention (MTBF)

business metric tracking

acceptance testing

disposable services

precious code

continuous deployment

continuous integration

duplicate or rewrite

reuse

health checks and alerting

unit testing

@exortech

41 of 47

Future

Design • Tools • Process • Future

@exortech

42 of 47

Design • Tools • Process • Future

The Promise of Serverless

✅ Low barrier to entry

✅ Low cost to operate

✅ No specialized OS or HW knowledge required

@exortech

43 of 47

Design • Tools • Process • Future

“Anyone who knows a bit of coding can deploy an infinitely* scalable service”

@exortech

44 of 47

Design • Tools • Process • Future

20 M

57 M

@exortech

45 of 47

Design • Tools • Process • Future

+

@exortech

46 of 47

Design • Tools • Process • Future

@exortech

47 of 47

Thanks!

@exortech