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

Microservices with Spring Cloud and Cloud Foundry

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.

Kenny Bastani

February 08, 2016
Tweet

More Decks by Kenny Bastani

Other Decks in Technology

Transcript

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

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

    4 @kennybastani Spring Developer Advocate
  3. © 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
  4. © 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
  5. © 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
  6. © 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
  7. © 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
  8. © 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
  9. © 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
  10. © 2014 Pivotal Software, Inc. All rights reserved. Spring Boot

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

    them! supports rapid development of production-ready applications and services
  12. © 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
  13. © 2014 Pivotal Software, Inc. All rights reserved. Spring Cloud

    A toolset designed for building distributed systems 23
  14. 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!! *
  15. © 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
  16. © 2014 Pivotal Software, Inc. All rights reserved. What is

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

    “To always be shipping, you need a shipyard.” 31
  18. © 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
  19. © 2014 Pivotal Software, Inc. All rights reserved. HATEOAS Hypermedia

    as the Engine of Application State (REST APIs that self-describe) 33
  20. © 2014 Pivotal Software, Inc. All rights reserved. ©2015 Apigee.

    All Rights Reserved. Each API call provides links 37