Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Microservices with Spring Cloud

530 views

Published on

Slides of a talk held at developer week 2016 Nuremberg by Paul Vassu and Daniel Eichten

Published in: Internet
  • Be the first to comment

  • Be the first to like this

Microservices with Spring Cloud

  1. 1. Microservices with Spring Cloud
  2. 2. Who are we? Daniel Eichten Paul Vassu
  3. 3. What are Microservices?
  4. 4. – Wikipedia “Microservices are a more concrete and modern interpretation of service-oriented architectures (SOA) used to build distributed software systems. Like in SOA, services in a microservice architecture are processes that communicate with each other over the network in order to fulfill a goal. Also, like in SOA, these services use technology agnostic protocols. Microservices architectural style is a first realisation of SOA that has happened after the introduction of DevOps and this is becoming the standard for building continuously deployed systems.”
  5. 5. “Microservices are fulfilling the SOA promise!” – us
  6. 6. By Webysther Nunes - Own work, CC BY-SA 4.0https://commons.wikimedia.org/w/index.php?curid=39594469 http://martinfowler.com/articles/microservices.html
  7. 7. https://www.thoughtworks.com/profiles/sam-newman
  8. 8. Microservices • Small • Focused • Doing One Thing Well “Microservices are small, autonomous services that work together.” – Sam Newman • Technology heterogenic • Resilient • Scalable • Easy to deploy
  9. 9. BUT
  10. 10. Downsides • Increased complexity through distribution • Dependency of Services • Handling of breaking changes • Operational overhead • Testing effort • Distributed transactions
  11. 11. Do or don’t …
  12. 12. http://pcwallart.com/master-yoda-star-wars-wallpaper-2.html Yoda
  13. 13. … there is no try!?
  14. 14. https://pixabay.com/en/darth-vader-star-wars-geek-1207142/
  15. 15. Spring Boot • Convention-over-Configuration • Creates Standalone Applications • Embedded Container • Autoconfiguration • No XML SitUps • No Yak Shaving
  16. 16. Hello Weather!
  17. 17. HTML+ jQuery DB App OpenWeather
  18. 18. Controllers Services Repository Client DB REST-API HTML JS (jQuery)
  19. 19. Why Monoliths are bad! • Changeability / Flexibility • Maintainability • Scalability • Resilience • Framework/Tech-Stack Lock-in
  20. 20. So, where to start?!?
  21. 21. HTML+ jQuery DB OpenWeather Resource Services
  22. 22. HTML+ jQuery DB OpenWeather Resource Services Gateway
  23. 23. Spring Cloud [Netflix] • Proxy/Router – Zuul • Service Registry and Discovery — Eureka • Cirtcuit Breaker — Hystrix • (Client Side) Load Balancing — Ribbon • Configuration Management — Archaius
  24. 24. Say hello to Zuul!
  25. 25. Works, but not nice!
  26. 26. Static routes • are hard to maintain • have to be updated when service instance changes • do not offer load balancing between multiple instances • do not cater for service failures
  27. 27. HTML+ jQuery DB OpenWeatherResource Services Gateway Registry
  28. 28. HTML+ jQuery DB OpenWeatherResource Services Gateway Registry Services
  29. 29. Please welcome Eureka!
  30. 30. The services are still mixing members with weather.
  31. 31. DB OpenWeather ServicesGateway
  32. 32. DB OpenWeather Services Gateway Services
  33. 33. DB OpenWeather Gateway members weather
  34. 34. demo
  35. 35. What’s next?
  36. 36. Distributed Tracing
  37. 37. HTML+ jQuery DB OpenWeather Resource Gateway Registry members weather Zipkin
  38. 38. Greetings Zipkin
  39. 39. Circuit Breaker
  40. 40. Why? Gateway A B C D E F G H I J Request Request H Request Request Request Request Request
  41. 41. Why? 99.5% uptime( )1010 components: ≈ 95% — 1 hour down / day 99.5% uptime( )2020 components: ≈ 90% — 2.5 hour down / day 99.5% uptime( )3030 components: ≈ 86% — 3+ hour down / day
  42. 42. How? • Fail fast, fail silent, rapidly recover • Stop cascading issues • Fallback gracefully (where possible) • Enable Monitoring, Alerting
  43. 43. HTML+ jQuery DB OpenWeather Resource Gateway Registry members weather turbine hystrix dashboard
  44. 44. Hej Hystrix/Turbine
  45. 45. One more thing A few s
  46. 46. Polyglotism • different languages • different frameworks • different datastores • Eureka very specific for AWS  😕 • Eureka Client lib Java only 😩
  47. 47. What about .net? • Nancy – Microservice Framework • Polly – Circuit Breaker • a lot to come with ASP.Net Core 11/13 chapters done release in Fall 2016
  48. 48. Eureka @EnableDiscoveryClient
  49. 49. • distributed Key-Value-Store • REST Interface • DNS Interface # • Multi Datacenter • Client libs for Go, Python, PHP, Scala, Java, Erlang, Ruby, node.js and C# • Replaces Eureka, Config Server, Cloud Bus
  50. 50. • distributed Key-Value-Store • REST Interface • DNS Interface with SkyDNS • very lightweight • easy to use • Client libs for Go, Python, Java, Scala, node.js, Ruby, C, C++, C#, Clojure, Erlang, PHP, Haskell, R, … • Replaces Eureka, Config Server
  51. 51. • distributed Key-Value-Store • build in Java originally to do Leader Election for Hadoop Clusters • very mature and stable / huge community • Client libs for Java, C#, PHP, Ruby, node.js, … • Curator by Netflix makes things easier • Replaces Eureka, Config Server and brings Leader Election, e.g. for Scheduled tasks in a whole cluster. Zookeeper
  52. 52. What else? • Spring Cloud Task – AWS 𝜆-like API • Spring Cloud Security – OAuth2 Infrastructure • Spring Cloud Bus – Messaging between all components using Redis, AMQP, RabbitMQ, … • Spring Cloud Stream – Message driven Microservices using Redis, Kafka, RabbitMQ, …
  53. 53. ?
  54. 54. Daniel Eichten daniel.eichten@adidas-group.com @danieleichten Paul Vassu paul.vassu@adidas-group.com http://www.slideshare.net/DanielEichten/microservices-with-spring-cloud-63291299 https://github.com/deichten/dwx-spring-cloud https://github.com/deichten/dwx-spring-cloud-config

×