keynote: architecting for continuous delivery (pivotal cloud platform roadshow)

41
1 © Copyright 2013 Pivotal. All rights reserved. 1 © Copyright 2014 Pivotal. All rights reserved. Architecting for Continuous Delivery Microservices with Pivotal CF and Spring Cloud

Upload: pivotal

Post on 26-Jan-2015

105 views

Category:

Software


0 download

DESCRIPTION

Continuous Delivery & Microservices with Matt Stine, Platform Engineer at Pivotal. Microservices−small, loosely coupled applications that follow the Unix philosophy of "doing one thing well"−represent the application development side of enabling rapid, iterative development, horizontal scale and polyglot clients. Microservices also help enable continuous delivery and scaling application development while eliminating long-term commitments to a single technology stack. Pivotal Cloud Platform Roadshow is coming to a city near you! Join Pivotal technologists and learn how to build and deploy great software on a modern cloud platform. Find your city and register now http://bit.ly/1poA6PG

TRANSCRIPT

Page 1: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

1 © Copyright 2013 Pivotal. All rights reserved. 1 © Copyright 2014 Pivotal. All rights reserved.

Architecting for Continuous Delivery

Microservices with Pivotal CF and Spring Cloud

Page 2: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

What is Continuous Delivery?

2

$Busin

ess

Devel

opm

ent

QA

Ope

ratio

nsCu

stom

er

Page 3: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

What is Continuous Delivery?

3

$

Page 4: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 4

Continuous Delivery - How?

Page 5: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 5

Warner Music: Software FactoriesWarner Software Factory Platform • New applications and major updates

- Before: 6 months, team of 10 developers - After: 6 weeks, same team - Speed/Agility: 400% faster on new platform - HR Hard Savings: $1.1M per application update

delivered

Page 6: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 6

Iterative Development

Design Develop

Test

Customer Feedback Customer

Delivery

Analytics

Page 7: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Horizontal Scale

7

Slow/Expensive Fast/Cheap

Page 8: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Diversity of Clients

8

http://money.cnn.com/2014/02/28/technology/mobile/mobile-apps-internet/

In January 2014, mobile devices accounted for 55% of Internet usage in the United States. Apps made up 47% of Internet traffic and 8% of traffic came from mobile

browsers.

Page 9: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 9

InfrastructureApplications

MonolithsMicroservices

Physical/Virtual Pivotal CFContinuous Delivery

Software Factories

Feedback Rapid Iteration

Horizontal Scale

Diversity of Clients

Page 10: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 10

New Architectural Constraints• Pivotal CF optimizes for 12 Factor Linux applications

Page 11: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 11

Twelve Factors•One Codebase/Many Deploys

• Explicit Isolated Dependencies

•Config via Environment

•Attached Backing Services

• Separate Build/Release/Run

• Stateless Processes

• Export Services via Port Bindings

• Scale Out via Processes

•Disposable Instances

•Dev/Prod Parity

• Logs == Event Streams

•Admin Tasks == Processes

http://12factor.net

Page 12: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 12

New Architectural Constraints• Pivotal CF optimizes for 12 Factor Linux applications

•Microservices: a radical departure from traditional monolithic applications

• In both cases, the enterprise is forced to “think different.”

Page 13: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

How XP Practices Support Each Other

13

http://www.kusmin.eu/wiki/index.php/How_XP_Practices_Support_Each_Other

Page 14: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

A Mutualistic Symbiotic Relationship…

14

Microservices

http://en.wikipedia.org/wiki/Symbiosis#Mutualism

Pivotal CF

Page 15: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.© Copyright 2014 Pivotal. All rights reserved.

Microservices Overview

15

Page 16: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 16

Simple vs. Easy• Simple

• sim- plex

• one fold/braid

• vs complex

• Easy

• ease < aise < adjacens

• lie near

• vs hard

Page 17: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Monolithic Architecture

17

Relational Database

Data Access

Service

HTML JavaScript MVC

Service

Monolithic ApplicationBrowser

Page 18: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 18

Monolithic Architectures•Complex / Easy

•Modularity Dependent Upon Language / Frameworks

•Change Cycles Tightly Coupled / Obstacle to Frequent Deploys

• Inefficient Scaling

•Can Be Intimidating to New Developers

•Obstacle to Scaling Development

