O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Long Live and Prosper To Monolith

247 visualizações

Publicada em

PResentationdone in GeeCon Prague about Monolith and microservices

Publicada em: Software
  • Seja o primeiro a comentar

Long Live and Prosper To Monolith

  1. 1. Live Long and Prosper to Monolith Alex Soto @alexsotob Prague, 18-19 October 2018
  2. 2. @alexsotob2 Alex Soto Red Hat Engineer www.lordofthejars.com @alexsotob Who Am I?
  3. 3. @alexsotob3 https://www.manning.com/books/testing-java-microservices
  4. 4. @alexsotob4 Questions
  5. 5. @alexsotob5
  6. 6. @alexsotob6
  7. 7. @alexsotob7 … due to the given burdens of cost and organisational maturity, microservices will likely never reach the Adopt phase“ Rebecca Parsons - CTO at ThoughtWorks
  8. 8. @alexsotob8
  9. 9. @alexsotob9 Isolation of Code
  10. 10. @alexsotob10 Isolation of Code review api impl detail api impl game api impl public exposes only what is required favour low-coupling private highly cohesive reduces our memory footprint IMPL API Code Asset, Java 9 Modules
  11. 11. @alexsotob11 Isolation of Code Java 9 - Modules module-info.java
  12. 12. @alexsotob12 Isolation of Data
  13. 13. @alexsotob13 Isolation of Data game schema Game Detail detail schema Reviewreview schema Module == Schema Joins inside Schema Referential Integrity across Schemas Global transactions
  14. 14. @alexsotob14 Isolation of Data game schema Game Detail detail schema Reviewreview schema .sql .sql .sql .sql .sql ? ? ?
  15. 15. @alexsotob15 Isolation of Data
  16. 16. @alexsotob16 Isolation of Data DB V2__Update.sql V1__Initial.sql SCHEMA_VERSION
  17. 17. @alexsotob17 Isolation of Data Flyway f = new Flyway(); f.setDataSource(); f.migrate(); mvn flyway:migrate <configuration> <url>..</url> … </configuration> <flyway:migrate url=“” user=“”/> flyway migrate -url=… -user=… gradle flywayMigrate flyway { url=“..” user=“.. }
  18. 18. @alexsotob18 Reactive Extensions
  19. 19. @alexsotob19 Reactive Java Creates Stream Sends data Where to Run Combiner How to combine Final Run
  20. 20. @alexsotob20 Network
  21. 21. @alexsotob21 Circuit Breaker Pattern
  22. 22. @alexsotob22 Circuit Breaker Pattern Closed Open Half Open success error [under threshold] fail [threshold reached] success reset timeoutfail
  23. 23. @alexsotob23 Circuit Breaker Defines CB Wrapped function Recovery
  24. 24. @alexsotob24 DEMO
  25. 25. @alexsotob25
  26. 26. @alexsotob26
  27. 27. @alexsotob27 Your code has NO BUSINESS VALUE until it’s deployed
  28. 28. @alexsotob28
  29. 29. @alexsotob29 OPS PMO DBASECBIZ DEV QA
  30. 30. @alexsotob30
  31. 31. @alexsotob31 Your Stack Matters Server Hardware Operating System Application Server your.war Java Virtual Machine Custom Configuration Linux Kernel Version & Distribution Java 1.7.0_67 Tomcat, Wildfly, Jetty JDBC driver, users
  32. 32. @alexsotob32 DevOps Challenges for Multiple Containers ▪ How to scale? ▪ How to avoid port conflicts? ▪ How to manage them on multiple hosts? ▪ What happens if a host has trouble? ▪ How to keep them running? ▪ How to update them? ▪ Where are my containers? Node Node Node Node Node Logger Node
  33. 33. @alexsotob33 ssh docker run ssh docker run ssh docker run
  34. 34. @alexsotob34
  35. 35. @alexsotob35 ▪ Greek for “Helmsman,” also the root of the word “Governor” (from latin: gubernator) ▪ Container orchestrator ▪ Supports multiple cloud and bare-metal environments ▪ Inspired by Google’s experience with containers ▪ Open source, written in Go ▪ Manage applications, not machines Meet Kubernetes
  36. 36. @alexsotob36 Kubernetes Cluster Ops Dev Master api etcd scheduler controllers Node Node Node Node Node Logger Node
  37. 37. @alexsotob37 Infrastructure
  38. 38. @alexsotob38 Deploying in Cluster Always two instances of the image Docker image to run Port
  39. 39. @alexsotob39 Deploying in Cluster Reverse Proxy Router Number of instances LB
  40. 40. @alexsotob40 Cloud Native Application
  41. 41. @alexsotob41 Infrastructure sticky session Shopping Cart User A
  42. 42. @alexsotob42 In-Memory Data Grid In-Memory DataGrid Shopping Cart User A Shopping Cart User A
  43. 43. @alexsotob43 Release as Unicorns
  44. 44. @alexsotob44 Release as Unicorns Build Dockerfile DeployBuild Container Testing in Production Release s2i, OpenShift, Fabric8, Istio Teiid, Debezium (Test Prod)
  45. 45. @alexsotob45 Let’s Wind Down
  46. 46. @alexsotob46 Advantages of monolith > Local Calls > All parts always up > Easy to debug > Easy to test > Refactor without running surprises > You see the real world every time > Easy to deploy (coordination) > Polyglot Languages, DB
  47. 47. @alexsotob47 Digital Darwinism Self-Service, On-Demand, Elastic, Infrastructure as Code (Cloud) Re-Org to DevOps Automation Puppet, Chef, Ansible
 and/or Kubernetes CI & CD Deployment Pipeline Advanced Deployment Techniques Microservices
  48. 48. @alexsotob48 https://www.slideshare.net/dbryant_uk/oreilly-sacon-ny-2018-continuous-delivery-patterns-for-contemporary-architecture/2 You In The Near Future
  49. 49. @alexsotob49
  50. 50. @alexsotob50 Stats service User Service Awards Service Question Service Advertise Service Question Service
  51. 51. @alexsotob51 NO, it is a monolith https://www.infoq.com/news/2015/06/scaling-stack-overflow
  52. 52. @alexsotob52
  53. 53. @alexsotob53
  54. 54. @alexsotob asotobue@redhat.com

×