micro services - small is beautiful

Download Micro Services - Small is Beautiful

Post on 14-Jan-2015




3 download

Embed Size (px)


General int


  • 1. Micro ServicesSmall is BeautifulEberhard WolffFreelancer / adesso AGhttp://ewolff.com

2. Architectureof EnterpriseJava Apps 3. Eberhard Wolff - @ewolff 4. Eberhard Wolff - @ewolff 5. How can Iimplement anew feature???Eberhard Wolff - @ewolff 6. Eberhard Wolff - @ewolff L 7. ECommerce SystemEberhard Wolff - @ewolffNew StuffSpring &OSGi 8. ECommerce SystemEberhard Wolff - @ewolffNew StuffNSepwri nSgtu &ffOSGi 9. Eberhard Wolff - @ewolffHTTPNewStuffLinksNo legacy codeAny technologyJ Small code base 10. Micro Services:A Component Model Separate process Individual deployment unit GUI (?) + Logic + database Independent technology stacks Small services + GUI unlike SOAEberhard Wolff - @ewolff 11. Components CollaborateEberhard Wolff - @ewolffMicroServiceMicroServiceLinkRESTMessagingData Replication 12. Micro Servicecan easilyintegratewith Legacy 13. Eberhard Wolff - @ewolffOnline ShopOrderCatalogSearchBilling 14. Eberhard Wolff - @ewolffOnline ShopelasticsearchSpring BatchOracleSpring MVCMongoDBOrderCatalogSearchBilling 15. Service mightbe evensmaller 16. ContinuousDeliveryEberhard Wolff - @ewolff 17. Continuous Delivery:Build PipelineManualExplorativeTestingEberhard Wolff - @ewolffAutomatedAcceptanceTestingCommitStageAutomatedCapacityTestingRelease 18. Without Micro Services Modify order process slightly Billing, Search & Catalog unchangedEberhard Wolff - @ewolffOrderCatalogSearchBilling 19. Eberhard Wolff - @ewolffOrderCatalogSearchBilling 20. Continuous Delivery:Everything Tested etcManualExplorativeTestingEberhard Wolff - @ewolffAutomatedAcceptanceTestingCommitStageAutomatedCapacityTestingOrderRelease CatalogSearchBilling 21. Eberhard Wolff - @ewolffBuild Pipeline Just one component changed! Lots of unneeded work Takes much too long 22. With Micro ServicesManualExplorativeTestingEberhard Wolff - @ewolffAutomatedAcceptanceTestingCommitStageAutomatedCapacityTestingOrder Release 23. Eberhard Wolff - @ewolffRelease Just a single component Faster feedback Easier deployment Rollback of single service also easier 24. How to scaleEberhard Wolff - @ewolffagile?Implementmore feature 25. Eberhard Wolff - @ewolffConways LawArchitecturecopiescommunication structuresof the organization 26. Eberhard Wolff - @ewolffOnline ShopOrderCatalogSearchBillingComponent = Team 27. Eberhard Wolff - @ewolffMicro Service Team independent from each other No code dependencies Can use individual technology stack Can even deploy independently Speed up development 28. Architecture Challenges Code Reuse? Handling interfaces? Managing dependencies between(>100) Services? Global architecture? Global refactorings?Eberhard Wolff - @ewolff 29. Install andconfigure AppServer for eachMicroservice?? 30. Spring BootDemo 31. Why Spring Boot?Eberhard Wolff - @ewolff Easier deployment i.e. just a JAR Built in operations support 32. Eberhard Wolff - @ewolffTechnologies Dropwizard by Yammer Vert.x Play Framework 33. Deploy &Operate? 34. Component Model No restriction on languag &environment Individual processes + infrastructure (database etc) JARs, WARs, EARs: No good fit Virtual machines as components? Overhead??Eberhard Wolff - @ewolff 35. Eberhard Wolff - @ewolffDocker No true virtualization Linux Containers (lxc) i.e. shared kernel i.e. separate file systems 36. Docker File SystemsEberhard Wolff - @ewolff Read only base images +read/write image Can be stacked 37. Eberhard Wolff - @ewolffDocker Linux only So: Run it in VM Controlled by Vagrant 38. Redis on DockerEberhard Wolff - @ewolff Small NoSQL database In memory Quite a few cool features 39. Eberhard Wolff - @ewolffVagrant VMDocker ContainerRedis63796379Port6379 40. Docker Demo 41. Communication BetweenDocker ContainerEberhard Wolff - @ewolff Via ports Via data volumes 42. Docker is aComponentSystem 43. Example:Log FileAnalysis 44. No Docker, no Micro Services Log file analysis One Application Store (database) Parse GUI One artifact on one server Logs provided e.g. by a portEberhard Wolff - @ewolff 45. Docker, Small Services Log file analysis ELK Stack Elasticsearch: Store Logstash: Parse Kibana: Web based GUI Install three servers Automate installation ... LEberhard Wolff - @ewolff 46. Dockerized ELK Stack 1 Vagrantfile (25 lines) 6 Dockerfiles (total 22 lines) 1 HTML file (11 lines) 1 Config (Logstash) (29 lines)Eberhard Wolff - @ewolff Total: 87 lines, 9 files Including one RegExp L 47. 80808080Eberhard Wolff - @ewolffVagrant VMContaineruser-registration80808081Port8081ContainerelasticsearchContainerlogstash92009200Port92009200linkContainerkibanaPort8080BrowserVolume/log 48. Demo ELKStack 49. IndividualScaling perService 50. Eberhard Wolff - @ewolffLinks https://github.com/ewolff/user-registration http://www.heise.de/developer/artikel/Episode-44-Modularisierte-Architektur-fuer-grosse-Systeme-2195818.html http://projects.spring.io/spring-boot/ http://www.docker.com/ http://www.docker.com/tryit 51. Eberhard Wolff - @ewolff 52. Eberhard Wolff - @ewolffMicro Services A new hope against Java Monoliths Also great for legacy Spring Boot for implementation Docker as component model &runtime 53. Thank You!!Eberhard Wolff - @ewolff@ewolff