Fast but Not Loose: Typesafe Clients in a Distributed Service - - PowerPoint PPT Presentation

fast but not loose
SMART_READER_LITE
LIVE PREVIEW

Fast but Not Loose: Typesafe Clients in a Distributed Service - - PowerPoint PPT Presentation

Fast but Not Loose: Typesafe Clients in a Distributed Service Architecture, a retrospective #gotocon #gotoaar #gilttech Eric Bowman @ebowman VP Architecture @ Gilt Groupe ebowman@gilt.com Monday, September 30, 13 Monday, September 30, 13


slide-1
SLIDE 1

Fast but Not Loose:

Typesafe Clients in a Distributed Service Architecture, a retrospective

Eric Bowman VP Architecture @ Gilt Groupe @ebowman ebowman@gilt.com

#gotoaar #gilttech #gotocon

Monday, September 30, 13

slide-2
SLIDE 2

Monday, September 30, 13

slide-3
SLIDE 3

Monday, September 30, 13

slide-4
SLIDE 4
  • Scala
  • Play
  • PostgreSQL
  • MongoDB
  • Voldemort
  • Kafka
  • Aster Data
  • Mahout
  • Jersey
  • SBT
  • Docker
  • Continuous Delivery

Microservices

Monday, September 30, 13

slide-5
SLIDE 5

http://upload.wikimedia.org/wikipedia/commons/1/16/Ruby_on_Rails-logo.png http://wiki.postgresql.org/wiki/File:PostgreSQL_logo.3colors.svg

Monday, September 30, 13

slide-6
SLIDE 6

http://logonoid.com/images/thumbs/christian-louboutin-logo.jpg

Monday, September 30, 13

slide-7
SLIDE 7

http://data.iluxdb.com/data/christian-louboutin-daffodile-160mm-python-masai-1130127cm09_001.jpg?dd80c0

Monday, September 30, 13

slide-8
SLIDE 8

http://upload.wikimedia.org/wikipedia/commons/7/79/Operation_Upshot-Knothole_-_Badger_001.jpg

Monday, September 30, 13

slide-9
SLIDE 9

Monday, September 30, 13

slide-10
SLIDE 10

Monday, September 30, 13

slide-11
SLIDE 11

Monday, September 30, 13

slide-12
SLIDE 12

Monday, September 30, 13

slide-13
SLIDE 13

Monday, September 30, 13

slide-14
SLIDE 14

Monday, September 30, 13

slide-15
SLIDE 15

Monday, September 30, 13

slide-16
SLIDE 16

http://blog.verwilst.be/wp-content/uploads/2008/12/java.gif

Monday, September 30, 13

slide-17
SLIDE 17

user_service

  • rder_service

payment_service product_service cart_service swift pagegen

Monday, September 30, 13

slide-18
SLIDE 18

http://megmurph.com/wp-content/uploads/2013/03/success-1.jpg

Monday, September 30, 13

slide-19
SLIDE 19

Front End Service X Service Y Service Z

Monday, September 30, 13

slide-20
SLIDE 20

Front End Service X Service Y Service Z

Monday, September 30, 13

slide-21
SLIDE 21

Front End Service X Service Y Service Z

Content from Service X Content from Service Y Content from Z

Monday, September 30, 13

slide-22
SLIDE 22

Front-End Tier Service Tier Data Tier

Monday, September 30, 13

slide-23
SLIDE 23

Front-End Tier Service Tier Data Tier

Caching Light Computation Orchestration

Monday, September 30, 13

slide-24
SLIDE 24

Front-End Tier Service Tier Data Tier

Caching Light Computation Orchestration Caching Heavier Computation Separation of Concerns

Monday, September 30, 13

slide-25
SLIDE 25

Front-End Tier Service Tier Data Tier

Caching Light Computation Orchestration Caching Heavier Computation Separation of Concerns Data Access (Disk/SSD/RAM)

Monday, September 30, 13

slide-26
SLIDE 26
  • Runtime Temperature
  • Development Temperature

Front-End Tier Service Tier Data Tier

Caching Light Computation Orchestration Caching Heavier Computation Separation of Concerns Data Access (Disk/SSD/RAM)

Monday, September 30, 13

slide-27
SLIDE 27

Data Source Service JDBC ➾ HashMap ➾ JSON http://gilt.com Javascript Application Front End JSON ➾ HashMap ➾ JSON

Monday, September 30, 13

slide-28
SLIDE 28

Chaos Grows Quickly

Data Source Service JDBC ➾ HashMap ➾ JSON http://gilt.com Javascript Application Front End JSON ➾ HashMap ➾ JSON

