| Foreword |
|
xi | |
| Preface |
|
xiii | |
| Acknowledgments |
|
xvii | |
| About the Authors |
|
xix | |
|
1 An Introduction to Service-Oriented Architecture |
|
|
1 | (28) |
|
1.1 Common Object Request Broker Architecture (CORBA) |
|
|
3 | (3) |
|
1.2 Distributed Component Object Model (DCOM) |
|
|
6 | (1) |
|
1.3 Remote Method Invocation |
|
|
6 | (2) |
|
1.4 Prerequisites for CORBA, DCOM, and RMI |
|
|
8 | (1) |
|
1.5 Typical Use Cases and Confined Focuses of CORBA, DCOM, and RMI |
|
|
9 | (1) |
|
1.6 Concept of Service-Oriented Architecture |
|
|
10 | (3) |
|
|
|
13 | (15) |
|
1.7.1 High-Level Architecture of Application to Application Interaction Using Web Services |
|
|
15 | (1) |
|
1.7.2 Unique Capabilities of Web Services |
|
|
15 | (1) |
|
1.7.3 Can Web Services Replace CORBA/DCOM/RMI? |
|
|
16 | (1) |
|
1.7.4 Why Do We Need Web Services? |
|
|
16 | (1) |
|
1.7.5 Typical Use Cases of Web Services |
|
|
17 | (7) |
|
1.7.6 Distinction between Web Services and CORBA/DCOM/RMI |
|
|
24 | (2) |
|
1.7.7 Why Have Web Services Become Obsolete? What Are the Issues with Web Services? Are We Still in Need of Yet Another Architecture to Meet Business Requirements? |
|
|
26 | (2) |
|
|
|
28 | (1) |
|
|
|
29 | (32) |
|
2.1 Need for Microservices Architecture |
|
|
30 | (1) |
|
2.2 Issues with Traditional Enterprise Applications |
|
|
31 | (2) |
|
2.3 How Does MSA Handle the Issues with Monolithic Applications? |
|
|
33 | (3) |
|
2.4 Capabilities, Features, and Benefits of MSA |
|
|
36 | (2) |
|
|
|
38 | (7) |
|
|
|
45 | (1) |
|
2.7 Differences between SOA and MSA |
|
|
46 | (4) |
|
2.8 Where Do SOA and MSA Fit into Business Enterprises? |
|
|
50 | (1) |
|
2.9 Applicability of MSA in Contrast to SOA |
|
|
51 | (6) |
|
2.9.1 Typical Use Cases of MSA |
|
|
52 | (1) |
|
2.9.1.1 How Amazon Uses MSA and the Cloud |
|
|
52 | (1) |
|
2.9.1.2 How Netflix Uses Microservices |
|
|
52 | (1) |
|
2.9.1.3 How Capital One Uses Microservices |
|
|
53 | (1) |
|
2.9.1.4 Microservices Are the Perfect Choice for Developing Cloud-Native/Optimized Applications |
|
|
53 | (1) |
|
2.9.1.5 Microservices for E-Commerce Applications |
|
|
54 | (1) |
|
2.9.1.6 Microservices for Developing Web Applications |
|
|
55 | (1) |
|
2.9.1.7 Microservices for CPU/RAM Intensive Parts of Applications |
|
|
55 | (1) |
|
2.9.1.8 Applications Having Multiple Teams Working on the Same Product |
|
|
55 | (1) |
|
2.9.1.9 Microservices as Enablers for Cloud Adoption |
|
|
56 | (1) |
|
2.9.1.10 Identifying Microservices Use Cases from Classic SOA |
|
|
56 | (1) |
|
|
|
57 | (2) |
|
2.10.1 Gain the Benefit of Strong Service Boundaries at the Cost of Distribution |
|
|
57 | (1) |
|
2.10.2 Gain the Benefit of Individual Deployment at the Cost of Eventual Consistency |
|
|
57 | (1) |
|
2.10.3 Avail Independent Deployment at the Cost of Operational Complexity |
|
|
58 | (1) |
|
2.10.4 Avail the Benefit of Technology Diversity at the Cost of Interface Issues |
|
|
58 | (1) |
|
|
|
59 | (2) |
|
3 Communication Models for Microservices |
|
|
61 | (50) |
|
3.1 Key Architectural Elements of MSA |
|
|
62 | (6) |
|
3.2 Design Principles of Microservices |
|
|
68 | (2) |
|
3.3 Prerequisites for Service Interaction/Communication |
|
|
70 | (2) |
|
3.4 Communication Models for Microservices |
|
|
72 | (2) |
|
3.5 Synchronous Communication |
|
|
74 | (6) |
|
3.5.1 Representational State Transfer (REST) Architecture |
|
|
75 | (2) |
|
3.5.2 REST and HTTP Methods for Synchronous Communication |
|
|
77 | (3) |
|
3.5.3 Why Synchronous Communication Is Not Encouraged in Microservices? |
|
|
80 | (1) |
|
3.6 Asynchronous Communication |
|
|
80 | (3) |
|
3.7 Asynchronous Communication with Rabbit MQ Message Broker |
|
|
83 | (11) |
|
|
|
84 | (5) |
|
3.7.2 Advanced Message Queuing Protocol |
|
|
89 | (1) |
|
3.7.2.1 AMQP Command Architecture |
|
|
89 | (1) |
|
3.7.2.2 AMQP Transport Architecture |
|
|
90 | (2) |
|
3.7.2.3 AMQP Client Architecture |
|
|
92 | (1) |
|
3.7.3 Where to Use RabbitMQ |
|
|
92 | (2) |
|
|
|
94 | (1) |
|
3.8 Asynchronous Communication with an Apache Kafka Message Broker |
|
|
94 | (14) |
|
3.8.1 Need for Apache Kafka (High Throughput Message Broker) |
|
|
94 | (2) |
|
3.8.2 Comparing the Origin of Kafka with RabbitMQ |
|
|
96 | (2) |
|
3.8.2.1 Primary Objectives of Kafka---High Scalability, Availability, and Throughput (The Concept of Partitions in Kafka) |
|
|
98 | (1) |
|
|
|
99 | (3) |
|
3.8.4 How Consumers Read Data from Kafka with Message Ordering? |
|
|
102 | (2) |
|
3.8.5 Kafka and Message Producers |
|
|
104 | (1) |
|
3.8.6 Important Features of the Kafka Broker |
|
|
105 | (1) |
|
3.8.7 Typical Use Cases of the Kafka Broker |
|
|
106 | (2) |
|
|
|
108 | (3) |
|
4 Designing APIs and Developing Middleware Platforms for Microservices |
|
|
111 | (38) |
|
4.1 API Design Mechanisms and Middleware Platforms |
|
|
112 | (1) |
|
4.2 WSDL and SOAP (Traditional API and Middleware Platform for Web Services) |
|
|
113 | (7) |
|
4.2.1 Web Service Description Language |
|
|
114 | (2) |
|
4.2.2 Simple Object Access Protocol |
|
|
116 | (4) |
|
4.3 API Design and Middleware Platforms for Microservices |
|
|
120 | (18) |
|
|
|
120 | (1) |
|
4.3.1.1 REST API Design Using a URL Template |
|
|
120 | (2) |
|
4.3.1.2 The Need for REST API Standardization/Limitations with URL Template Design |
|
|
122 | (1) |
|
4.3.2 Standard REST API Specifications |
|
|
123 | (1) |
|
4.3.2.1 Open API Specification (Swagger) |
|
|
123 | (5) |
|
4.3.2.2 REST API Modeling Language |
|
|
128 | (2) |
|
|
|
130 | (2) |
|
4.3.3 Apache Thrift API Design and Middleware Platform |
|
|
132 | (1) |
|
4.3.3.1 Apache Thrift IDL and Code Generation |
|
|
132 | (1) |
|
4.3.3.2 Thrift Layers of Communication |
|
|
133 | (1) |
|
4.3.3.3 How to Use Thrift API and Tools |
|
|
134 | (2) |
|
4.3.3.4 When to Use Thrift |
|
|
136 | (1) |
|
4.3.4 Google Protocol Buffers (Protobuf, GPB) and Google RPC |
|
|
136 | (1) |
|
|
|
136 | (1) |
|
4.3.4.2 Google RPC with Google Protobuf |
|
|
137 | (1) |
|
4.4 Data Serialization Formats for Inter-Service Communication |
|
|
138 | (10) |
|
|
|
139 | (1) |
|
4.4.2 JavaScript Object Notation (JSON) |
|
|
140 | (2) |
|
4.4.3 YAML Ain't Markup Language |
|
|
142 | (2) |
|
|
|
144 | (4) |
|
|
|
148 | (1) |
|
5 Service Discovery and API Gateways |
|
|
149 | (26) |
|
5.1 The Need for Dynamic Configuration for Microservices Discovery |
|
|
150 | (1) |
|
|
|
150 | (1) |
|
|
|
151 | (2) |
|
|
|
153 | (2) |
|
5.4.1 Client-Side Discovery |
|
|
153 | (1) |
|
5.4.2 Server-Side Service Discovery |
|
|
154 | (1) |
|
5.5 Service Discovery Tools |
|
|
155 | (5) |
|
5.5.1 General Purpose Discovery Tools |
|
|
155 | (3) |
|
5.5.2 Single-Purpose Service Registry Tools |
|
|
158 | (2) |
|
|
|
160 | (13) |
|
5.6.1 The Need for an API Gateway (Single-Entry Point to MSA Applications) |
|
|
160 | (1) |
|
5.6.2 Key Functions of the API Gateway |
|
|
161 | (1) |
|
5.6.2.1 Creation of Client-Specific APIs at API Gateway |
|
|
162 | (1) |
|
5.6.2.2 Service Composition at the API Gateway |
|
|
163 | (1) |
|
5.6.2.3 Security Implementation |
|
|
164 | (2) |
|
5.6.2.4 Service Discovery and Routing with an API Gateway |
|
|
166 | (1) |
|
5.6.2.5 Data Aggregation with an API Gateway |
|
|
167 | (1) |
|
5.6.2.6 Data Format/Protocol Conversion at the API Gateway |
|
|
167 | (1) |
|
5.6.2.7 Edge Functions at the API Gateway |
|
|
168 | (1) |
|
5.6.2.8 API Gateway---Monitoring and Other Design Considerations |
|
|
169 | (2) |
|
5.6.2.9 Open Source Tools for an API Gateway |
|
|
171 | (2) |
|
|
|
173 | (2) |
|
6 Service Orchestration and Choreography |
|
|
175 | (24) |
|
|
|
176 | (1) |
|
6.2 Service Orchestration |
|
|
177 | (8) |
|
6.2.1 Orchestration Languages |
|
|
177 | (4) |
|
6.2.2 Service Orchestration in Detail (with BPEL) |
|
|
181 | (2) |
|
6.2.3 Service Orchestration in Microservices |
|
|
183 | (2) |
|
|
|
185 | (4) |
|
6.3.1 Choreography Languages |
|
|
186 | (3) |
|
6.4 The Need for Orchestration and Choreography Platforms for Microservices |
|
|
189 | (8) |
|
|
|
189 | (2) |
|
|
|
191 | (1) |
|
6.4.3 Event-Based Choreography Using Apache Kafka and Zeebe Workflow Engine Zeebe |
|
|
192 | (2) |
|
|
|
194 | (1) |
|
|
|
194 | (1) |
|
|
|
195 | (1) |
|
|
|
196 | (1) |
|
|
|
197 | (2) |
|
7 Database Transactions in MSA |
|
|
199 | (22) |
|
7.1 Database Transactions and ACID Properties |
|
|
200 | (2) |
|
7.2 Distributed Transactions and Two-Phase-Commit Protocol (in Conventional Systems) |
|
|
202 | (2) |
|
7.3 Nature of Databases and Database Access in MSA |
|
|
204 | (15) |
|
7.3.1 Why Avoid ACID Transactions with 2PC in MSA? |
|
|
206 | (1) |
|
7.3.2 BASE Transactions in MSA |
|
|
207 | (1) |
|
7.3.2.1 How to Achieve the Basically Available Property in MSA |
|
|
208 | (8) |
|
7.3.2.2 How the Consistency is Brought in MSA (Saga Pattern) |
|
|
216 | (3) |
|
|
|
219 | (2) |
|
8 Patterns for Microservices-Centric Applications |
|
|
221 | (30) |
|
8.1 A Macro-Level View of Microservices Architecture |
|
|
222 | (1) |
|
8.2 The Need for Patterns for Microservices Architecture |
|
|
223 | (27) |
|
8.2.1 Decomposition Patterns |
|
|
225 | (2) |
|
8.2.2 Composition Patterns |
|
|
227 | (4) |
|
|
|
231 | (5) |
|
8.2.4 Observability Patterns |
|
|
236 | (3) |
|
8.2.5 Cross-Cutting Concern Patterns |
|
|
239 | (4) |
|
8.2.6 Additional Database Architecture Patterns |
|
|
243 | (3) |
|
8.2.7 Deployment Patterns |
|
|
246 | (4) |
|
|
|
250 | (1) |
|
9 MSA Security and Migration |
|
|
251 | (18) |
|
9.1 Basic Security Requirements |
|
|
252 | (2) |
|
9.2 Pragmatic Architecture for Secure MSA |
|
|
254 | (2) |
|
9.3 Security Mechanisms for MSA Applications |
|
|
256 | (3) |
|
|
|
259 | (8) |
|
9.4.1 The Advantages of MSA |
|
|
260 | (1) |
|
9.4.2 Motivating Drivers for MSA Migration |
|
|
261 | (3) |
|
9.4.3 Issues in MSA Migration |
|
|
264 | (1) |
|
9.4.4 Migration Process Using Strangler Pattern |
|
|
265 | (1) |
|
9.4.5 Disadvantages of MSA Migration |
|
|
265 | (1) |
|
9.4.6 Candidate Applications for MSA Migration |
|
|
266 | (1) |
|
|
|
267 | (2) |
|
10 Platform Solutions for Microservices Architecture |
|
|
269 | (16) |
|
|
|
270 | (1) |
|
10.1 Challenges in a MSA Approach/The Need for Microservices Platforms |
|
|
270 | (1) |
|
10.2 Foundational Capabilities of Microservices Platforms |
|
|
271 | (3) |
|
10.3 Classification of Microservices Platforms |
|
|
274 | (9) |
|
10.3.1 Microservices Deployment Platforms |
|
|
275 | (1) |
|
10.3.1.1 Overview of Kubernetes |
|
|
276 | (2) |
|
10.3.2 Microservices Security Platform and ServiceResiliency Platform |
|
|
278 | (1) |
|
|
|
279 | (1) |
|
10.3.4 Microservices Development Platforms |
|
|
280 | (3) |
|
|
|
283 | (2) |
| Index |
|
285 | |