Publicité
Publicité

Contenu connexe

Similaire à Lessons Learned from Migrating Legacy Enterprise Applications to Microservices(20)

Publicité

Plus de VMware Tanzu(20)

Publicité

Lessons Learned from Migrating Legacy Enterprise Applications to Microservices

  1. Lessons Learned from Migrating Legacy Enterprise Applications to Microservices Ross Zhang (@ross_zhang) Jun Li (@jeffreyjunli) SpringOne Platform 2016
  2. Disclaimer All the opinions and views expressed in this presentation and talk are strictly those of the presenter and they do not necessarily reflect those of the institution to which he is affiliated.
  3. Agenda ● Our Journey ● Pain Points ● Puzzle Pieces to Migrate to Microservices ● Lessons Learned ● Future Work ● Q & A ● Glossary
  4. All icon and image copyrights are reserved by original owners Our Journey 1996 Smalltalk & RPG program 2006 Java EE, EJB2, SOAP, Struts, Wicket, JSP, Hibernate 2011 Spring 3, Spring MVC, Spring Security, JSP... 2013 2014 2015 2016 Spring Boot 0.5.0 Spring Boot 1.0.0 Spring Boot Spring Boot, Spring Cloud, PCF
  5. Smalltalk Application Green Screen app SOAP AS400 (20 years old) Application Server EAR - Enterprise Archive MQ Caching Security Load balancing Logging JNDIEAR - Enterprise Archive EAR - Enterprise Archive Migration Journey
  6. Pain Points ● Development ● Deployment ● Operations
  7. Development Pain Points Dev env takes too long to set up Jar hell Framework configurations
  8. Deployment Pain Points Slow Unstable Downtime
  9. Operation Pain Points No application health check No log aggregation or analysis
  10. Microservices The term "Microservice Architecture" has sprung up over the last few years to describe a particular way of designing software applications as suites of independently deployable services. While there is no precise definition of this architectural style, there are certain common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data. - - Martin Fowler (http://martinfowler.com/articles/microservices.html)
  11. Migrating to Microservices Puzzle #0 Problem: application server What we tried: ● Vagrant, Docker ● Standalone Tomcat Solution: Embedded Tomcat Result: ● Local set up: 5 hours -> 0 second ● Deploy: 5 minutes -> 1 minute
  12. Migrating to Microservices Puzzle #1 Problem: lots of boilerplate framework configurations Solution: Spring Boot
  13. Migrating to Microservices Puzzle #2 Problem: Dependency management
  14. Migrating to Microservices Puzzle #2 Solution: Spring IO Platform <dependencyManagement> <dependencies> <dependency> <groupId>io.spring.platform</groupId> <artifactId>platform-bom</artifactId> <version>1.1.1.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
  15. Migrating to Microservices Puzzle #3 Problem: Application health check and monitoring ● Issue: murder mystery to your application ○ Brute force restart ● Issue: one production app depends on dev environment Solution: Spring Boot Actuator + extension endpoint ● /health combined with Sensu so that operations can react immediately ● /info links deployment artifact with CI build pipeline so that we know how it was built, when it was built, and how it was tested ● /dependencies
  16. { { "maven.artifact" : "com.sample.authorization.ws", "maven.artifact.version" : "1.6.489-SNAPSHOT", "git.branch" : "master", "git.commit.id" : "5155e6314ec891fa0094d4fc708c551a2184f132", "build.number" : "489", "build.url" : "http://bamboo/browse/AUT-BUIL-489" } }
  17. { "dependencies": [{ "serviceName": "User Info WS", "version": "4.0.0", "endpoint": "http://domainname.com/user-info-ws" }, { "serviceName": "Encryption WS", "version": "3.1.0", "endpoint": "http://domainname.com/encryption-ws" }, { "serviceName": "Order WS", "version": "1.1.0-SNAPSHOT", "endpoint": "http://domainname.com/order-ws" }, { "Database": "DB2 for AS/400", "Url": "jdbc:as400://dev-db", "Username": "dbuser", "Tables": "{tbl_user, tbl_org, tbl_order, tbl_reference}" }] }
  18. Migrating to Microservices Puzzle #4 Problems: ● Isolated configurations, without security ● Hard to trace request and response We Tried: Spring Cloud
  19. Make a change Check in master Compile, unit test, integration test on CI server Deploy to Staging Interactive tests Deploy to production with script 2013 Migrating to Microservices Puzzle #5
  20. Make a change Check in master Compile, unit test, integration test on CI server Deploy to Staging Interactive tests One click deploy to production Automated Infrastructure test in Chef 2015 Migrating to Microservices Puzzle #5
  21. Make a change Check in master Compile, unit test, integration test on CI server Deploy to Staging Interactive tests One click deploy to production In PCF Automated Infrastructure test in Pivotal Cloud Foundry 2016 and beyond Migrating to Microservices Puzzle #5
  22. Migrating to Microservices Puzzle #6 For each new service, we have to create: ● 3+ git repositories ● 1 CI build plan ● 2 CI deployment plans (dev and prod) ● Many more code, tests, README, CHANGELOG, YML, RAML, POM...
  23. Spring Bloomr
  24. ├── ├── ├── ├── ├── ├── │ ... ├── │ ├── │ └── │ ├── │ │ └── │ │ └── │ │ └── │ │ └── │ │ ├── │ │ │ ├── │ │ │ ├── │ │ │ └── │ │ ├── │ │ │ ├── │ │ │ └── │ │ └── │ │ ├── │ │ └── │ └── │ ... └── ├── ├── │ └── └── ├── │ └── │ └── │ └── │ └── │ └── │ ├── │ └── └── └── └── └── └── └── ├── └── 49 directories, 32 files!
  25. Dev QA PM BusinessOperation Departments Projects DevOps Organizational Structure Changes
  26. Spring Boot is the baseline! Lessons Learned
  27. Lessons Learned Test automation as much as possible ● Unit test ● Integration test ● End-to-end test
  28. Lessons Learned Health and monitoring is super important because ● Operation people get notified immediately if something goes wrong ● When combined with log aggregation and analysis, troubleshooting becomes easier for developers ● Think about how to define a healthy application ● Secure your Spring Boot Actuator endpoints
  29. Future Work ● Log aggregation ● Service discovery and client load balancing ● A/B Testing
  30. Q&A
  31. ● Bamboo: https://www.atlassian.com/software/bamboo ● Chef: https://www.chef.io/chef/ ● Docker: https://www.docker.com ● Elasticsearch: https://www.elastic.co/products/elasticsearch ● Eureka: https://cloud.spring.io/spring-cloud-netflix/ ● Kibana: https://www.elastic.co/products/kibana ● Logstash: https://www.elastic.co/products/logstash ● Pivotal Cloud Foundry https://pivotal.io/platform ● Raml: http://raml.org ● Ribbon: https://github.com/Netflix/ribbon ● Spring Cloud Config: https://cloud.spring.io/spring-cloud-config/ ● Spring Cloud Sleuth: https://cloud.spring.io/spring-cloud-sleuth/ ● Spring IO Platform: https://spring.io/platform ● Sensu: https://sensuapp.org ● Swagger: http://swagger.io ● Vagrant: https://www.vagrantup.com ● Yaml: http://yaml.org ● Zipkin: http://zipkin.io Glossary
Publicité