Slide 1

Slide 1 text

1 © 2015 Pivotal Software, Inc. All rights reserved. 1 © 2015 Pivotal Software, Inc. All rights reserved. Spring Cloud & Microservices/Cloud Native Apps Carlos Queiroz @cax

Slide 2

Slide 2 text

2 © 2015 Pivotal Software, Inc. All rights reserved. A Monolith Application

Slide 3

Slide 3 text

3 © 2015 Pivotal Software, Inc. All rights reserved. Microservices/Cloud Native

Slide 4

Slide 4 text

4 © 2015 Pivotal Software, Inc. All rights reserved. Why? • SPEED • SAFETY • SCALE • MOBILITY

Slide 5

Slide 5 text

5 © 2015 Pivotal Software, Inc. All rights reserved. Cloud Native Applications • Twelve Factor Apps • Microservices • Self-Service Agile Infrastructure • API-Based Collaboration • Antifragility

Slide 6

Slide 6 text

6 © 2015 Pivotal Software, Inc. All rights reserved. Microservice “Loosely coupled service oriented architecture with bounded contexts...” -- Adrian Cockcroft

Slide 7

Slide 7 text

7 © 2015 Pivotal Software, Inc. All rights reserved. Loosely Coupled If every service has to be updated in concert, it’s not loosely coupled!

Slide 8

Slide 8 text

8 © 2015 Pivotal Software, Inc. All rights reserved. Bounded Contexts If you have to know about surrounding services you don’t have a bounded context.

Slide 9

Slide 9 text

9 © 2015 Pivotal Software, Inc. All rights reserved. Microservices…

Slide 10

Slide 10 text

10 © 2015 Pivotal Software, Inc. All rights reserved. Enabling Continuous Delivery

Slide 11

Slide 11 text

11 © 2015 Pivotal Software, Inc. All rights reserved. Agile - Iterative Feedback loops

Slide 12

Slide 12 text

12 © 2015 Pivotal Software, Inc. All rights reserved. Waterscrumfall

Slide 13

Slide 13 text

13 © 2015 Pivotal Software, Inc. All rights reserved. Continuous Delivery

Slide 14

Slide 14 text

14 © 2015 Pivotal Software, Inc. All rights reserved. How?

Slide 15

Slide 15 text

15 © 2015 Pivotal Software, Inc. All rights reserved.

Slide 16

Slide 16 text

16 © 2015 Pivotal Software, Inc. All rights reserved. Patterns • Cloud-native application architectures • Optimized for speed, safety, & scale • Declarative configuration • Stateless/shared-nothing processes • Loose coupling to application environment

Slide 17

Slide 17 text

17 © 2015 Pivotal Software, Inc. All rights reserved. 12 Factors (1/2) • One Codebase in Version Control • Explicit Dependencies • Externalized Config • Attached Backing Services • Separate Build, Release, and Run Stages • Stateless, Shared-Nothing Processes

Slide 18

Slide 18 text

18 © 2015 Pivotal Software, Inc. All rights reserved. 12 Factors (2/2) • Export Services via Port binding • Scale Out Horizontally for Concurrency • Instances Should Be Disposable • Dev/Prod Parity • Logs Are Event Streams • Admin Processes

Slide 19

Slide 19 text

19 © 2015 Pivotal Software, Inc. All rights reserved. Platforms http://heroku.com http://cloudfoundry.org

Slide 20

Slide 20 text

20 © 2015 Pivotal Software, Inc. All rights reserved. Frameworks http://www.dropwizard.io http://projects.spring.io/spring-boot

Slide 21

Slide 21 text

21 © 2015 Pivotal Software, Inc. All rights reserved. Spring Boot • http://projects.spring.io/spring-boot • Opinionated convention over configuration • Production-ready Spring applications • Embed Tomcat, Jetty or Undertow • STARTERS • Actuator: Metrics, health checks , introspection

Slide 22

Slide 22 text

22 © 2015 Pivotal Software, Inc. All rights reserved. Challenges of Distributed systems • Configuration Management • Service Registration & Discovery • Routing & Load Balancing • Fault Tolerance (Circuit Breakers!) • Monitoring • Concurrent API Aggregation & Transformation

Slide 23

Slide 23 text

23 © 2015 Pivotal Software, Inc. All rights reserved.

Slide 24

Slide 24 text

