nfjs 2015 migrating to microservices - sdd...
TRANSCRIPT
![Page 1: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/1.jpg)
Software Design and Development Conference 2015
Mark RichardsHands-on Software ArchitectAuthor of Enterprise Messaging Video Series (O’Reilly)Author of Java Message Service 2nd Edition (O’Reilly)Co-author of Software Architecture Fundamentals Video Series (O'Reilly)
Migrating to a Microservices Architecture
![Page 2: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/2.jpg)
Software Architecture Fundamentals Video Series Enterprise Messaging Video Series
![Page 3: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/3.jpg)
microservices architecture elements
agenda
migration challengesmicroservices hybrid models
migration techniques
![Page 4: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/4.jpg)
Microservices Architecture Elements
![Page 5: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/5.jpg)
microservices elements
api layer
client requests client requests client requests
![Page 6: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/6.jpg)
distributed architecture
api layer
client requests client requests client requests
microservices elements
![Page 7: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/7.jpg)
separately deployed units
api layer
client requests client requests client requests
microservices elements
![Page 8: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/8.jpg)
service component
api layer
client requests client requests client requests
microservices elements
![Page 9: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/9.jpg)
bounded context
api layer
client requests client requests client requests
microservices elements
![Page 10: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/10.jpg)
microservices hybrid models
![Page 11: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/11.jpg)
databasescope
service granularity
integration hub
microservices hybrids
![Page 12: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/12.jpg)
api layer
client requests client requests client requests
microservices hybridsservice granularity
![Page 13: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/13.jpg)
user interface layer
client requests client requests client requests
microservices hybridsservice granularity
![Page 14: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/14.jpg)
single-purpose micro-service to "portion of the application" macro-service
service granularity
macro-services resolves orchestration and transactional issues
microservices hybrids
allows for complex business processing within a service context
-
![Page 15: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/15.jpg)
single-purpose micro-service to "portion of the application" macro-service
service granularity
services become harder to develop and testdeployment pipeline requires more planningchange control becomes more difficult
microservices hybrids
-
![Page 16: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/16.jpg)
microservices hybridsdatabase scope
api layer
client requests client requests client requests
![Page 17: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/17.jpg)
microservices hybridsdatabase scope
user interface layer
client requests client requests client requests
![Page 18: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/18.jpg)
single-purpose service-based database to globally shared application database
reduces service orchestration and contract dependencies
microservices hybridsdatabase scope
improves performance due to fewer remote callsrefactoring entire database may not be feasible or possible
-
![Page 19: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/19.jpg)
single-purpose service-based database to globally shared application database
looser bounded context of servicestighter service coupling based on schema
microservices hybridsdatabase scope
schema changes become expensive and difficult
-
![Page 20: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/20.jpg)
microservices hybridsintegration hub
api layer
client requests client requests client requests
lightweight message broker
![Page 21: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/21.jpg)
user interface layer
client requests client requests client requests
microservices hybridsintegration hub
integration hub / middleware
![Page 22: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/22.jpg)
lightweight message broker to heavier integration hub
microservices hybridsintegration hub
allows for transformation of contract differences allows for non-transactional orchestration of servicesallows for protocol-agnostic heterogeneous interoperabilityallows for common processing logic across all services
-
![Page 23: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/23.jpg)
lightweight message broker to heavier integration hub
decrease in overall performanceadded complexity and costincreased need for governancedeployment pipeline requires much more planning
microservices hybridsintegration hub
services become harder to develop and test-
![Page 24: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/24.jpg)
microservices migration challenges
![Page 25: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/25.jpg)
migration challenges
distributed architecture and remote service issues
service component granularity and transactional boundaries
shared services, modules, and object hierarchies
![Page 26: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/26.jpg)
distributed architecture issues
contract creation, maintenance, versioning, and coordination
migration challenges
![Page 27: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/27.jpg)
distributed architecture issues
remote process responsiveness and server availability
migration challenges
![Page 28: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/28.jpg)
distributed architecture issuesmigration challenges
slower service invocations due to remote access protocols and distributed
components
![Page 29: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/29.jpg)
distributed architecture issuesmigration challenges
atomic transactions and transaction scope
![Page 30: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/30.jpg)
distributed architecture issuesmigration challenges
authenticating and authorizing remote connections and service invocations
![Page 31: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/31.jpg)
distributed architecture issuesmigration challenges
distributed logging facilities to provide a holistic view of a transaction
![Page 32: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/32.jpg)
service component granularitymigration challenges
module module module module module
module module module module module
module module module module module
module module module module module
coarse-grained service components address transactional issues but may not achieve your desired goals
![Page 33: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/33.jpg)
service component granularitymigration challenges
module module module module module
module module module module module
module module module module module
module module module module module
fine-grained service components may lead to too much orchestration and inter-dependency between service components
![Page 34: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/34.jpg)
module module module module module
module module module module module
module module module module module
module module module module module
business functionality groupingstransactional boundariesdeployment goalsscalability needs
service component granularitymigration challenges
![Page 35: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/35.jpg)
shared components and object hierarchiesmigration challenges
module module module
abstract
abstract
shared
inheritance structure
shared modules (utility and service classes)
![Page 36: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/36.jpg)
shared components and object hierarchiesmigration challenges
module module module
abstract
abstract
shared
inheritance structure
shared modules (utility and service classes)
LIB
LIB
![Page 37: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/37.jpg)
modulemodule module module
module
module
module module
modules can be split....
shared components and object hierarchiesmigration challenges
![Page 38: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/38.jpg)
module module
module
module
or moved into a shared library or jar file...
module
shared components and object hierarchiesmigration challenges
![Page 39: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/39.jpg)
or replicated in each service component
module module
module
module
module module
shared components and object hierarchiesmigration challenges
![Page 40: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/40.jpg)
shared lib or jar file
user interface layer
application business layer
module module
modulemodule module
module module
module
migration challengesshared components and object hierarchies
![Page 41: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/41.jpg)
migration challengesshared component techniques
jar /dll (compile or runtime)
LIB
shared library (compile time)
code replication remote services
![Page 42: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/42.jpg)
migration techniques
![Page 43: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/43.jpg)
playbook approach
current state iteration 1 iteration 2 iteration 3
each iteration should clearly illustrate the changes to the architecture each step along the way
migration techniques
![Page 44: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/44.jpg)
playbook approach
current state iteration 1 iteration 2 iteration 3
identify the purpose behind each iteration
identify the technical and business value for each iteration
keep iterations as small as possible while still providing enough technical and business value
try to minimize "staging iterations"
migration techniques
![Page 45: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/45.jpg)
form a logical or physical separation between the user interface layer and the business layer
user interface separationmigration techniques
![Page 46: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/46.jpg)
application business layer
user interface layer
CustomerData
AccountData
TradeData
ReportData
IDataModel
CustomerUI
AppClient
AccountUI TradeUI ReportUI
Customer Account Trade Report
migration techniques
![Page 47: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/47.jpg)
application business layer
user interface layer CustomerUI
AppClient
AccountUI TradeUI ReportUI
Customer Account Trade Report
model.jar
model.jarCustomerData
AccountData
TradeData
ReportData
IDataModel
migration techniques
![Page 48: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/48.jpg)
service migrationmigration techniques
![Page 49: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/49.jpg)
application business layer
user interface layer CustomerUI
AppClient
AccountUI TradeUI ReportUI
Customer Account Trade Report
model.jar
model.jar
migration techniques
![Page 50: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/50.jpg)
application business layer
user interface layer CustomerUI
AppClient
AccountUI TradeUI ReportUI
ReportTrade
model.jar
model.jar
Customer Account
model.jar
CustomerListener
Customer Account
migration techniques
![Page 51: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/51.jpg)
application business layer
user interface layer CustomerUI
AppClient
AccountUI TradeUI ReportUI
ReportTrade
model.jar
model.jar
Customer Account
model.jar
CustomerListener
migration techniques
![Page 52: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/52.jpg)
user interface layer CustomerUI
AppClient
AccountUI TradeUI ReportUImodel.jar
Customer Account
CustomerListener
model.jar
trade
TradeListener
model.jar
Report
ReportListener
model.jar
migration techniques
![Page 53: NFJS 2015 Migrating to Microservices - SDD Conferencesddconf.com/brands/sdd/library/Migrating_To_Microservices.pdf · refactoring entire database may not be feasible or possible-single-purpose](https://reader034.vdocument.in/reader034/viewer/2022042303/5ece580fa59d69109e45e195/html5/thumbnails/53.jpg)
Migrating to a Microservices Architecture
Independent ConsultantHands-‐on So*ware ArchitectPublished Author / Conference Speaker
Mark Richards
h<p://www.wmrichards.comh<p://www.linkedin.com/pub/mark-‐richards/0/121/5b9