Advertisement
Advertisement

More Related Content

Advertisement
Advertisement

Micro Services - Small is Beautiful

  1. Micro Services Small is Beautiful Eberhard Wolff Freelancer / adesso AG http://ewolff.com
  2. Architecture of Enterprise Java Apps
  3. Eberhard Wolff - @ewolff
  4. Eberhard Wolff - @ewolff
  5. How can I implement a new feature??? Eberhard Wolff - @ewolff
  6. Eberhard Wolff - @ewolff L
  7. ECommerce System Eberhard Wolff - @ewolff New Stuff Spring & OSGi
  8. ECommerce System Eberhard Wolff - @ewolff New Stuff NSepwri nSgtu &ff OSGi
  9. Eberhard Wolff - @ewolff HTTP New Stuff Links No legacy code Any technology J Small code base
  10. Micro Services: A Component Model • Separate process • Individual deployment unit • GUI (?) • + Logic • + database • Independent technology stacks • Small services + GUI – unlike SOA Eberhard Wolff - @ewolff
  11. Components Collaborate Eberhard Wolff - @ewolff Micro Service Micro Service Link REST Messaging Data Replication
  12. Micro Service can easily integrate with Legacy
  13. Eberhard Wolff - @ewolff Online Shop Order Catalog Search Billing
  14. Eberhard Wolff - @ewolff Online Shop elasticsearch Spring Batch Oracle Spring MVC MongoDB Order Catalog Search Billing
  15. Service might be even smaller
  16. Continuous Delivery Eberhard Wolff - @ewolff
  17. Continuous Delivery: Build Pipeline Manual Explorative Testing Eberhard Wolff - @ewolff Automated Acceptance Testing Commit Stage Automated Capacity Testing Release
  18. Without Micro Services • Modify order process slightly • Billing, Search & Catalog unchanged Eberhard Wolff - @ewolff Order Catalog Search Billing
  19. Eberhard Wolff - @ewolff Order Catalog Search Billing
  20. Continuous Delivery: Everything Tested etc Manual Explorative Testing Eberhard Wolff - @ewolff Automated Acceptance Testing Commit Stage Automated Capacity Testing Order Release Catalog Search Billing
  21. Eberhard Wolff - @ewolff Build Pipeline • Just one component changed! • Lots of unneeded work • Takes much too long
  22. With Micro Services Manual Explorative Testing Eberhard Wolff - @ewolff Automated Acceptance Testing Commit Stage Automated Capacity Testing Order Release
  23. Eberhard Wolff - @ewolff Release • Just a single component • Faster feedback • Easier deployment • Rollback of single service also easier
  24. How to scale Eberhard Wolff - @ewolff agile? Implement more feature
  25. Eberhard Wolff - @ewolff Conways Law Architecture copies communication structures of the organization
  26. Eberhard Wolff - @ewolff Online Shop Order Catalog Search Billing Component = Team
  27. Eberhard Wolff - @ewolff Micro 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 and configure App Server for each Microservice??
  30. Spring Boot Demo
  31. Why Spring Boot? Eberhard Wolff - @ewolff • Easier deployment • i.e. just a JAR • Built in operations support
  32. Eberhard Wolff - @ewolff Technologies • 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 - @ewolff Docker • No true virtualization • Linux Containers (lxc) • i.e. shared kernel • i.e. separate file systems
  36. Docker File Systems Eberhard Wolff - @ewolff • Read only base images • +read/write image • Can be stacked
  37. Eberhard Wolff - @ewolff Docker • Linux only • So: Run it in VM • Controlled by Vagrant
  38. Redis on Docker Eberhard Wolff - @ewolff • Small NoSQL database • In memory • Quite a few cool features
  39. Eberhard Wolff - @ewolff Vagrant VM Docker Container Redis 6379 6379 Port 6379
  40. Docker Demo
  41. Communication Between Docker Container Eberhard Wolff - @ewolff • Via ports • Via data volumes
  42. Docker is a Component System
  43. Example: Log File Analysis
  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 port Eberhard Wolff - @ewolff
  45. Docker, Small Services • Log file analysis • ELK Stack • Elasticsearch: Store • Logstash: Parse • Kibana: Web based GUI • Install three servers • Automate installation ... L Eberhard 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. 8080 8080 Eberhard Wolff - @ewolff Vagrant VM Container user-registration 8080 8081 Port 8081 Container elasticsearch Container logstash 9200 9200 Port 9200 9200 link Container kibana Port 8080 Browser Volume /log
  48. Demo ELK Stack
  49. Individual Scaling per Service
  50. Eberhard Wolff - @ewolff Links • 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 - @ewolff Micro 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
Advertisement