CNA Patterns

Slide 25

Slide 25 text

25 © 2015 Pivotal Software, Inc. All rights reserved. Patterns on-deck • Consistent and Distributed Configuration • Service Registration and Discovery

Slide 26

Slide 26 text

26 © 2015 Pivotal Software, Inc. All rights reserved. Spring Cloud Distributed Patterns

Slide 27

Slide 27 text

27 © 2015 Pivotal Software, Inc. All rights reserved. Configuration Management

Slide 28

Slide 28 text

28 © 2015 Pivotal Software, Inc. All rights reserved. Config Server

Slide 29

Slide 29 text

29 © 2015 Pivotal Software, Inc. All rights reserved.

Slide 30

Slide 30 text

30 © 2015 Pivotal Software, Inc. All rights reserved. Config Server (app.groovy)

Slide 31

Slide 31 text

31 © 2015 Pivotal Software, Inc. All rights reserved. Config server – application.yml

Slide 32

Slide 32 text

32 © 2015 Pivotal Software, Inc. All rights reserved. https://bitbucket.org/caxqueiroz/configserver-data- public/src/798c0a25b54fbc597ca417211d99a5a5433c4016/demo.y ml Greeting: Guten Tag

Slide 33

Slide 33 text

33 © 2015 Pivotal Software, Inc. All rights reserved. Config client (app.groovy)

Slide 34

Slide 34 text

34 © 2015 Pivotal Software, Inc. All rights reserved. Config client (bootstrap.yml)

Slide 35

Slide 35 text

35 © 2015 Pivotal Software, Inc. All rights reserved. Cloud Bus

Slide 36

Slide 36 text

36 © 2015 Pivotal Software, Inc. All rights reserved.

Slide 37

Slide 37 text

37 © 2015 Pivotal Software, Inc. All rights reserved. Service Registration & Discovery

Slide 38

Slide 38 text

38 © 2015 Pivotal Software, Inc. All rights reserved.

Slide 39

Slide 39 text

39 © 2015 Pivotal Software, Inc. All rights reserved. Eureka

Slide 40

Slide 40 text

40 © 2015 Pivotal Software, Inc. All rights reserved. Eureka Service Registry

Slide 41

Slide 41 text

41 © 2015 Pivotal Software, Inc. All rights reserved. Producer

Slide 42

Slide 42 text

42 © 2015 Pivotal Software, Inc. All rights reserved. Consumer

Slide 43

Slide 43 text

CNA Patterns

Slide 44

Slide 44 text

44 © 2015 Pivotal Software, Inc. All rights reserved. Patterns on-deck • Routing/Load Balancing • Fault Tolerance

Slide 45

Slide 45 text

45 © 2015 Pivotal Software, Inc. All rights reserved. Routing & Load Balancing

Slide 46

Slide 46 text

46 © 2015 Pivotal Software, Inc. All rights reserved. Ribbon

Slide 47

Slide 47 text

47 © 2015 Pivotal Software, Inc. All rights reserved. Consumer with Load Balancer

Slide 48

Slide 48 text

48 © 2015 Pivotal Software, Inc. All rights reserved. Consumer with Ribbon-Enabled RestTemplate

Slide 49

Slide 49 text

49 © 2015 Pivotal Software, Inc. All rights reserved. Feign Client

Slide 50

Slide 50 text

50 © 2015 Pivotal Software, Inc. All rights reserved. Consumer with Feign Client

Slide 51

Slide 51 text

51 © 2015 Pivotal Software, Inc. All rights reserved. Fault Tolerance Hystrix

Slide 52

Slide 52 text

52 © 2015 Pivotal Software, Inc. All rights reserved. Circuit Breaker

Slide 53

Slide 53 text

53 © 2015 Pivotal Software, Inc. All rights reserved. Consumer (app.groovy)

Slide 54

Slide 54 text

54 © 2015 Pivotal Software, Inc. All rights reserved. Producer Client

Slide 55

Slide 55 text

55 © 2015 Pivotal Software, Inc. All rights reserved. Monitoring Hystrix Dashboard

Slide 56

Slide 56 text

56 © 2015 Pivotal Software, Inc. All rights reserved. Hystrix Dashboard

Slide 57

Slide 57 text

57 © 2015 Pivotal Software, Inc. All rights reserved. Hystrix Dashboard