Microservice Communication Styles and Patterns
Published by O'Reilly Media, Inc.
Selecting the best solution for your system
There are so many different technologies you can use to communicate between microservices. So many that the choices become overwhelming. Should you use a message broker? gRPC? REST over HTTP? The added complexity here is that new communication technologies are being added all the time, making it harder to choose the right way forward.
If architecture is about the boxes and arrows, this talk looks at what is behind these lines. In this workshop Sam will outline the different styles of communication available to you in a technology-agnostic way, helping you pick the right path for your situation even against a background of ever-changing technology.
This class will look at the fundamental styles of communication, practical tips for ensuring the calls work in the way you want, and also some guidance on commonly used technology in this space. You’ll learn the difference between synchronous, asynchronous, and event-driven communication, the strengths and weaknesses of different styles, and how to effectively mix the styles together. You’ll also learn how to make the communication between microservices more reliable, and see the interplay between microservice communication patterns and organisational communication.
What you’ll learn and how you can apply it
- The difference between Request Response and Event-Driven communication patterns
- Why the distinction between asychronous and synchronous communication is more confusing than you might expect
- When and how to mix communication styles
- Dealing with latency
- When to use retries and timeouts
- The role of API Gateways and service meshes
- Using Sagas for implementing business processes
This live event is for you because...
- You want to understand how to select the most appropriate style of communication for your microservice architecture
- You are struggling with the performance or reliability of your existing microservice calls
Prerequisites
- A basic understanding of microservices
Recommended preparation:
- Take Microservice fundamentals (live online training course with Sam Newman) (useful but not required)
Recommended follow-up:
- Take API Style Fundamentals (live online training course)
- Read: Building Microservices, 2E (book)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
From method calls to service calls (30 minutes)
- Lecture: How method calls and service calls vary; performance and error handling; why mapping directly from method calls to service calls can be dangerous
- Q&A
A model for microservices collaboration (45 minutes)
- Lecture: Synchronous and asynchronous integration; request/response versus event-based collaboration; a model for selecting different technologies
- Break (10 minutes)
Breaking changes in a microservice architecture (30 minutes)
- Lecture: How to roll out breaking contract changes while ensuring you have independent deployability; supporting ideas like schemes and consumer-driven contracts
- Q&A
- Break (10 minutes)
Sagas (45 minutes)
- Lecture: Sagas—the answer to having lots of services collaborate to perform complex business processes; the generic saga pattern; how it can be implemented using a choreographed or orchestrated style
- Wrap-up and Q&A (10 minutes)
Your Instructor
Sam Newman
Sam Newman is a technologist focusing on the areas of cloud, microservices, and continuous delivery—three topics which seem to overlap frequently. He provides consulting, training, and advisory services to startups and large multinational enterprises alike, drawing on his more than 20 years in IT as a developer, sysadmin, and architect. Sam is the author of the best-selling Building Microservices and Monolith to Microservices, both from O’Reilly, and is also an experienced conference speaker.