Monday, September 30, 13

slide-29
SLIDE 29

http://gilt.com Javascript Application Front End JSON ➾ HashMap ➾ JSON JSON ➾ HashMap ➾ JSON JSON ➾ HashMap ➾ JSON

Service

JDBC ➾ HashMap ➾ JSON

Data Source

Service

JDBC ➾ HashMap ➾ JSON

Data Source

Service

JDBC ➾ HashMap ➾ JSON

Data Source

Monday, September 30, 13

slide-30
SLIDE 30

http://gilt.com Javascript Application Front End JSON ➾ HashMap ➾ JSON JSON ➾ HashMap ➾ JSON JSON ➾ HashMap ➾ JSON Service

JDBC ➾ HashMap ➾ JSON

Data Source

Service

JDBC ➾ HashMap ➾ JSON

Data Source

Service

JDBC ➾ HashMap ➾ JSON

Data Source

Service

JSON ➾ HashMap ➾ JSON JSON ➾ HashMap ➾ JSON

Monday, September 30, 13

slide-31
SLIDE 31

http://www.recruitmenttakeout.com/wp-content/uploads/2013/04/brian.png

Monday, September 30, 13

slide-32
SLIDE 32
  • Fast
  • Service Decomposition
  • Implicit core model was good

Monday, September 30, 13

slide-33
SLIDE 33
  • Org Scaling
  • APIs
  • Implicit core model was ... implicit

Monday, September 30, 13

slide-34
SLIDE 34

A data model and APIs for services

Monday, September 30, 13

slide-35
SLIDE 35

A data model and APIs for services

(aka, RPC)

Monday, September 30, 13

slide-36
SLIDE 36

http://git-scm.com/images/logos/downloads/Git-Logo-2Color.png

core service core service core service core service

Legacy

Monday, September 30, 13

slide-37
SLIDE 37

http://git-scm.com/images/logos/downloads/Git-Logo-2Color.png

core service core service core service core service

Legacy

commons.jar

core clients core data model async client framework

Greenfield

Monday, September 30, 13

slide-38
SLIDE 38

http://git-scm.com/images/logos/downloads/Git-Logo-2Color.png

core service core service core service core service

Legacy

commons.jar

core clients core data model async client framework

Greenfield

  • Users
  • Sales
  • Products
  • Skus
  • Assets
  • Targeting
  • Auth

Monday, September 30, 13

slide-39
SLIDE 39

service client core

Monday, September 30, 13

slide-40
SLIDE 40

service client core

  • RESTful
  • Scala clients
  • All APIs futures-based
  • Case class schema

Monday, September 30, 13

slide-41
SLIDE 41

service client core client core service

Compile/Runtime Dependency

Monday, September 30, 13

slide-42
SLIDE 42

Consumer Service Client Core Core

“Embassy Soil”

Monday, September 30, 13

slide-43
SLIDE 43

Consumer Service Client Core Core

  • Easy functional testing
  • Service response capture
  • Test linking
  • Upgradable
  • Emergent Regression
  • Automated upgrades
  • Compile farmers

Monday, September 30, 13

slide-44
SLIDE 44

Consumer Service Client Core Core

Monday, September 30, 13

slide-45
SLIDE 45
  • Environment ⊕ Config
  • Live updates
  • Indirection
  • Circuit Breaker

Consumer Service Client Core Core

Monday, September 30, 13

slide-46
SLIDE 46

Monday, September 30, 13

slide-47
SLIDE 47

“All of this is completely wrong.”*

*Not an actual quote

Monday, September 30, 13

slide-48
SLIDE 48

1.The network is reliable 2.Latency is zero 3.Bandwidth is infinite 4.The network is secure 5.Topology doesn't change 6.There is one administrator 7.Transport cost is zero 8.The network is homogeneous

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-49
SLIDE 49

1.The network is reliable

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-50
SLIDE 50

1.The network is reliable

https://blogs.oracle.com/jag/resource/Fallacies.html

R e s

  • l

v e d

Monday, September 30, 13

slide-51
SLIDE 51

2.Latency is zero

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-52
SLIDE 52

2.Latency is zero

https://blogs.oracle.com/jag/resource/Fallacies.html

R e s

  • l

v e d

Monday, September 30, 13

slide-53
SLIDE 53

3.Bandwidth is infinite

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-54
SLIDE 54

3.Bandwidth is infinite

https://blogs.oracle.com/jag/resource/Fallacies.html

R e s

  • l

v e d

Monday, September 30, 13

slide-55
SLIDE 55