• Requires Long-Term Commitment to Technical Stack

Page 19: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Microservice Architecture

19

HTTP

HTTP

HTTP

HTTP

HTTP

HTTP

AMQPAMQP

Relational DB

Key/Value Store

Graph DB

Page 20: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 20

Microservice Architectures• Simple / Hard

•Modularity Based on Component Services

•Change Cycles Decoupled / Enable Frequent Deploys

• Efficient Scaling

• Individual Components Less Intimidating to New Developers

• Enables Scaling of Development

• Eliminates Long-Term Commitment to Technical Stack

Page 21: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Conway’s Law

21

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

Melvyn Conway, 1967

http://martinfowler.com/articles/microservices.html#OrganizedAroundBusinessCapabilities

Page 22: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Organize Around Business Capabilities

22

Data Access

Service

HTML JavaScript MVC

Service

UI S

pecialists

Middlew

are S

pecialists

DB

As

Business C

apability

Business C

apability

Business C

apabilitySiloed Functional Teams

http://martinfowler.com/articles/microservices.html#OrganizedAroundBusinessCapabilities

Siloed Application Architectures

Cross- functional Teams

Microservice Architectures

Page 23: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 23

Partitioning Strategies•By Noun (e.g. product info service)

•By Verb (e.g. shipping service)

• Single Responsibility Principle(http://programmer.97things.oreilly.com/wiki/index.php/The_Single_Responsibility_Principle)

•Bounded Context (http://martinfowler.com/bliki/BoundedContext.html)

Page 24: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Bounded Contexts

24

Movie Movie

Actor

Genre

Media Type

Media Type

Kiosk

Location

Media

Product Catalog

Inventory

Page 25: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Polyglot Persistence

25

REST XYou shall not pass…

Page 26: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 26

UNIX Pipes and Filters

cut -d" " -f1 < access.log | sort | uniq -c | sort -rn | less

Page 27: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Choreography over Orchestration

27

https://www.flickr.com/photos/gabrielsaldana/5896491978

https://www.flickr.com/photos/chrisbrenschmidt/2223763842

http://martinfowler.com/articles/microservices.html#SmartEndpointsAndDumbPipes

Page 28: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.© Copyright 2014 Pivotal. All rights reserved. 28

http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html

Page 29: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 29

Paying for your lunch…• Significant Operations Overhead

• Substantial DevOps Skills Required

• Implicit Interfaces

•Duplication of Effort

•Distributed System Complexity

•Asynchronicity is Difficult!

• Testability Challenges

Page 30: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

You must be this tall to use Microservices…

30

http://martinfowler.com/bliki/MicroservicePrerequisites.html

https://www.flickr.com/photos/gusset/3723961589

• RAPID PROVISIONING

•BASIC MONITORING

• RAPID APPLICATION DEPLOYMENT

•DEVOPS CULTURE

Page 31: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

It’s gonna take a platform…

31

Pivotal CF Spring Cloud

Page 32: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 32

Platform Features

• Environment Provisioning

•On-Demand/Automatic Scaling

• Failover/Resilience

• Routing/Load Balancing

•Data Service Operations

•Monitoring

•Distributed/Versioned Config

• Service Registration/Discovery

• Routing/Load Balancing

• Service Integration

• Fault Tolerance

•Asynchronous Messaging

Page 33: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 33

http://projects.spring.io/spring-cloud

Page 34: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 34

• Eureka

•Hystrix + Turbine

• Ribbon

• Feign

• Zuul

•Archaius

+

http://netflix.github.io

Page 35: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Pivotal CF + Spring Cloud + Netflix OSS!

35

Page 36: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 36

DEMO

Page 37: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

Supporting Rapid Change

37

Microservices is the first architectural style developed:

POST

POST&

Continuous Delivery

DevOps∆

Page 38: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 38

Architecture is abstract until it is operationalized.

Neal Ford

Page 39: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved. 39

Architectures that aren’t operationalized exist only on whiteboards.

Matt Stine

Page 40: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

© Copyright 2014 Pivotal. All rights reserved.

OPERATIONALIZED ARCHITECTURE

40

Microservices

Pivotal CF

Spring Cloud

Page 41: Keynote: Architecting for Continuous Delivery (Pivotal Cloud Platform Roadshow)

A NEW PLATFORM FOR A NEW ERA