resilience service discovery and z d deployment
play

Resilience, Service-Discovery and Z-D Deployment Bodo - PowerPoint PPT Presentation

Resilience, Service-Discovery and Z-D Deployment Bodo Junglas, York Xylander Who is leanovate? 2 100 25 people, HQ in Kreuzberg Mission: Build learning organizaIons


  1. Resilience, ¡Service-­‑Discovery ¡ and ¡Z-­‑D ¡Deployment Bodo ¡Junglas, ¡York ¡Xylander

  2. Who ¡is ¡leanovate? 2 100 25 ¡people, ¡HQ ¡in ¡Kreuzberg Mission: ¡Build ¡learning ¡organizaIons

  3. What ¡do ¡we ¡do? 3 100 Dev ¡ Meth ¡ Doing Coaching ConsulIng Training Java,Scala, ¡SPA,.. Kanban, ¡Scrum, ¡Lean*,..

  4. Promises ¡of ¡µServices ¡architectures 4 100 Independent ¡(parallel) ¡development Independent ¡release ¡cycles Independent ¡scaling

  5. Challenges ¡of ¡µServices ¡architectures 5 100 • Developing & Running • Configuring • Debugging Tough ¡to ¡learn ¡& ¡understand! • Deploying • Discovering • Resilience • …

  6. Microzon: ¡ A ¡lab ¡for ¡µServices hYps://github.com/leanovate/microzon

  7. Case ¡Study: ¡Microzon-­‑Shop ¡ 7 1001 DEMO • Browse ¡through ¡catalog ¡ • Select ¡product ¡ • Put ¡into ¡cart ¡ • Checkout

  8. Case ¡Study: ¡Microzon-­‑Shop 8 1001 Load-Balancer / Firewall Web Facade Customer Product Cart Billing mysql mysql mysql mongo

  9. Technology-­‑Babylon ¡ 9 1001 Play 2.3 Scala 2.11 Web Facade Customer Product Cart Billing Spring-Boot 1.2.1 Spray 1.3 / Akka 2.3 Scalatra Jetty Dropwizard 0.7 Scala 2.10 JPA/Hibernate JDBI … ReactiveMongo finatra 1.6 async-mysql finagle 6.20 mysql mysql mysql mongo

  10. Challenges: ¡ 10 1001 • Running: • How long does it take to get a dev system up and running for a new team member? • How to run your ci system it in your favorite cloud? • Configuring • Debugging

  11. Case ¡Study: ¡Microzon-­‑Shop ¡ 11 1001 DEMO • Start ¡system ¡with ¡docker ¡ • Create ¡products ¡ ¡ • Logstash ¡ • Zipkin

  12. Why ¡is ¡that ¡a ¡challenge? ¡ 12 1001 Web Facade Customer Product Cart Billing mysql mysql mysql mongo

  13. Why ¡is ¡that ¡a ¡challenge? ¡ 13 1001 Web Facade Customer Product Cart Billing mysql mysql mysql mongo

  14. Why ¡is ¡that ¡a ¡challenge? ¡ 14 1001 Web Facade Customer Product Cart Billing mysql mysql mysql mongo Support UI Reporting Marketing tool Payment adapter

  15. ? Why ¡is ¡that ¡a ¡challenge? ¡ 15 1001 Web Facade Customer Product Cart Billing mysql mysql mysql mongo Support UI Reporting Marketing tool Payment adapter

  16. Takeaway 16 100 Running/Configuring/Debugging • … ¡will ¡quickly ¡become ¡a ¡non-­‑trivial ¡maYer ¡ • We ¡have ¡chosen ¡… ¡ • docker ¡for ¡development ¡system ¡ • puppet ¡for ¡»producIon« ¡ • elas.csearch/logstash/kibana ¡for ¡distributed ¡ logging ¡ • zipkin ¡for ¡request ¡tracing ¡ • … ¡but ¡that ¡is ¡not ¡this ¡focus ¡of ¡this ¡talk

  17. Challenge: ¡Deploying ¡ 17 1001 Zero-downtime deployment strategies/variants: Blue/Green, Wave, Canary,… Service Version n Loadbalancer/ Router Service Deploy Delivery Version n+1 Pipeline Service Version n

  18. Challenge: ¡Service ¡discovery ¡ 18 1001 • How to remove service nodes from the cluster or take them temporary offline? • How to add new ones or take them online again? How do services find each other? => ServiceDiscovery

  19. Service ¡Discovery ¡by ¡configuraFon 19 1001 You ¡(mis)use ¡your ¡configuraIon ¡management ¡tool ¡ (puppet/chef) ¡to ¡generate ¡service ¡configuraIon ¡with ¡ explicit ¡endpoints ¡ Node1 Node2 Node3 update Config Management .................... .................... add/remove .................... .................... node entry .................... ....................

  20. Service ¡Discovery ¡by ¡configuraFon 20 1001 Pros: ¡ Simply ¡works ¡ No ¡extra ¡technology ¡involved ¡(and ¡thereby ¡no ¡extra ¡point ¡ of ¡failure) ¡ Cons: ¡ To ¡take ¡a ¡service ¡node ¡offline ¡one ¡has ¡to ¡update ¡all ¡of ¡its ¡ consumers ¡(or ¡wait ¡for ¡them ¡to ¡be ¡updated) ¡ All ¡consumers ¡have ¡to ¡be ¡able ¡to ¡reload ¡their ¡configuraIon ¡ without ¡restart ¡

  21. Service ¡Discovery ¡by ¡DNS 21 1001 DNS ¡is ¡actually ¡a ¡service ¡discovery 10.X.X.1 10.X.X.2 10.X.X.3 Product Product Product Service1 Service2 Service3 Customer { 10.X.X.1, Service 10.X.X.2, 10.X.X.3 } product.loc ? DNS

  22. DNS 22 1001 Pros: ¡ Old ¡technology ¡that ¡is ¡proven ¡to ¡work ¡on ¡a ¡very ¡very ¡large ¡ scale ¡ Supported ¡by ¡almost ¡everyone ¡ Cons: ¡ Rather ¡crude ¡(and ¡very ¡inconvenient) ¡interface ¡(especially ¡ for ¡updates) ¡ Resolved ¡service ¡names ¡might ¡be ¡cached ¡on ¡mulIple ¡levels ¡ Focusses ¡purely ¡on ¡service ¡nodes, ¡not ¡on ¡the ¡services ¡itself

  23. Also: ¡DNS ¡might ¡lead ¡to ¡wrong ¡assumpFons 23 1001 Apache HttpClient 4.3: org.apache.http.impl.conn.HttpClientConnectionOperator public void connect( ... ) throws IOException { ... final InetAddress[] addresses = this . dnsResolver .resolve(host.getHostName()); ... for ( int i = 0; i < addresses. length ; i++) { 
 final InetAddress address = addresses[i]; 
 final boolean last = i == addresses. length - 1; 
 Socket sock = sf.createSocket(context); 
 ... try { sock.setSoTimeout(socketConfig.getSoTimeout()); ... 
 conn.bind(sock); return; } catch (final SocketTimeoutException ex) { ... } catch ( final ConnectException ex) { ... } } }

  24. Service ¡discovery ¡service 24 1001 Zookeeper ¡ Customer Curator ¡ consul ¡ etcd ¡ Discovery Product Cart doozerd ¡ Service SkyDNS ¡ Eureka ¡ … Billing

  25. EvaluaFon ¡criteria 25 1001 -­‑ ¡High ¡availability ¡ -­‑ ¡Consistency ¡(consistency ¡over ¡availability?) ¡ -­‑ ¡Support ¡for ¡service-­‑level ¡checks ¡ -­‑ ¡API ¡(hYp, ¡DNS?, ¡…) ¡ -­‑ ¡Footprint ¡(Memory/CPU) ¡ -­‑ ¡MulIple ¡datacenter ¡support ¡ -­‑ ¡UI ¡ -­‑ ¡Template ¡engine ¡(for ¡config ¡files) ¡

  26. Consul 26 1001 service node A Consul server cluster health check consul agent http / dns restart consul service reload server consul consul template server config files (optional) write consul Raft server consensus service node A consul health check server consul agent consul http / dns server restart service reload consul template config files (optional) write

  27. Consul 27 1001 service node A Consul server cluster health check consul agent http / dns restart consul service reload server consul consul template server config files (optional) write consul Raft server consensus service node A consul health check server consul agent consul http / dns server restart service reload consul template config files (optional) write

  28. Consul ¡ 28 1001 DEMO • Show ¡consul ¡UI ¡ • Show ¡web-­‑service ¡status ¡page ¡ • Add ¡cart/remove ¡cart

  29. Challenge: ¡Resilience 29 1001 Every ¡system ¡has ¡a ¡retry!

  30. Do ¡not ¡do ¡failover/retry ¡on ¡connecFon ¡ 30 1001 GET ¡ok ¡ DELETE ¡ok ¡ PUT ¡ok ¡ POST ¡??? ¡ Duplicates ¡might ¡be ¡ok ¡(e.g. ¡create ¡new ¡shopping ¡cart) ¡ … ¡or ¡not ¡(e.g. ¡register ¡new ¡customer) ¡ might ¡be ¡solved ¡by ¡a ¡request ¡token ¡(e.g. ¡the ¡xsrf ¡token ¡ from ¡the ¡web) ¡as ¡long ¡as ¡the ¡service ¡supports ¡this ¡ GET ¡really ¡ok? ¡What ¡about ¡streaming?

  31. Failover ¡should ¡be ¡part ¡of ¡the ¡business ¡ 31 1001 Usually ¡the ¡failover ¡strategy ¡depends ¡on ¡the ¡ concrete ¡use-­‑case ¡ Handling ¡failover ¡on ¡the ¡protocol ¡layer ¡(hYp-­‑client) ¡ might ¡hide ¡error ¡scenarios ¡from ¡the ¡programmer ¡ It ¡can ¡be ¡difficult ¡to ¡disInguish ¡between ¡technical ¡ and ¡business ¡error ¡on ¡the ¡protocol ¡layer ¡ As ¡a ¡rule ¡of ¡thumb: ¡You ¡want ¡to ¡retry ¡all ¡technical ¡error, ¡ but ¡not ¡the ¡business ¡errors ¡ … ¡though ¡even ¡that ¡is ¡discussable ¡in ¡some ¡cases

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend