Save 37% off PRO during our Black Friday Sale! »

Microservices with Spring Cloud and Cloud Foundry

833d3a69650b8ac7e0d85c39650c505d?s=47 Kenny Bastani
February 08, 2016

Microservices with Spring Cloud and Cloud Foundry

In this talk I will introduce you to Spring Cloud, a set of tools for building cloud-native JVM applications. We will take a look at some of the common patterns for microservice architectures and how to use Cloud Foundry to deploy multiple microservices to the cloud.

We will also dive into a microservices example project of a cloud-native application built using Spring Boot and Spring Cloud. Using this example project, I'll show you how to use Cloud Foundry to spin up a microservice cluster. We will then explore what a cloud-native application looks like when using self-describing REST APIs that link multiple microservices together.

833d3a69650b8ac7e0d85c39650c505d?s=128

Kenny Bastani

February 08, 2016
Tweet

Transcript

  1. © 2014 Pivotal Software, Inc. All rights reserved. 1

  2. © 2014 Pivotal Software, Inc. All rights reserved. Microservices with

    Spring Cloud and Cloud Foundry Kenny Bastani Spring Developer Advocate 2
  3. © 2014 Pivotal Software, Inc. All rights reserved. Speaker Intro

    3
  4. © 2014 Pivotal Software, Inc. All rights reserved. Kenny Bastani

    4 @kennybastani Spring Developer Advocate
  5. © 2014 Pivotal Software, Inc. All rights reserved. Agenda 5

    1 Agenda 2 Microservices 3 Spring Boot 4 Spring Cloud 5 Cloud Foundry 6 HATEOAS - Self-describing APIs 7 Live code
  6. © 2014 Pivotal Software, Inc. All rights reserved. Microservices “Kind

    of like a head ache, but more of them.” 6
  7. Source: Adrian Cockcroft 
 http://www.slideshare.net/adrianco water-scrum-fall increases clock time, waste

  8. Source: Adrian Cockcroft 
 http://www.slideshare.net/adrianco microservices enable feature teams

  9. © 2014 Pivotal Software, Inc. All rights reserved. Twelve Factor

    Applications - http://12factor.net/ • Use declarative formats for setup automation, to minimize time and cost for new developers joining the project; • Have a clean contract with the underlying operating system, offering maximum portability between execution environments; • Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration; • Minimize divergence between development and production, enabling continuous deployment for maximum agility; • And can scale up without significant changes to tooling, architecture, or development practices. 9
  10. © 2014 Pivotal Software, Inc. All rights reserved. 10

  11. © 2014 Pivotal Software, Inc. All rights reserved. 11

  12. © 2014 Pivotal Software, Inc. All rights reserved. What is

    Cloud Native? 12 • Cloud native is a mindset for continuously building and shipping your apps into production
  13. © 2014 Pivotal Software, Inc. All rights reserved. Microservices -

    Polyglot Persistence • Each team gets one database and one service • Shared caches are platform provided services that are shared for consistency 13
  14. © 2014 Pivotal Software, Inc. All rights reserved. Cloud-native Deployments

    • Each microservice can be containerized with their application dependencies • Containers get scheduled on virtual machines with an allotted resource policy 14
  15. © 2014 Pivotal Software, Inc. All rights reserved. Auto-scaling •

    An elastic runtime handles auto-scaling of VMs with cloud providers • Microservices should be load balanced vertically and not horizontally 15
  16. © 2014 Pivotal Software, Inc. All rights reserved. Composition &

    Orchestration • Each microservice needs to communicate outside containers • Service discovery provides an automatic method for finding other service dependencies 16
  17. © 2014 Pivotal Software, Inc. All rights reserved. Spring Boot

    A JVM micro-framework for building microservices 17
  18. spring boot it’s going to take an API.. lots of

    them! supports rapid development of production-ready applications and services
  19. © 2014 Pivotal Software, Inc. All rights reserved. What is

    Spring Boot? 19
  20. © 2014 Pivotal Software, Inc. All rights reserved. Spring Boot

    Roles 20
  21. © 2014 Pivotal Software, Inc. All rights reserved. Automatic Configuration

    • An application class is annotated with @SpringBootApplication • Additional annotations are added to indicate the role of the Spring Boot application 21
  22. © 2014 Pivotal Software, Inc. All rights reserved. Spring Boot

    for Microservices 22
  23. © 2014 Pivotal Software, Inc. All rights reserved. Spring Cloud

    A toolset designed for building distributed systems 23
  24. spring cloud Apache Zookeeper these logos are all trademark/copyright their

    respective owners (T-B, L-R): 
 
 Netflix, amazon.com, Apache Software Foundation, Cloud Foundry, Hashicorp they are ALL great organizations and we love their open-source and their APIs!! *
  25. © 2014 Pivotal Software, Inc. All rights reserved. What is

    Spring Cloud? • Spring Cloud provides a way to turn Spring Boot microservices into distributed applications 25
  26. © 2014 Pivotal Software, Inc. All rights reserved. What is

    Spring Cloud? 26 ✴ Service Discovery ✴ API Gateway ✴ Circuit Breakers ✴ Distributed Tracing
  27. © 2014 Pivotal Software, Inc. All rights reserved. Service Discovery

    & Intelligent Routing 27
  28. © 2014 Pivotal Software, Inc. All rights reserved. 28 Client-side

    load balancing
  29. © 2014 Pivotal Software, Inc. All rights reserved. Configuration Service

    29
  30. © 2014 Pivotal Software, Inc. All rights reserved. API Gateway

    30
  31. © 2014 Pivotal Software, Inc. All rights reserved. Cloud Foundry

    “To always be shipping, you need a shipyard.” 31
  32. © 2014 Pivotal Software, Inc. All rights reserved. Cloud Foundry

    is an opinionated platform for organizations that build and operate software as a core part of their business Opinionated Platforms 32 “I am good at selling many treehouses!” Opinionated “I once built a treehouse for my kids!” Unopinionated
  33. © 2014 Pivotal Software, Inc. All rights reserved. HATEOAS Hypermedia

    as the Engine of Application State (REST APIs that self-describe) 33
  34. © 2014 Pivotal Software, Inc. All rights reserved. It’s pronounced

    hawt-ee-oh-as 34
  35. © 2014 Pivotal Software, Inc. All rights reserved. Richardson Maturity

    Model 35 Photo credit: Packt Publishing
  36. © 2014 Pivotal Software, Inc. All rights reserved. Browsing REST

    APIs 36
  37. © 2014 Pivotal Software, Inc. All rights reserved. ©2015 Apigee.

    All Rights Reserved. Each API call provides links 37
  38. © 2014 Pivotal Software, Inc. All rights reserved. Thanks :)


    kbastani@pivotal.io
 38