Architecting for Continuous Delivery 
Microservices with Pivotal CF and Spring Cloud 
© Copyright 20134 Pivotal. All rights reserved. 1
What is Continuous Delivery? 
© Copyright 2014 Pivotal. All rights reserved. 
2 
$ 
Business 
Development 
QA 
Operations 
Customer
What is Continuous Delivery? 
© Copyright 2014 Pivotal. All rights reserved. 
3 
$
Continuous Delivery - How? 
© Copyright 2014 Pivotal. All rights reserved. 4
Warner Music: Software Factories 
Warner 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 
© Copyright 2014 Pivotal. All rights reserved. 5
Iterative Development 
Design 
Develop 
Test 
Customer 
Feedback Customer 
Delivery 
Analytics 
© Copyright 2014 Pivotal. All rights reserved. 6
Horizontal Scale 
© Copyright 2014 Pivotal. All rights reserved. 
7 
Slow/Expensive Fast/Cheap
Diversity of Clients 
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 
© Copyright 2014 Pivotal. All rights reserved. 
8 
browsers. 
http://money.cnn.com/2014/02/28/technology/mobile/mobile-apps-internet/
Physical/Virtual Pivotal CF 
Infrastructure 
Applications 
Monoliths 
Microservices 
Continuous Delivery 
Software Factories 
Feedback Rapid Iteration 
Horizontal Scale 
Diversity of Clients 
© Copyright 2014 Pivotal. All rights reserved. 9
New Architectural Constraints 
• Pivotal CF optimizes for 12 Factor Linux applications 
© Copyright 2014 Pivotal. All rights reserved. 10
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 
© Copyright 2014 Pivotal. All rights reserved. 11
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.” 
© Copyright 2014 Pivotal. All rights reserved. 12
How XP Practices Support Each Other 
© Copyright 2014 Pivotal. All rights reserved. 
13 
http://www.kusmin.eu/wiki/index.php/How_XP_Practices_Support_Each_Other
A Mutualistic Symbiotic Relationship… 
© Copyright 2014 Pivotal. All rights reserved. 
14 
Microservices 
Pivotal CF 
http://en.wikipedia.org/wiki/Symbiosis#Mutualism
Microservices 
Overview 
© Copyright 2014 Pivotal. © Copyright 2014 Pivotal. AAllll rriigghhttss rreesseerrvveedd.. 
15
Simple vs. Easy 
• Simple 
• sim- plex 
• one fold/braid 
• vs complex 
• Easy 
• ease < aise < adjacens 
• lie near 
• vs hard 
© Copyright 2014 Pivotal. All rights reserved. 16
Monolithic Architecture 
© Copyright 2014 Pivotal. All rights reserved. 
17 
Relational Database 
HTML JavaScript MVC 
Service 
Data Access 
Service 
Browser Monolithic Application
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 
© Copyright 2014 Pivotal. All rights reserved. 18
Microservice Architecture 
© Copyright 2014 Pivotal. All rights reserved. 
19 
… 
HTTP 
HTTP 
HTTP 
HTTP 
HTTP 
HTTP 
AMQP 
AMQP 
Relational 
DB 
Key/Value 
Store 
Graph 
DB
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 
© Copyright 2014 Pivotal. All rights reserved. 20
Conway’s Law 
© Copyright 2014 Pivotal. All rights reserved. 
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
Organize Around Business Capabilities 
HTML JavaScript MVC 
Service 
Siloed 
Application 
Architectures 
© Copyright 2014 Pivotal. All rights reserved. 
22 
Data Access 
Service 
UI Specialists 
Middleware 
Specialists 
DBAs 
Business Capability 
Business Capability 
Business Capability 
Siloed 
Functional 
Teams 
Cross-functional 
Teams 
Microservice 
Architectures 
http://martinfowler.com/articles/microservices.html#OrganizedAroundBusinessCapabilities
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) 
© Copyright 2014 Pivotal. All rights reserved. 23
Bounded Contexts 
© Copyright 2014 Pivotal. All rights reserved. 
24 
Movie Movie 
Actor 
Genre 
Media 
Type 
Media 
Type 
Kiosk 
Location 
Media 
Product 
Catalog 
Inventory
Polyglot Persistence 
© Copyright 2014 Pivotal. All rights reserved. 
25 
REST X You shall not pass…
UNIX Pipes and Filters 
cut -d" " -f1 < access.log | sort | uniq -c | sort -rn | less 
© Copyright 2014 Pivotal. All rights reserved. 26
Choreography over Orchestration 
© Copyright 2014 Pivotal. All rights reserved. 
27 
https://www.flickr.com/photos/gabrielsaldana/5896491978 
https://www.flickr.com/photos/chrisbrenschmidt/2223763842 
http://martinfowler.com/articles/microservices.html#SmartEndpointsAndDumbPipes
http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html 
© Copyright 2014 Pivotal. © Copyright 2014 Pivotal. AAllll rriigghhttss rreesseerrvveedd.. 28
Paying for your lunch… 
• Significant Operations Overhead 
• Substantial DevOps Skills Required 
• Implicit Interfaces 
• Duplication of Effort 
• Distributed System Complexity 
• Asynchronicity is Difficult! 
• Testability Challenges 
© Copyright 2014 Pivotal. All rights reserved. 29
You must be this tall 
to use 
Microservices… 
• RAPID PROVISIONING 
• BASIC MONITORING 
• RAPID APPLICATION DEPLOYMENT 
• DEVOPS CULTURE 
© Copyright 2014 Pivotal. All rights reserved. 
30 
https://www.flickr.com/photos/gusset/3723961589 
http://martinfowler.com/bliki/MicroservicePrerequisites.html
It’s gonna take a platform… 
© Copyright 2014 Pivotal. All rights reserved. 
31 
Pivotal CF Spring Cloud
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 
© Copyright 2014 Pivotal. All rights reserved. 32
http://projects.spring.io/spring-cloud 
© Copyright 2014 Pivotal. All rights reserved. 33
• Eureka 
• Hystrix + Turbine 
• Ribbon 
• Feign 
• Zuul 
• Archaius 
+ 
http://netflix.github.io 
© Copyright 2014 Pivotal. All rights reserved. 34
Pivotal CF + Spring Cloud + Netflix OSS! 
© Copyright 2014 Pivotal. All rights reserved. 
35
DEMO 
© Copyright 2014 Pivotal. All rights reserved. 36
Supporting Rapid Change 
DevOps Δ 
© Copyright 2014 Pivotal. All rights reserved. 
37 
Microservices is the first architectural style developed: 
POST 
& 
POST 
Continuous Delivery
Architecture is abstract until it is 
operationalized. 
Neal Ford 
© Copyright 2014 Pivotal. All rights reserved. 38
Architectures that aren’t operationalized 
exist only on whiteboards. 
Matt Stine 
© Copyright 2014 Pivotal. All rights reserved. 39
OPERATIONALIZED ARCHITECTURE 
© Copyright 2014 Pivotal. All rights reserved. 
40 
Microservices 
Pivotal CF 
Spring Cloud
A NEW PLATFORM FOR A NEW ERA

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

  • 1.
    Architecting for ContinuousDelivery Microservices with Pivotal CF and Spring Cloud © Copyright 20134 Pivotal. All rights reserved. 1
  • 2.
    What is ContinuousDelivery? © Copyright 2014 Pivotal. All rights reserved. 2 $ Business Development QA Operations Customer
  • 3.
    What is ContinuousDelivery? © Copyright 2014 Pivotal. All rights reserved. 3 $
  • 4.
    Continuous Delivery -How? © Copyright 2014 Pivotal. All rights reserved. 4
  • 5.
    Warner Music: SoftwareFactories Warner 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 © Copyright 2014 Pivotal. All rights reserved. 5
  • 6.
    Iterative Development Design Develop Test Customer Feedback Customer Delivery Analytics © Copyright 2014 Pivotal. All rights reserved. 6
  • 7.
    Horizontal Scale ©Copyright 2014 Pivotal. All rights reserved. 7 Slow/Expensive Fast/Cheap
  • 8.
    Diversity of Clients 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 © Copyright 2014 Pivotal. All rights reserved. 8 browsers. http://money.cnn.com/2014/02/28/technology/mobile/mobile-apps-internet/
  • 9.
    Physical/Virtual Pivotal CF Infrastructure Applications Monoliths Microservices Continuous Delivery Software Factories Feedback Rapid Iteration Horizontal Scale Diversity of Clients © Copyright 2014 Pivotal. All rights reserved. 9
  • 10.
    New Architectural Constraints • Pivotal CF optimizes for 12 Factor Linux applications © Copyright 2014 Pivotal. All rights reserved. 10
  • 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 © Copyright 2014 Pivotal. All rights reserved. 11
  • 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.” © Copyright 2014 Pivotal. All rights reserved. 12
  • 13.
    How XP PracticesSupport Each Other © Copyright 2014 Pivotal. All rights reserved. 13 http://www.kusmin.eu/wiki/index.php/How_XP_Practices_Support_Each_Other
  • 14.
    A Mutualistic SymbioticRelationship… © Copyright 2014 Pivotal. All rights reserved. 14 Microservices Pivotal CF http://en.wikipedia.org/wiki/Symbiosis#Mutualism
  • 15.
    Microservices Overview ©Copyright 2014 Pivotal. © Copyright 2014 Pivotal. AAllll rriigghhttss rreesseerrvveedd.. 15
  • 16.
    Simple vs. Easy • Simple • sim- plex • one fold/braid • vs complex • Easy • ease < aise < adjacens • lie near • vs hard © Copyright 2014 Pivotal. All rights reserved. 16
  • 17.
    Monolithic Architecture ©Copyright 2014 Pivotal. All rights reserved. 17 Relational Database HTML JavaScript MVC Service Data Access Service Browser Monolithic Application
  • 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 © Copyright 2014 Pivotal. All rights reserved. 18
  • 19.
    Microservice Architecture ©Copyright 2014 Pivotal. All rights reserved. 19 … HTTP HTTP HTTP HTTP HTTP HTTP AMQP AMQP Relational DB Key/Value Store Graph DB
  • 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 © Copyright 2014 Pivotal. All rights reserved. 20
  • 21.
    Conway’s Law ©Copyright 2014 Pivotal. All rights reserved. 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
  • 22.
    Organize Around BusinessCapabilities HTML JavaScript MVC Service Siloed Application Architectures © Copyright 2014 Pivotal. All rights reserved. 22 Data Access Service UI Specialists Middleware Specialists DBAs Business Capability Business Capability Business Capability Siloed Functional Teams Cross-functional Teams Microservice Architectures http://martinfowler.com/articles/microservices.html#OrganizedAroundBusinessCapabilities
  • 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) © Copyright 2014 Pivotal. All rights reserved. 23
  • 24.
    Bounded Contexts ©Copyright 2014 Pivotal. All rights reserved. 24 Movie Movie Actor Genre Media Type Media Type Kiosk Location Media Product Catalog Inventory
  • 25.
    Polyglot Persistence ©Copyright 2014 Pivotal. All rights reserved. 25 REST X You shall not pass…
  • 26.
    UNIX Pipes andFilters cut -d" " -f1 < access.log | sort | uniq -c | sort -rn | less © Copyright 2014 Pivotal. All rights reserved. 26
  • 27.
    Choreography over Orchestration © Copyright 2014 Pivotal. All rights reserved. 27 https://www.flickr.com/photos/gabrielsaldana/5896491978 https://www.flickr.com/photos/chrisbrenschmidt/2223763842 http://martinfowler.com/articles/microservices.html#SmartEndpointsAndDumbPipes
  • 28.
    http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html © Copyright2014 Pivotal. © Copyright 2014 Pivotal. AAllll rriigghhttss rreesseerrvveedd.. 28
  • 29.
    Paying for yourlunch… • Significant Operations Overhead • Substantial DevOps Skills Required • Implicit Interfaces • Duplication of Effort • Distributed System Complexity • Asynchronicity is Difficult! • Testability Challenges © Copyright 2014 Pivotal. All rights reserved. 29
  • 30.
    You must bethis tall to use Microservices… • RAPID PROVISIONING • BASIC MONITORING • RAPID APPLICATION DEPLOYMENT • DEVOPS CULTURE © Copyright 2014 Pivotal. All rights reserved. 30 https://www.flickr.com/photos/gusset/3723961589 http://martinfowler.com/bliki/MicroservicePrerequisites.html
  • 31.
    It’s gonna takea platform… © Copyright 2014 Pivotal. All rights reserved. 31 Pivotal CF Spring Cloud
  • 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 © Copyright 2014 Pivotal. All rights reserved. 32
  • 33.
    http://projects.spring.io/spring-cloud © Copyright2014 Pivotal. All rights reserved. 33
  • 34.
    • Eureka •Hystrix + Turbine • Ribbon • Feign • Zuul • Archaius + http://netflix.github.io © Copyright 2014 Pivotal. All rights reserved. 34
  • 35.
    Pivotal CF +Spring Cloud + Netflix OSS! © Copyright 2014 Pivotal. All rights reserved. 35
  • 36.
    DEMO © Copyright2014 Pivotal. All rights reserved. 36
  • 37.
    Supporting Rapid Change DevOps Δ © Copyright 2014 Pivotal. All rights reserved. 37 Microservices is the first architectural style developed: POST & POST Continuous Delivery
  • 38.
    Architecture is abstractuntil it is operationalized. Neal Ford © Copyright 2014 Pivotal. All rights reserved. 38
  • 39.
    Architectures that aren’toperationalized exist only on whiteboards. Matt Stine © Copyright 2014 Pivotal. All rights reserved. 39
  • 40.
    OPERATIONALIZED ARCHITECTURE ©Copyright 2014 Pivotal. All rights reserved. 40 Microservices Pivotal CF Spring Cloud
  • 41.
    A NEW PLATFORMFOR A NEW ERA