{nano|micro|mini}-services? modularization for sustainable ... · limited interaction with other...
TRANSCRIPT
![Page 1: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/1.jpg)
{Nano|Micro|Mini}-Services? Modularization for Sustainable Systems
Stefan Tilkov | innoQ [email protected]
@stilkov
![Page 2: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/2.jpg)
http://microxchg.io
![Page 3: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/3.jpg)
1. Reviewing architectures
![Page 4: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/4.jpg)
Generic Architecture Review Results
Building features takes
too long
Technical debt is well-known and not
addressed
Deployment is way too
complicated and slow
Replacement would be way too expensive
Scalability has reached its limit
Architectural quality has degraded
“-ility” problems abound
![Page 5: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/5.jpg)
Any architecture’s quality is inversely proportional to the number of bottlenecks limiting its evolution,
development, and operations
![Page 6: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/6.jpg)
«Insert Obligatory Conway Reference Here»
![Page 7: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/7.jpg)
Conway’s Law
“Organizations which design systems are constrained to produce systems which are copies of the communication structures of
these organizations.” – M.E. Conway
Organization → Architecture
![Page 8: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/8.jpg)
Reversal 1
Any particular architecture approach constraints organizational options – i.e. makes some organizational models simple and others
hard to implement.
Organization ← Architecture
![Page 9: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/9.jpg)
Reversal 2
Choosing a particular architecture can be a means of optimizing for a desired
organizational structure.
Organization ← Architecture
![Page 10: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/10.jpg)
2. System boundaries
![Page 11: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/11.jpg)
Modularization
Legacy SystemNew System New System
![Page 12: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/12.jpg)
New System
Consolidation
Legacy System Legacy System
![Page 13: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/13.jpg)
New SystemLegacy System
Modernization
![Page 14: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/14.jpg)
New System
Greenfield
Project scope
![Page 15: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/15.jpg)
1 Project = 1 System?
![Page 16: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/16.jpg)
Size Modularization
1-50 LOC single file
50-500 LOC few files, few functions
500-1000 LOC Library, class hierarchy
1000-2000 LOC Framework + application
>2000 LOC multiple applications
![Page 17: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/17.jpg)
System CharacteristicsSeparate (redundant) persistence
Internal, separate logic Domain models & implementation strategies
Separate UI Separate development & evolution
Limited interaction with other systems Autonomous deployment and operations
![Page 18: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/18.jpg)
Macro (technical) architecture
Domain architecture
![Page 19: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/19.jpg)
JRuby C#
ScalaGroovy
JavaClojure
![Page 20: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/20.jpg)
RDBMSNoSQL
K/V
RDBMS RDBMS/DWHNoSQLDocDB
![Page 21: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/21.jpg)
RDBMSNoSQL
K/V
RDBMS RDBMS/DWHNoSQLDocDB
Micro architecture
![Page 22: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/22.jpg)
Persistence
Logic
UI
Module A
Module B
Module C
![Page 23: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/23.jpg)
System A
Persistence
Logic
UI
System B
Persistence
Logic
UI
System C
Persistence
Logic
UI
![Page 24: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/24.jpg)
Assumptions to be challengedLarge systems with a single environment
Separation internal/external Predictable non-functional requirements
Clear & distinct roles Planned releases
Built because they have to be
![Page 26: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/26.jpg)
Separate, runnable process Accessible via standard ports & protocols
Shared-nothing model Horizontal scaling
Fast startup & recovery
App characteristics
![Page 27: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/27.jpg)
Microservice Characteristicssmall
each running in its own process lightweight communicating mechanisms (often HTTP)
built around business capabilities independently deployable
minimum of centralized management may be written in different programming languages
may use different data storage technologies
http://martinfowler.com/articles/microservices.html
![Page 28: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/28.jpg)
System CharacteristicsSeparate (redundant) persistence
Internal, separate logic Domain models & implementation strategies
Separate UI Separate development & evolution
Limited interaction with other systems Autonomous deployment and operations
![Page 29: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/29.jpg)
In search for a name …
Not-so-micro-service
Autonomous system
Full-stack service
Self-sufficient componentSmall system
Sovereign system
Independent system
Cohesive system
Large enough system
Small enough system
Logical node Domain unit
Bounded system
Executable component
System
Self-contained system
![Page 30: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/30.jpg)
Self-Contained System (SCS)
![Page 31: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/31.jpg)
SCS CharacteristicsAutonomous web application
Owned by one team No sync remote calls Service API optional
Includes data and logic No shared UI
No or pull-based code sharing only
![Page 32: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/32.jpg)
SCS App Microservice
Size (kLoC) 1-50 0.5-10 0.1-?
State Self-contained External Self-contained
# per Logical System 5-25 >50 >100
Communication between units No (if possible) ? Yes
UI Included Included External (?)
UI Integration Yes (web-based) ? ?
![Page 33: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/33.jpg)
But why?
![Page 34: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/34.jpg)
Isolation
![Page 35: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/35.jpg)
(Independent) Scalability
![Page 36: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/36.jpg)
Localized decisions
![Page 37: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/37.jpg)
Replaceability
![Page 38: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/38.jpg)
Playground effect
![Page 39: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/39.jpg)
Afraid of chaos?
![Page 40: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/40.jpg)
Necessary Rules & GuidelinesCross-system System-internal
Responsibilities Programming languagesUI integration Development toolsCommunication protocols Frameworks
Data formats Process/Workflow control
Redundant data PersistenceBI interfaces Design patternsLogging, Monitoring Coding guidelines
![Page 41: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/41.jpg)
Web-native front-end integration
![Page 42: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/42.jpg)
Browser
HTML Page
Backend 1
UI 1
UI 2
Server-side integration
Backend 2
FrontendServer
Examples: ESI-Caches SSI Portal Server
![Page 43: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/43.jpg)
Browser
HTML Page
Backend 1
UI 1
UI 2
Client-side integration
Backend 2
Examples: AJAX Proprietary Frameworks
![Page 44: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/44.jpg)
Browser
HTML Page 1
Links
Backend 1
Backend 2
Asset Server
HTML Page 2
CSS
<<creates>>
<<creates>>
![Page 45: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/45.jpg)
Development
Deployment
Storage
Backend call
Edge integration
Server-side integration optionsESI
Homegrown(Portal server)
Build toolsChef, Puppet, …
Asset pipeline
Git/SVN submodules GemsMaven artifacts
DB replicationFeeds
RPCRESTRMI
WS-*
![Page 46: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/46.jpg)
Link
Replaced link
Client-side integration options
Client call
Magical integration concept
Unobtrusive JSROCA-style
oEmbed
SPA-styleJS Widgets
![Page 47: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/47.jpg)
Explicitly design system boundaries Modularize into independent, self-contained systems
Separate micro and macro architectures Be aware of changing quality goals
Strike a balance between control and decentralization
Summary
![Page 48: {Nano|Micro|Mini}-Services? Modularization for Sustainable ... · Limited interaction with other systems Autonomous deployment and operations. Macro (technical) architecture ... Accessible](https://reader034.vdocument.in/reader034/viewer/2022042317/5f05ed977e708231d4156c60/html5/thumbnails/48.jpg)
Thank you!Questions? Comments?
Stefan Tilkov, @stilkov [email protected] http://www.innoq.com/blog/st/ Phone: +49 170 471 2625
innoQ Deutschland GmbH
Krischerstr. 100 40789 Monheim am Rhein Germany Phone: +49 2173 3366-0
innoQ Schweiz GmbH
Gewerbestr. 11 CH-6330 Cham Switzerland Phone: +41 41 743 0116www.innoq.com
Ohlauer Straße 43 10999 Berlin Germany Phone: +49 2173 3366-0
Robert-Bosch-Straße 7 64293 Darmstadt Germany Phone: +49 2173 3366-0
Radlkoferstraße 2 D-81373 München Germany Telefon +49 (0) 89 741185-270