4.The network is secure

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-56
SLIDE 56

4.The network is secure

https://blogs.oracle.com/jag/resource/Fallacies.html

R e s

  • l

v e d

Monday, September 30, 13

slide-57
SLIDE 57

5.Topology doesn't change

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-58
SLIDE 58

5.Topology doesn't change

https://blogs.oracle.com/jag/resource/Fallacies.html

R e s

  • l

v e d

Monday, September 30, 13

slide-59
SLIDE 59

6.There is one administrator

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-60
SLIDE 60

6.There is one administrator

https://blogs.oracle.com/jag/resource/Fallacies.html

R e s

  • l

v e d

Monday, September 30, 13

slide-61
SLIDE 61

7.Transport cost is zero

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-62
SLIDE 62

7.Transport cost is zero

https://blogs.oracle.com/jag/resource/Fallacies.html

R e s

  • l

v e d

Monday, September 30, 13

slide-63
SLIDE 63

8.The network is homogeneous

https://blogs.oracle.com/jag/resource/Fallacies.html

Monday, September 30, 13

slide-64
SLIDE 64

8.The network is homogeneous

https://blogs.oracle.com/jag/resource/Fallacies.html

R e s

  • l

v e d

Monday, September 30, 13

slide-65
SLIDE 65

“Still Wrong.”*

*Possibly an actual quote

Monday, September 30, 13

slide-66
SLIDE 66

Convenience Over Correctness

http://steve.vinoski.net/blog/2008/07/01/convenience-over-correctness/

Monday, September 30, 13

slide-67
SLIDE 67

Database Database Model Service Backend Service Model Service Frontend Client/Server Serialization Model Client Backend Client Data Model Client Layer Public Data Model

Monday, September 30, 13

slide-68
SLIDE 68

Database Database Model Service Backend Service Model Service Frontend Client/Server Serialization Model Client Backend Client Data Model Client Layer Public Data Model

  • So many models
  • Corners are cut
  • Typesafe helps
  • Conflation?
  • Just the data

Monday, September 30, 13

slide-69
SLIDE 69

“Works in Practice for some use cases”

Database Database Model Service Backend Service Model Service Frontend Client/Server Serialization Model Client Backend Client Data Model Client Layer Public Data Model

  • So many models
  • Corners are cut
  • Typesafe helps
  • Conflation?
  • Just the data

Monday, September 30, 13

slide-70
SLIDE 70

“Works in Practice for some use cases” “No free silver bullet lunches.”

Database Database Model Service Backend Service Model Service Frontend Client/Server Serialization Model Client Backend Client Data Model Client Layer Public Data Model

  • So many models
  • Corners are cut
  • Typesafe helps
  • Conflation?
  • Just the data

Monday, September 30, 13

slide-71
SLIDE 71

However...

Monday, September 30, 13

slide-72
SLIDE 72
  • No machine generated stubs
  • Embassy-Oriented Programming
  • Lots of indirection
  • Type-system support for failures

However...

Monday, September 30, 13

slide-73
SLIDE 73

What Actually Sucks about RPC:

Monday, September 30, 13

slide-74
SLIDE 74

What Actually Sucks about RPC:

  • Remote objects
  • Failures
  • Idempotency

Monday, September 30, 13

slide-75
SLIDE 75

Ignoring all that was Too Easy.

Monday, September 30, 13

slide-76
SLIDE 76

Monday, September 30, 13

slide-77
SLIDE 77

Batch Jobs

Monday, September 30, 13

slide-78
SLIDE 78

1.The network is reliable 2.Latency is zero 3.Bandwidth is infinite 4.The network is secure 5.Topology doesn't change 6.There is one administrator 7.Transport cost is zero 8.The network is homogeneous

Monday, September 30, 13

slide-79
SLIDE 79

Law of Instrument

Monday, September 30, 13

slide-80
SLIDE 80

Pulling data.

Monday, September 30, 13

slide-81
SLIDE 81

Pushing code.

Monday, September 30, 13

slide-82
SLIDE 82

SOA, Reloaded

Monday, September 30, 13

slide-83
SLIDE 83

SOA, Reloaded

  • CRUD
  • Event Streams
  • Batch Processing
  • Lambda Architecture
  • CQRS

Monday, September 30, 13

slide-84
SLIDE 84

Client Service DB

Monday, September 30, 13

slide-85
SLIDE 85

Client Fast Storage Service Kafka Data Warehouse Batch Jobs DB CEP Clickstream data

Monday, September 30, 13

slide-86
SLIDE 86

http://tech.gilt.com join us. new york & dublin

Monday, September 30, 13