马上开始. 它是免费的哦
注册 使用您的电邮地址
SOA - MSA 作者: Mind Map: SOA - MSA

1. SOA: Service Oriented Architecture

1.1. Services

1.1.1. are programs that run independently

1.1.2. communicate over a network

1.1.3. achieves some business logic

1.2. SOA

1.2.1. is designing your application to function as a collection of services

2. MSA: MicroServices Architecture

2.1. is a subset of SOA,

2.2. where services must satisfy more condition: Microservices

2.2.1. MUST follow the Single Responsibility Principle

2.2.2. CANNOT be composed of other services

2.2.3. must achieve SCALABILITY and RESILIENCE through independence

3. "Typical" Enterprise SOA vs. MSA

3.1. Larger Services

3.1.1. Communicates with SOAP Simple Object Access Protocol Oracle Reference Wikipedia Reference communicates with rigid rules each service's API follows a contract (the WSDL file) W3C Reference guru99 Reference

3.2. Smaller Services

3.2.1. Communicates with RESTful HTTP RESTful APIs act on verbs respond with Status codes JSON in body of request / response "Smart endpoints", "dumb pipes" (we'll come back here) Typically uses Service registry and discovery to enable direct communication Service Registry

4. Benefits of MSA

4.1. Loosely coupled Services

4.2. (Enforced) modularity

4.3. Fault-tolerant

4.3.1. no Single Point of Failure

4.4. Scalable

4.4.1. Independent services scale independently

4.5. Implementation agnostic

4.5.1. services can use different techs / languages

4.6. Testable

4.7. Organizational benefit

4.7.1. small teams working independently, managing separate services

5. Drawbacks of MSA


5.1.1. "Chatty" microservices communicating too often

5.2. (2) Distributed data storage

5.2.1. we make tradeoffs and settle for eventual consistency

5.3. (3) Monitoring and logging

5.3.1. are more difficult over a network

5.4. (4) Deploying 100s of services

5.4.1. can be difficult

5.5. (5) Complexity / Refactoring

5.5.1. changes in few services are easier

5.5.2. changes across many are harder

6. Solutions / Mitigations of Drawbacks

6.1. FOR (1) -- Combine microservices that constantly communicate

6.1.1. if they are too "chatty", combine them

6.2. FOR (1) -- HTTP can be replaced by messaging queues where appropriate (using Publisher/Subscriber pattern)

6.2.1. Rabbit

6.2.2. Kafka MQ's

6.3. FOR (2) -- Many ways to mitigate

6.3.1. shard

6.3.2. dbs

6.3.3. use stored caches (Redis)

6.3.4. etc.

6.4. FOR (3) -- Distributed logging and tracing tools

6.4.1. Spring Cloud Sleuth

6.4.2. Zipkin

6.5. FOR (4)

6.5.1. Docker for containerization

6.5.2. Kubernetes for "container orchestration"

6.5.3. Cloud providers for hardware

7. Netflix OSS MSA Tools

7.1. Eureka Server

7.1.1. Service Registry

7.2. Eureka Client

7.2.1. Discovery Client registers with Eureka Server

7.3. Ribbon

7.3.1. Load Balancer

7.4. Zuul

7.4.1. Gateway

7.5. Feign

7.5.1. HTTP Client Sends HTTP requests

8. Web Services

8.1. SOA – Service Oriented Architecture

8.1.1. Open Group: Intro to SOA

8.1.2. Service Oriented Ambiguity

8.1.3. Services are programs that run independently, achieve some business logic, and communicate over a network

8.1.4. Service Oriented Architecture involves designing your app as a collection of these services working together

8.2. MSA - MicroServices Architecture

8.2.1. Open Group's chapter on MSA

8.2.2. MSA is also a contentious subject, with multiple interpretations.

8.2.3. Microservice Architecture is a subset of SOA, satisfying a few more conditions: Microservices MUST satisfy the Single Responsiibility Principle (SRP) -- they do only one thing and do it well Microservices cannot be composed of multiple other services Microservices achieve scalability and resilience through independence (we can easily take down or spin up instances of each service)

8.3. Comparison of typical enterprise SOA and typical MSA

8.3.1. Enterprise SOA has larger services that may have more than one responsibility

8.3.2. MSA has smaller services that satisfy SRP

8.3.3. Enterprise SOA communicates using SOAP, so each service has a WSDL for communicating with each other. Secure and rigid communication rules.

8.3.4. MSA communicates with HTTP and consists of RESTful services. "Smart endpoints, dumb pipes"

8.3.5. Enterprise SOA routes communication through a central bus

8.3.6. MSA uses service registries and discovery clients to allow communcation without centralized routing

9. MSA

9.1. Benefits of MSA (vs. Monolith)

9.1.1. Loosely coupled services

9.1.2. Modular

9.1.3. Fault tolerant (no Single Point of Failure)

9.1.4. Scalable : independent services easily horizontally scale, and we only scale the parts we need

9.1.5. Implementation agnostic : MS written in different languages and paradigms

9.1.6. Testable : test each service independently

9.1.7. Good for development in a large org : many small autonomous (agile, devops-y) teams maintain RESTful microservices This is how FANG (Facebook, Amazon, Netflix, Google) does most development

9.2. Drawbacks of MSA

9.2.1. Network latency and the "chattiness" of microservices

9.2.2. Distributed data storage means we make tradeoffs and settle for "eventual" consistent data

9.2.3. Monitoring and tracing errors is more difficult across a network

9.2.4. Deploying 100s of services can be difficult

9.2.5. Complexity/Refactoring changes that touch one or two microservices are easier Changes that touch many microservices are much harder

9.3. Solutions/Mitigations of drawbacks

9.3.1. Chattiness reduced by following SRP and separation of concerns If 2 microservices are constantly talking, refactor them to follow SRP HTTP traffic can be reducing by replacing it with messaging queues (Rabbit, Kafka) when appropriate

9.3.2. Sharding databases, using shared caches, and other solutions exist for distributed storage, but they always involve tradeoffs

9.3.3. Spring Cloud Sleuth and Zipkin enable distributed logging and tracing

9.3.4. Docker, Kubernetes/Docker Swarm, and cloud platforms enable easier MSA deployment

9.3.5. Complexity mitigated by good design (a constant goal)

9.4. Netflix OSS for Microservices

9.4.1. Eureka Server What it is Service Registry Microservices register their URI and status with Eureka Provides failover What it does Enable by putting it on the classpath and using By default hosts on port 8761 and has self-preservation behavior

9.4.2. Eureka Client What it is Discovery Client Retrieves the registry from Eureka Server to locate multiple instances of any other service What it does Enable by putting it on the classpath and using By default both registers with Eureka Server and retrieves the registry of other registered services

9.4.3. Ribbon What it is Load balancer Any service running Ribbon will balance its outgoing traffic between instances of other services What it does Default is round-robin Built into Eureka Client, no need to separately include

9.4.4. Zuul What it is Gateway Allows external entities to access resources within the MS network, and filters traffic coming from outside. What it does Enable by putting it on the classpath and using Configure routing in or application.yml

9.4.5. Hystrix What it is Circuit breaker Provides immediate fallback response from failing microservices used to prevent cascading failures

9.4.6. Feign What it is Http Client Allows microservices to easily send HTTP requests to other microservices What it does Enable by putting OpenFeign on the classpath and using To actually create a Feign Client (something that sends HTTP reqs)

9.5. Spring Cloud MSA tools

9.5.1. What it is Config server provides centralized and version controlled configuration for microservices

9.5.2. What it does Enable by putting it on the classpath using @EnableConfigServer adding a git uri in Spring REST and Spring Data easily build a RESTful API RabbitMQ Messaging Queue broadcast information to all listening microservices instead of sending many HTTP requests

10. SOA

10.1. SOAP w/HTTP

10.2. SOAP Message

10.3. WSDL

10.4. Jax-WS – Java API for XML Web Services

11. REST

11.1. 6 traits of REST

11.2. Rest Services

12. Virtual Machines

13. Docker

14. SOAP

14.1. “Expose” and “Consume” Web Services

14.2. Simple Object Access Protocol

14.3. Protocol for XML based communication across the Internet

14.4. Platform and language-independent

14.5. Similar

14.5.1. Corba

14.5.2. Dcom

14.5.3. Java RMI

14.6. SOAP is pure XML and therefore language agnostic

14.7. Not tied to a specific transport protocol: HTTP, SMTP, FTP, MSNQ, IBM MQSeries, etc.