Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Microservices Technology Stack

13.371 visualizaciones

Publicado el

Overview of all technologies that you can use to support Microservice applications. Covers integration, operations and testing.

Publicado en: Software
  • Sé el primero en comentar

Microservices Technology Stack

  1. 1. Microservices Technology Stack Eberhard Wolff Fellow, innoQ @ewolff
  2. 2. http://microservices-buch.de/ http://microservices-book.com/
  3. 3. http://microservices-book.com/primer.html FREE!!!!
  4. 4. Microservices = Independent Deployment Units
  5. 5. Why can’t I just deploy Microservices on an Java EE server?
  6. 6. Microservices are just small REST services, right?
  7. 7. Integration
  8. 8. Components Collaborate Micro Service Micro Service Link Data Replication REST Messaging
  9. 9. UI Integration
  10. 10. Browser Order History Recommendation Order Microservice Recommendation Microservice
  11. 11. Server-side integration Browser UI 1 UI 2 Frontend Server Backend 1 Backend 2
  12. 12. Server-side Integration: Technologies > ESI (Edge Side Include) > E.g. Varnish cache > SSI (Server Side Include) > E.g. Apache httpd, nginx > Portal Server + Portlets
  13. 13. ESI (Edge Side Includes) ... <div> ... a lot of static content and images ... </div> ... ... <header> ... Logged in as: Ada Lovelace ... </header> <div> some dynamic content </div>
  14. 14. ESI (Edge Side Includes) ... <div> ... a lot of static content and images ... </div> ... ... <esi:include src="http://example.com/header" /> <esi:include src="http://example.com/dynamic" /> http://www.w3.org/TR/esi-lang
  15. 15. Portal Server > Broad support and used in many projects > Compose web application of Portlets > Portlets might be deployed independently Portal Server Portlet 1 Portlet 2 Browser UI 1 UI 2
  16. 16. Portal Server: Challenges > Do not really integrate diverse backends > Web Services for Remote Portlets (WSRP) still require Portlets > Portlets allow customization by user… > ...which make them very different from normal web applications
  17. 17. Portal Server > No support for non-Java technologies > Programming model very different from normal web applications > Why would you use Portal Servers?
  18. 18. Client-side integration > Client requirements (e.g. CORS, JS) > Upcoming: HMTL Imports Browser UI 1 UI 2 Backend 1 Backend 2
  19. 19. Client-side Integration: Code $("a.embeddable").each(function(i, link) { $("<div />").load(link.href, function(data, status, xhr) { $(link).replaceWith(this.children); }); }); > Replace <a href= " " class= "embeddable"> with content of document in a <div> (jQuery)
  20. 20. Logic Integration
  21. 21. Messaging Microservice Microservice !! !
  22. 22. Messaging > Natural fit for asynchronous communications > E.g. event-driven > Decoupling: Sender and Receiver only know topic / queue > Re-submission for resilience > Not natural for synchonous communication
  23. 23. REST ? # Microservice Microservice
  24. 24. REST > Natural fit for synchronous communications > Evolvability with HATEOS > Content negiotation > Not natural for asynchonous communication
  25. 25. https://jaxenter.de/ microservices-rest-vs- messaging-29875
  26. 26. Service Discovery > Services need to find each other > Enables load balancing > For REST only > E.g. DNS
  27. 27. Netflix Eureka > Cache on the client > Quick > Proven > Support for non-Java systems with sidecar only > No DNS
  28. 28. Hashicorp Consul > DNS interface > Supports storing configuration > Consul templates to create configuration files > Product
  29. 29. Resilience > Service not available? > Cicuit breaker > Fail fast > Time out > Hystrix > DO NOT IMPLEMENT RESILIENCE YOURSELF!
  30. 30. Proxy Load Balancing > Centralized Load Balancing > Can become bottle neck > Single point of failure Load Balancer Server Client
  31. 31. Client Ribbon: Client Side Load Balancing > Decentralized Load Balancing > No bottle neck > Resilient > Can consider response time > Data might be inconsistent Load Balancer Server
  32. 32. Client Alternative: External Load Balancer > Nginx, Apache httpd… > Probably for each used Microservices > Must each be configured Load Balancer Server
  33. 33. REST Service Discovery Resilience Load Balancing Messaging
  34. 34. Security > Single Sign on for all Microservices > Each Microservice decides about access policy
  35. 35. Client Security Server User / password Token with role Micro- service Request with Token Access / no access
  36. 36. Security > JSON Web Token (JWT) > Define standard for tokens > Includes additional data > Can be stored in a cookie
  37. 37. Testing
  38. 38. Search User Order Process Microservice Continuous Delivery Pipeline Integration Tests … Microservice Continuous Delivery Pipeline Microservice Continuous Delivery Pipeline Production
  39. 39. Microservices = Independent Deployment Units
  40. 40. No independent testing = no independent deployment
  41. 41. Integration Test = Bottleneck
  42. 42. Microservice Microservice Request Reply
  43. 43. Microservice Stub Request Reply
  44. 44. Stubs > Does the calling Microservice work as expected? > Use stubs to replace called Microservice
  45. 45. Microservice Microservice Request Reply
  46. 46. Consumer- Driven Contract Test Microservice Request Reply
  47. 47. Could just use some stub / test tool.
  48. 48. Consumer-driven Contract Test > Does the called Microservice work as expected? > Use consumer-driven contract test to replace calling Microservice > Easy to test changes to interfaces
  49. 49. Record Microservice Microservice Request Reply
  50. 50. Record Consumer- driven contract test Microservice Replay request Validate reply
  51. 51. Record Microservice Stub Request Replay reply
  52. 52. > Pact https://github.com/realestate-com-au/pact > Pacto https://github.com/thoughtworks/pacto > Wiremock http://wiremock.org/
  53. 53. Operations
  54. 54. Hold my orange juice while I deploy a Microservice!
  55. 55. Deployment Not Easy > Lots of microservices > Lots of stages > Deployment automation mandatory
  56. 56. Order Billing Customer Commit Stage Automated Acceptance Testing Automated Capacity Testing Manual Explorative Testing Release Commit Stage Automated Acceptance Testing Automated Capacity Testing Manual Explorative Testing Release Commit Stage Automated Acceptance Testing Automated Capacity Testing Manual Explorative Testing Release
  57. 57. Deployment Automation > Deployment automation mandatory > Significant investment > …but worth it!!
  58. 58. Docker Images > Easy to build > Dockerfile = shell script > Very efficient > …even for small changes > Unfamiliar to Ops > Replace VMware with Kubernetes?
  59. 59. CD Tools > Puppet, Chef etc > Idempotent installation > E.g. easy update > Complex > Idempotent / updates not needed for Docker
  60. 60. Linux Packages > Simple format > Centralized installation easy > Unfamiliar to devs
  61. 61. Hold my orange juice while I grep the logs for all Microservices!
  62. 62. Far too many files on far too many logs!
  63. 63. Centralized Logging > Collect all logs on one server > No need for local logs > Read-only file system?
  64. 64. ELK Stack > Logstash: JRuby > Inputs, Parser, Outputs > Elasticsearch: Storage, Java > Kibana: Analysis, JavaScript Logfile Logstash Elastic- search Kibana Parse Store Analyze
  65. 65. Graylog > Open Source > Elasticsearch for storage > MongoDB for Meta data > GELF format for log messages
  66. 66. More Alternatives > Splunk: commercial > +Cloud > Cloud : Loggly > Sumo Logic > Papertrail
  67. 67. Hold my orange juice while I do top on my server!
  68. 68. Far too many servers!
  69. 69. Centralized Metrics > Collect all metrics on one server > Not just operating system, network > …but in particular application
  70. 70. Whisper Timeseries DB Graphite Web Carbon Data Library, writes / reads files Analysis Graphite
  71. 71. Alternatives > Nagios: Open Source monitoring > Icinga: Originally Nagios fork > Many commercial tools (HP, IBM, CA, BMC) > Riemann: functional programming for event streams > New Relic: Example for cloud
  72. 72. Alternatives > TICK stack > InfluxDB: Time-Series Database, also useful for Graphite > Telegraf: Collects data > Chronograf: Visulization > Kapacitor: Alerts, anomaly detection
  73. 73. Alternatives > Packetbeat: uses Elasticsearch for storage > …and Kibana for analysis
  74. 74. Hold my orange juice while I configure my server!
  75. 75. Configuration Files > Easy to create > Servers self- contained > No centralized update possible > Needed with canary releasing?
  76. 76. Configuration Server > Easy to push out changes to all servers > Can be the same server as for services discovery > Additional technology
  77. 77. > Managing secrets > Lease secrets > Revoke secrets > Key rolling > Audit logs
  78. 78. Microservice Frameworks > Lots and lots of them > Each Microservice might use a different > Not too much influence on the overall system
  79. 79. > Deployment Automation > Centralized Logging & Monitoring > Configuration > Messaging or > REST + Service Discovery + Reslience + Load Balancing > Stubs & Consumer-driven Contract tests Operations Communication Testing
  80. 80. So much stuff!
  81. 81. Technologies solve problems.
  82. 82. Use a technology only if it solves a problem.
  83. 83. > Deployment automation is great! > Maybe Microservices finally enforce deployment automatiom? > Operation & testing requires additional effort > Communication: No DNS? No Messaging? Operations Communication Testing
  84. 84. Microservices are a trade-off!
  85. 85. Microservices create additional technical complexity!

×