Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Migrating to microservices (Carlos Queiroz)

SingaSUG
October 22, 2015

Migrating to microservices (Carlos Queiroz)

SingaSUG

October 22, 2015
Tweet

More Decks by SingaSUG

Other Decks in Technology

Transcript

  1. 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
  2. 4 © 2015 Pivotal Software, Inc. All rights reserved. Why?

    • SPEED • SAFETY • SCALE • MOBILITY
  3. 5 © 2015 Pivotal Software, Inc. All rights reserved. Cloud

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

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

    Coupled If every service has to be updated in concert, it’s not loosely coupled!
  6. 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.
  7. 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
  8. 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
  9. 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
  10. 19 © 2015 Pivotal Software, Inc. All rights reserved. Platforms

    http://heroku.com http://cloudfoundry.org
  11. 20 © 2015 Pivotal Software, Inc. All rights reserved. Frameworks

    http://www.dropwizard.io http://projects.spring.io/spring-boot
  12. 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
  13. 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
  14. 25 © 2015 Pivotal Software, Inc. All rights reserved. Patterns

    on-deck • Consistent and Distributed Configuration • Service Registration and Discovery
  15. 32 © 2015 Pivotal Software, Inc. All rights reserved. https://bitbucket.org/caxqueiroz/configserver-data-

    public/src/798c0a25b54fbc597ca417211d99a5a5433c4016/demo.y ml Greeting: Guten Tag
  16. 44 © 2015 Pivotal Software, Inc. All rights reserved. Patterns

    on-deck • Routing/Load Balancing • Fault Tolerance