About the Author |
|
xix | |
Foreword |
|
xxi | |
Introduction |
|
xxiii | |
|
|
|
Chapter 1 Hello, Service Fabric! |
|
|
3 | (24) |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
Applications and Services |
|
|
8 | (1) |
|
|
8 | (1) |
|
|
9 | (1) |
|
|
9 | (1) |
|
Guest Applications and Containers |
|
|
10 | (1) |
|
|
10 | (1) |
|
Setting Up a Development Environment in Windows |
|
|
10 | (1) |
|
Provisioning a Service Fabric Cluster on Azure |
|
|
11 | (4) |
|
|
15 | (4) |
|
Managing Your Local Cluster |
|
|
19 | (1) |
|
Visual Studio Cloud Explorer |
|
|
19 | (2) |
|
|
21 | (3) |
|
|
24 | (1) |
|
|
25 | (1) |
|
|
26 | (1) |
|
Chapter 2 Stateless Services |
|
|
27 | (22) |
|
Implementing ASP.NET Core Applications |
|
|
27 | (4) |
|
Scalability and Availability of a Stateless Service |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
32 | (1) |
|
Implementing Communication Stacks |
|
|
32 | (1) |
|
Default Communication Stack |
|
|
32 | (9) |
|
|
41 | (4) |
|
Custom Communication Stack |
|
|
45 | (3) |
|
|
48 | (1) |
|
Chapter 3 Stateful Services |
|
|
49 | (18) |
|
Architecture of Service Fabric Stateful Services |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
The Simple Store Application |
|
|
52 | (1) |
|
The Shopping-Cart Service |
|
|
52 | (4) |
|
|
56 | (5) |
|
|
61 | (2) |
|
|
63 | (1) |
|
|
63 | (1) |
|
|
64 | (2) |
|
|
66 | (1) |
|
|
67 | (24) |
|
Service Fabric Reliable Actors |
|
|
68 | (1) |
|
|
68 | (1) |
|
|
68 | (1) |
|
|
68 | (1) |
|
|
69 | (1) |
|
|
69 | (1) |
|
An Actor-Based Tic-Tac-Toe Game |
|
|
70 | (1) |
|
|
70 | (1) |
|
|
71 | (1) |
|
Defining the Actor Interface |
|
|
71 | (1) |
|
Implementing the Game Actor |
|
|
72 | (2) |
|
Implementing the Player Actor |
|
|
74 | (1) |
|
Implementing the Test Client |
|
|
75 | (2) |
|
|
77 | (1) |
|
|
77 | (1) |
|
Timers, Reminders, and Events |
|
|
78 | (1) |
|
|
78 | (1) |
|
|
79 | (1) |
|
|
80 | (1) |
|
Service Diagnostics and Performance-Monitoring Basics |
|
|
81 | (1) |
|
Event Tracing For Windows |
|
|
81 | (2) |
|
|
83 | (4) |
|
Actors and Reliable Services |
|
|
87 | (1) |
|
|
88 | (2) |
|
|
90 | (1) |
|
Chapter 5 Service Deployments and Upgrades |
|
|
91 | (26) |
|
The Service Fabric Application-Deployment Process |
|
|
91 | (1) |
|
|
91 | (5) |
|
|
96 | (1) |
|
|
97 | (1) |
|
|
97 | (1) |
|
The Service Fabric Health Model |
|
|
97 | (2) |
|
|
99 | (1) |
|
|
99 | (2) |
|
Health Reporting and Aggregation |
|
|
101 | (1) |
|
|
101 | (1) |
|
|
102 | (2) |
|
Upgrade Modes and Upgrade Parameters |
|
|
104 | (3) |
|
|
107 | (1) |
|
Application Parameters and Parameter Files |
|
|
107 | (1) |
|
Application Publish Profiles |
|
|
108 | (1) |
|
|
108 | (1) |
|
|
108 | (1) |
|
|
109 | (2) |
|
Hosting a Node.js Application |
|
|
111 | (4) |
|
|
115 | (2) |
|
Chapter 6 Availability and Reliability |
|
|
117 | (28) |
|
|
117 | (1) |
|
|
118 | (1) |
|
|
118 | (1) |
|
Service Fabric Services Availability |
|
|
119 | (1) |
|
|
119 | (1) |
|
|
120 | (6) |
|
|
126 | (1) |
|
Routing and Load-Balancing |
|
|
127 | (4) |
|
Advanced Rolling Upgrades |
|
|
131 | (2) |
|
Service Fabric Services Reliability |
|
|
133 | (1) |
|
Event Tracing for Windows |
|
|
134 | (1) |
|
|
134 | (2) |
|
|
136 | (5) |
|
Service State Backup and Restore |
|
|
141 | (4) |
|
Chapter 7 Scalability and Performance |
|
|
145 | (28) |
|
|
145 | (1) |
|
Vertical Scaling vs. Horizontal Scaling |
|
|
145 | (1) |
|
Stateless Services vs. Stateful Services |
|
|
146 | (1) |
|
Homogeneous Instances vs. Heterogeneous Instances |
|
|
146 | (1) |
|
Single Tenancy vs. Multi-Tenancy |
|
|
147 | (1) |
|
Manual Scaling vs. Autoscaling |
|
|
148 | (3) |
|
Scaling a Service Fabric Cluster |
|
|
151 | (1) |
|
Azure Resource Manager and Azure Virtual Machine Scale Sets |
|
|
151 | (1) |
|
Manually Scaling a Service Fabric Cluster |
|
|
152 | (2) |
|
Autoscaling a Service Fabric Cluster |
|
|
154 | (3) |
|
Scaling with Content Delivery Network |
|
|
157 | (2) |
|
|
159 | (1) |
|
|
159 | (5) |
|
Communication Bottlenecks |
|
|
164 | (1) |
|
Orchestration Bottlenecks |
|
|
165 | (8) |
|
PART II SERVICE LIFE CYCLE MANAGEMENT |
|
|
|
Chapter 8 Service Fabric Scripting |
|
|
173 | (26) |
|
|
173 | (1) |
|
Creating a Secured Service Fabric Cluster Using PowerShell |
|
|
174 | (1) |
|
Using a Certificate to Protect Your Cluster |
|
|
174 | (4) |
|
Using a Certificate for Client Authentication |
|
|
178 | (1) |
|
Using Azure Active Directory for Client Authentication |
|
|
178 | (2) |
|
Publishing Applications to a Secured Cluster from Visual Studio |
|
|
180 | (1) |
|
Cluster Management Commands |
|
|
181 | (1) |
|
|
181 | (9) |
|
|
190 | (2) |
|
Application-Management Commands |
|
|
192 | (1) |
|
|
192 | (1) |
|
|
193 | (1) |
|
Rolling Back an Application |
|
|
194 | (1) |
|
Decommissioning an Application |
|
|
195 | (1) |
|
|
195 | (2) |
|
|
197 | (2) |
|
Chapter 9 Cluster Management |
|
|
199 | (14) |
|
Anatomy of a Service Fabric Cluster |
|
|
199 | (1) |
|
Virtual Machine Scale Sets |
|
|
200 | (1) |
|
Virtual Machines and Virtual Network Cards |
|
|
201 | (1) |
|
|
202 | (1) |
|
|
203 | (3) |
|
|
206 | (1) |
|
Advanced Service Fabric Cluster Configuration |
|
|
206 | (1) |
|
Role-Based Access Control |
|
|
206 | (1) |
|
|
207 | (4) |
|
|
211 | (1) |
|
Updating Cluster Settings |
|
|
212 | (1) |
|
Chapter 10 Diagnostics and Monitoring |
|
|
213 | (26) |
|
|
213 | (1) |
|
Diagnostics Data Pipeline |
|
|
213 | (2) |
|
Configure Azure Diagnostics |
|
|
215 | (3) |
|
Microsoft Diagnostics EventFlow |
|
|
218 | (3) |
|
Using Elasticsearch, Kibana, and EventFlow |
|
|
221 | (4) |
|
Azure Operations Management Suite |
|
|
225 | (4) |
|
Troubleshooting on Service Fabric Nodes |
|
|
229 | (1) |
|
|
229 | (1) |
|
|
230 | (2) |
|
|
232 | (7) |
|
Chapter 11 Continuous Delivery |
|
|
239 | (26) |
|
|
239 | (1) |
|
|
239 | (1) |
|
|
240 | (1) |
|
|
241 | (1) |
|
Setting Up Continuous Integration |
|
|
242 | (1) |
|
Preparing the Visual Studio Team Services Project |
|
|
242 | (4) |
|
Creating a Build Definition |
|
|
246 | (3) |
|
Setting Up Continuous Delivery |
|
|
249 | (1) |
|
Creating a Release Definition |
|
|
249 | (2) |
|
Requesting Deployment Approvals |
|
|
251 | (1) |
|
|
252 | (1) |
|
|
253 | (1) |
|
|
253 | (1) |
|
|
254 | (1) |
|
|
255 | (1) |
|
Setting Up Automated Tests |
|
|
256 | (1) |
|
|
256 | (1) |
|
Setting Up Gated Check-Ins |
|
|
257 | (2) |
|
Running Load Tests with VSTS |
|
|
259 | (6) |
|
PART III LINUX AND CONTAINERS |
|
|
|
Chapter 12 Service Fabric on Linux |
|
|
265 | (14) |
|
Service Fabric Hello, World! on Linux |
|
|
265 | (1) |
|
Setting Up Your Linux Development Environment |
|
|
265 | (2) |
|
|
267 | (3) |
|
Using Communication Listeners |
|
|
270 | (4) |
|
Other Service Types and Frameworks |
|
|
274 | (1) |
|
|
274 | (1) |
|
|
275 | (1) |
|
|
276 | (1) |
|
|
277 | (2) |
|
|
279 | (20) |
|
|
279 | (1) |
|
Containerization on Linux |
|
|
279 | (2) |
|
|
281 | (1) |
|
|
282 | (1) |
|
|
282 | (4) |
|
Running Docker on Windows |
|
|
286 | (1) |
|
|
286 | (1) |
|
Service Fabric and Docker |
|
|
286 | (1) |
|
Hosting an ASP.NET Core Container on Windows |
|
|
287 | (3) |
|
Hosting a Minecraft Server Container on Linux |
|
|
290 | (7) |
|
Continuous Deployment with Jenkins |
|
|
297 | (2) |
|
Chapter 14 Container Orchestration |
|
|
299 | (26) |
|
Microservices Application and Orchestration Engines |
|
|
299 | (1) |
|
A Generic Microservice Application Model |
|
|
299 | (1) |
|
|
300 | (1) |
|
Container Orchestration with Service Fabric |
|
|
301 | (1) |
|
|
301 | (5) |
|
|
306 | (3) |
|
Docker Compose with Service Fabric |
|
|
309 | (1) |
|
Defining the Master Image |
|
|
310 | (1) |
|
|
311 | (1) |
|
Composing the Services with Docker Compose |
|
|
312 | (1) |
|
Deploying and Testing the Application |
|
|
312 | (2) |
|
|
314 | (1) |
|
|
314 | (2) |
|
Deploying Envoy on Service Fabric |
|
|
316 | (9) |
|
PART IV WORKLOADS AND DESIGN PATTERNS |
|
|
|
|
325 | (18) |
|
|
325 | (1) |
|
|
325 | (1) |
|
Azure Container Service (AKS) |
|
|
326 | (1) |
|
Virtual Machine Scale Sets |
|
|
326 | (1) |
|
|
326 | (1) |
|
|
327 | (1) |
|
|
328 | (1) |
|
|
329 | (1) |
|
|
329 | (1) |
|
|
330 | (1) |
|
|
331 | (1) |
|
|
331 | (1) |
|
|
332 | (1) |
|
|
332 | (3) |
|
|
335 | (3) |
|
|
338 | (1) |
|
Designing an Extensible Control Plane |
|
|
339 | (1) |
|
A Generic Control Plane Architecture |
|
|
340 | (2) |
|
|
342 | (1) |
|
Chapter 16 Scalable Interactive Systems |
|
|
343 | (24) |
|
Interactive System Techniques |
|
|
343 | (1) |
|
|
343 | (4) |
|
|
347 | (1) |
|
|
348 | (1) |
|
|
348 | (1) |
|
|
349 | (1) |
|
|
349 | (1) |
|
Real-Time Data-Streaming Pipelines |
|
|
350 | (1) |
|
Composable Processing Pipelines |
|
|
350 | (1) |
|
Implementing a Processing Sequence |
|
|
351 | (6) |
|
Processing Topologies with Actors |
|
|
357 | (1) |
|
|
358 | (1) |
|
|
358 | (1) |
|
|
359 | (1) |
|
|
359 | (1) |
|
Exercise: Using WebSocket for Live Data Processing |
|
|
360 | (1) |
|
|
361 | (1) |
|
|
362 | (1) |
|
|
363 | (1) |
|
|
364 | (1) |
|
|
364 | (1) |
|
|
365 | (2) |
|
Chapter 17 System Integration |
|
|
367 | (26) |
|
|
367 | (1) |
|
|
368 | (3) |
|
|
371 | (2) |
|
|
373 | (1) |
|
|
373 | (4) |
|
|
377 | (1) |
|
Enable SSL with Custom Domain |
|
|
378 | (1) |
|
Integration with Service Brokers |
|
|
379 | (1) |
|
|
380 | (1) |
|
Open Service Broker for Azure |
|
|
381 | (1) |
|
Service Fabric Service Catalog Service |
|
|
381 | (2) |
|
Integration Patterns with Messaging |
|
|
383 | (1) |
|
|
383 | (1) |
|
|
384 | (1) |
|
|
385 | (1) |
|
|
386 | (1) |
|
Composing Service Fabric Services |
|
|
387 | (6) |
|
|
|
Chapter 18 Serverless Computing |
|
|
393 | (16) |
|
What Is Serverless Computing? |
|
|
393 | (1) |
|
|
393 | (1) |
|
|
394 | (1) |
|
|
395 | (1) |
|
|
396 | (1) |
|
|
397 | (1) |
|
Azure Container Instances |
|
|
397 | (1) |
|
|
398 | (1) |
|
|
399 | (2) |
|
|
401 | (2) |
|
Reactive Messaging Patterns with Actors |
|
|
403 | (1) |
|
|
403 | (1) |
|
|
403 | (3) |
|
|
406 | (1) |
|
|
406 | (1) |
|
Sea Breeze Design Principles |
|
|
407 | (1) |
|
Fully Managed Environment |
|
|
407 | (1) |
|
Container-Based Environment |
|
|
408 | (1) |
|
|
408 | (1) |
|
Chapter 19 Artificial Intelligence |
|
|
409 | (28) |
|
A Brief Introduction to Artificial Intelligence |
|
|
409 | (1) |
|
|
409 | (1) |
|
|
410 | (1) |
|
|
411 | (1) |
|
|
411 | (2) |
|
|
413 | (1) |
|
Using Azure Machine Learning Studio |
|
|
413 | (4) |
|
Calling the Service from Service Fabric |
|
|
417 | (1) |
|
Using the Cognitive Services Recommendation API |
|
|
418 | (1) |
|
|
418 | (1) |
|
Building an OCR Application |
|
|
419 | (2) |
|
Exploring Image-Analysis Applications |
|
|
421 | (1) |
|
Natural Language Processing |
|
|
422 | (1) |
|
|
423 | (2) |
|
Understanding the User's Intention |
|
|
425 | (3) |
|
|
428 | (1) |
|
Using the Bot Framework and Bot Service |
|
|
428 | (2) |
|
Embedding a Web-Based Bot UI in Your Application |
|
|
430 | (1) |
|
|
431 | (1) |
|
TensorFlow and Service Fabric |
|
|
432 | (1) |
|
Deploying a TensorFlow Cluster Using Service Fabric |
|
|
433 | (1) |
|
Running a Clustered Jupyter Notebook with TensorFlow Containers |
|
|
434 | (3) |
|
Chapter 20 Orchestrating an Organic Compute Plane |
|
|
437 | (36) |
|
Moving Data Through Static Compute |
|
|
437 | (1) |
|
Data Generation and Feedback |
|
|
438 | (1) |
|
|
438 | (1) |
|
|
439 | (1) |
|
Data Transformation and Analysis |
|
|
439 | (1) |
|
|
440 | (1) |
|
|
441 | (1) |
|
Sample Patterns with Static Compute |
|
|
441 | (7) |
|
|
448 | (14) |
|
|
462 | (1) |
|
|
463 | (3) |
|
|
466 | (3) |
|
|
469 | (4) |
|
|
|
Appendix A Using Microsoft Azure PowerShell Commands |
|
|
473 | (6) |
|
|
479 | (4) |
Index |
|
483 | |