SpringOne Platform 2016
Speakers: Ross Zhang; Senior Software Developer, OTPP & Jun Li; Software Engineer, OTPP
As in many mid-to-large size organizations, you may have traditional Java enterprise applications, which are considered heavy and cumbersome, in terms of development, deployment and operations. You are thinking about migrating legacy applications for a long time but migration is a complex puzzle and there are many missing pieces. At Ontario Teachers’ Pension Plan, one of the world’s largest institutional investors, we have successfully solved many puzzle pieces with migrating traditional Java enterprise applications using Spring Boot, Spring Cloud and Cloud Foundry. This presentation will benefit many of you who may be in the same shoes as we were. Learn how we:
-solved dependency management issues
-accelerated application development and deployment
-monitored and checked application status
-migrated monolithic apps to microservices using Spring Cloud
-leveraged Platform as a Service.
Injustice - Developers Among Us (SciFiDevCon 2024)
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
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
16. 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
19. Migrating to Microservices Puzzle #4
Problems:
● Isolated configurations, without security
● Hard to trace request and response
We Tried: Spring Cloud
20. 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
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
Automated
Infrastructure test in Chef
2015
Migrating to Microservices Puzzle #5
22. 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
23. 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...
37. 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
38. Future Work
● Log aggregation
● Service discovery and client load balancing
● A/B Testing