From SOA to MSA
-
Upload
william-yang -
Category
Technology
-
view
5.184 -
download
4
description
Transcript of From SOA to MSA
![Page 1: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/1.jpg)
From SOA to MSA– Creating Adaptive and Innovation Supportive Architecture and Organization
-by William
![Page 2: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/2.jpg)
Topics
• Principles of Microservices Architecture• Patterns and Best Practices of Microservices• Microservices Organization• Application of Microserivces Architecture
![Page 3: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/3.jpg)
Problem Domain
• System & Organization Decoupling• Legacy System Upgrading• Use suitable platform and technology to solve
different problems– Golden Hammer Syndrome - Always Win/.Net
• Foster business innovation, dealing with outside competition– Innovation as a platform
• Creating extensible, agile and adaptive architecture and organization.
![Page 4: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/4.jpg)
SOLID Review - Single Responsibility Principle
![Page 5: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/5.jpg)
SOLID Review – Liskov Substitution Principle
![Page 6: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/6.jpg)
SOLID Review – Dependency Inversion Principle
![Page 7: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/7.jpg)
GRASP – General Responsibility Assignment Software Principles
• High Cohesion, Low Coupling– How to keep objects appropriately focused, manageable and understandable?– How to minimize dependencies, change impact and maximize reuse?
• Information Expert– What’s the general principle to assign responsibilities to object?
• Controller– Who should receive events and coordinate the overall system operation?
• Polymorphism– How to make components pluggable?
• Pure Fabrication– How to assign responsibilities to class representing concept not existing in problem domain?
• Indirection– How to decouple between two(or more) objects?
• Protected Variation– How to design object or system that its internal instability or variation will not have bad impact
to other elements of the object or system?
![Page 8: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/8.jpg)
Microservices Architecture
• A system architectural style, it is SOLID and GRASP principles applied at architectural level, including some patterns and best practices.
• SOA is too coarse-grained, Microservices is fine-grained and practical SOA.
• Microservices architecture needs technical infrastructure and organization support.
![Page 9: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/9.jpg)
Monolithic -> SOA -> MicorServices
![Page 10: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/10.jpg)
Legacy System Decouple & Upgrade
![Page 11: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/11.jpg)
Coupled SOA
CouplingCoupling
Edge ServiceMiddle Tier
ServiceEdge Service聚合服务Middle Tier
Service后端服务
Clients
Middle Tier Svc Edge Svc
![Page 12: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/12.jpg)
Decoupled SOA
IoC
Proxy
![Page 13: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/13.jpg)
Balance Standardization & Autonomy
StandardizationAutonomy
![Page 14: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/14.jpg)
Standardization
Interface
Monitoring
Deployment
![Page 15: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/15.jpg)
Key Elements of Microservices Architecture
• Stateless Service– Support scale out
• Low Friction Deployment– Fast and flexible service deployment and upgrade.
• Automated Management & Monitoring– Push common concerns to technical infrastructure and
framework, service developers only need to care for business logic.
• Automated Service Discovery & Routing– Decouple services, flexible upgrade and replacement.
![Page 16: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/16.jpg)
Microservices Framework
Drop-in Business Logic
Service Discovery
RESTFul API
XML/JSON/Proto-buf
Contract First
Security Policy
Configuration
Client/Proxy Autogen
Error Handling
Metric System
Central Logging
Request Validation
Governance
Rate Limiting
![Page 17: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/17.jpg)
Version Control of Microservices Leave multiple old microservice
versions running Fast introduction vs. slow
retirement asymmetry Brute force upgrade
Backward compatible Multiple versions coexistence
![Page 18: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/18.jpg)
Invocation Pattern of Microservices
![Page 19: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/19.jpg)
Service Dependency
![Page 20: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/20.jpg)
Single Dependency Delay Causing Blocking of User Request
![Page 21: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/21.jpg)
All Request Threads Can be Blocked at Peak Hour(aka. Cascading Failure)
![Page 22: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/22.jpg)
Circuit Breaker Fault Tolerant Pattern
https://github.com/Netflix/Hystrix
![Page 23: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/23.jpg)
GLSB
DC Aware Gateway
SOA Edge ServiceServiceRegistry
Peer Sync
Invoke
Invoke Invoke
Invoke
DC 1 DC 2
SOA Middle Tier Service
DC Aware Gateway
SOA Edge Service
SOA Middle Tier Service
ServiceRegistryDC Aware
ClientDC Aware
Client
Invoke
InvokeInvoke
LookupLookup
Register Register
Lookup Lookup
RegisterRegister
Cross Data Center Active-Active
Fallback Invocation
Fallback Invocation
![Page 24: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/24.jpg)
Conway’s Law
• “…organization which design systems … are constrained to produce designs which are copies of the communication structure of those organizations”– Melvin Conway, 1968
• “If you ask nine people to write a compiler, you get a nine pass compiler”
• “Those system then constrain the options for organizational change”– Dan North
![Page 25: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/25.jpg)
Team Organized by Technical Layer
![Page 26: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/26.jpg)
Traditional Organizational Structure
GAP & WALL
![Page 27: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/27.jpg)
Microservices Organization
Organized around Business Capabilities
Products not Projects Full stack skill team
![Page 28: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/28.jpg)
The Cost of Microservices
• System Complexity– Too much microservices, developer can’t build
context and see the big picture,– Need better architectural integration patterns.
• Performance– Performance penalty because of cross-process
invocation, 20 - 200ms per hop average.– Tune time consuming invocation, leverage
microservices invocation pattern.
![Page 29: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/29.jpg)
API Gateway
ServiceRegistry
SOA2
ESB
SQL Server
SOA2
SOA2
ESB
SOA2-JAVA
MySQL
SOA2-JAVA
MemCached
HBase
Redis
SBU A SBU B SBU C SBU D
Common Concerns : routing, auth, rate
limiting, monitoring, logging
View
Controller
Model
Service Routing
Table
Microservices Architecture - A Case In Practice
![Page 30: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/30.jpg)
Take Away
• Independently scalable, deployable, changeable, replaceable
• Evolutionary architecture and emergent design are approaches that maximize flex
• Programmable microservices platform fostering innovation
• Standardize in the gaps between services – flexible about what happens inside the boxes
• Separation of Concerns & Bounded Context• Another layer of indirection for decoupling
![Page 31: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/31.jpg)
![Page 32: From SOA to MSA](https://reader034.fdocuments.net/reader034/viewer/2022052618/554f3ff3b4c905471e8b4cca/html5/thumbnails/32.jpg)
Reference
• Micro-service architecture– http://yobriefca.se/blog/2013/04/28/micro-servic
e-architecture/• Micro-service by Martin Fowler
– http://martinfowler.com/articles/microservices.html
• Migrating to microservices by former Netflix cloud architect Adrian Cockcroft.– http://qconlondon.com/dl/qcon-london-2014/slid
es/AdrianCockcroft_MigratingToMicroservices.pdf