toronto spring conference jun li (@jeffreyjunli) … learned from...toronto spring conference...
TRANSCRIPT
![Page 1: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/1.jpg)
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
Ross Zhang (@ross_zhang)Jun Li (@jeffreyjunli)
Toronto Spring Conference
![Page 2: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/2.jpg)
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.
![Page 3: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/3.jpg)
Agenda
● Our Journey● Pain Points● Puzzle Pieces to Migrate to Microservices● Lessons Learned● Future Work● Q & A ● Glossary
![Page 4: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/4.jpg)
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
![Page 5: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/5.jpg)
SmalltalkApplication
Green Screen app
SOAP
AS400(20 years old)
Application Server
EAR - Enterprise Archive MQ
Caching
Security
Load balancing Logging
JNDIEAR - Enterprise ArchiveEAR - Enterprise Archive
Migration Journey
![Page 6: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/6.jpg)
Pain Points
● Development● Deployment● Operations
![Page 7: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/7.jpg)
Development Pain Points
Dev env takes too long to
set upJar hell
Framework configurations
![Page 8: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/8.jpg)
Deployment Pain Points
Slow Unstable Downtime
![Page 9: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/9.jpg)
Operation Pain Points
No application
health check
No log aggregation or analysis
![Page 10: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/10.jpg)
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)
![Page 11: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/11.jpg)
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
![Page 12: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/12.jpg)
Migrating to Microservices Puzzle #1
Problem: lots of boilerplate framework configurations
Solution: Spring Boot
![Page 13: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/13.jpg)
Migrating to Microservices Puzzle #2
Problem: Dependency management
![Page 14: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/14.jpg)
![Page 15: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/15.jpg)
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>
![Page 16: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/16.jpg)
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
![Page 17: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/17.jpg)
{{
"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"
}}
![Page 18: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/18.jpg)
{"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}"
}]}
![Page 19: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/19.jpg)
Migrating to Microservices Puzzle #4
Problems:● Isolated configurations, without security● Hard to trace request and response
We Tried: Spring Cloud
![Page 20: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/20.jpg)
Make a change
Check in master
Compile,unit test,
integration test on CI
server
Deploy to Staging
Interactive tests
Deploy to productionwith script
2013
Migrating to Microservices Puzzle #5
![Page 21: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/21.jpg)
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
![Page 22: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/22.jpg)
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
![Page 23: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/23.jpg)
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...
![Page 24: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/24.jpg)
Spring Bloomr
![Page 25: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/25.jpg)
![Page 26: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/26.jpg)
![Page 27: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/27.jpg)
![Page 28: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/28.jpg)
├── CHANGELOG.md
├── manifest.yml
├── mvnw
├── pom.xml
├── README.md
├── springonedemo-domain
│ ...
├── springonedemo-service
│ ├── pom.xml
│ └── src
│ ├── main
│ │ └── java
│ │ └── com
│ │ └── otpp
│ │ └── springonedemo
│ │ ├── config
│ │ │ ├── CredentialConnectorUtil.java
│ │ │ ├── PersistenceConfig.java
│ │ │ └── SpringonedemoConfig.java
│ │ ├── db
│ │ │ ├── SpringonedemoEntity.java
│ │ │ └── SpringonedemoRepository.java
│ │ └── service
│ │ ├── SpringonedemoMapper.java
│ │ └── SpringonedemoService.java
│ └── test
│ ...
└── springonedemo-ws
├── pom.xml
├── raml
│ └── springonedemo.raml
└── src
├── main
│ └── java
│ └── com
│ └── otpp
│ └── springonedemo
│ └── ws
│ ├── SpringonedemoApp.java
│ └── SpringonedemoController.java
└── test
└── java
└── com
└── otpp
└── springonedemo
└── ws
├── SpringonedemoControllerTestE2E.java
└── SpringonedemoControllerTest.java
49 directories, 32 files!
![Page 29: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/29.jpg)
![Page 30: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/30.jpg)
![Page 31: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/31.jpg)
![Page 32: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/32.jpg)
![Page 33: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/33.jpg)
![Page 34: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/34.jpg)
Dev QA PM BusinessOperation
Departments
Projects
DevOps
Organizational Structure Changes
![Page 35: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/35.jpg)
Spring Boot is the baseline!
Lessons Learned
![Page 36: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/36.jpg)
Lessons Learned
Test automation as much as possible● Unit test● Integration test● End-to-end test
![Page 37: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/37.jpg)
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
![Page 38: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/38.jpg)
Future Work
● Log aggregation● Service discovery and client load balancing● A/B Testing
![Page 39: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/39.jpg)
Q&A
![Page 40: Toronto Spring Conference Jun Li (@jeffreyjunli) … Learned from...Toronto Spring Conference Disclaimer All the opinions and views expressed in this presentation and talk are strictly](https://reader030.vdocuments.mx/reader030/viewer/2022041102/5edc7c39ad6a402d66672959/html5/thumbnails/40.jpg)
● 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