Building Microservices, 2nd Edition

The 2nd edition is a complete rewrite of the previous best selling edition

It is aimed at giving a broad overview of all aspects related to microservices. Giving a firm foundation in the basics, it goes further, covering off all aspects of the software delivery process, and how they are impacted by adopting a microservice architecture.

Free Chapter

The first chapter of the book is available for free. It makes for a good introduction into microservices in general, whilst also giving you an idea of what to expect from the rest of the book itself.

Get Chapter 1 For Free

How To Get The Book

The book is widely available from booksellers, and you also have the option to read it as part of an O'Reilly Subscription.

Read on O'Reilly Learning Online Buy on Amazon.co.uk šŸ‡¬šŸ‡§ Buy on Amazon.com šŸ‡ŗšŸ‡ø

Translations & Other Editions

The book is available in a number of alternative editions and translations, with more planned.

Currently, the book is available in the following formats:

The following translations are also agreed. Where possible, I'll include estimates for when they will become available.

  • Chinese Complex, from GoTop Information Inc. No ETA.
  • Chinese Simplified, from Posts & Telecom Press. No ETA.
  • Japanese, from O'Reilly Japan Inc. Estimated release in November 2022.
  • Korean, from Hanbit Media, Inc. No ETA.
  • Polish, from Helion. Estimated release in June 22. ISBN: 9788328388000.
  • Russian, from Progress Kniga. No ETA.
  • Serbian, from CET Computer Equipment & Trade. No ETA.

If you are interested in helping translate the book into a language not seen here, then please contact me and I'll put you in touch with the right people at O'Reilly.

What's New?

This 2nd edition involves every page of the best selling 1st edition being reviewed and where appropriate reworked, with new topics covered for the first time. This edition will be reflecting the shifts in the use of microservices over the last five years, including an exploration of some of the new technology which has emerged.

In the 2nd edition, I have spent more time sharing explicit examples to better explain the ideas. Every chapter has been re-examined, every sentence reviewed. Not a lot of the 1st edition remains in terms of concrete prose, but the ideas are all still here. I've tried to be clearer in my own opinions, while still recognizing that there are often multiple ways of solving a problem. This has meant that I've expanded the discussion of inter-process communication, which is now split across three chapters. I've also spent more time looking at the implications of technology like containers, Kubernetes and serverless ā€” as a result there are now separate build and deployment chapters.

My hope had been to create a book that was around the same size as the 2nd edition, but find a way to pack more ideas in. As you can see, I have failed at that taskā€”the 2nd edition is bigger! But I think I've succeeded in being more explicit and more clear in how I articulate the ideas.

Contents

This book is primarily organized in a topic-based format. I have structured and written the book as though you are reading it from beginning to end, but of course you may want to jump into the specific topics that interest you the most.

The main body of the book is broken into three separate partsā€”Foundation, Implementation, and People. Letā€™s look at what each part covers.

Part I, Foundation

In this part, I detail some of the core ideas behind microservices.

  • Chapter 1, What Are Microservices? This is a general introduction to microservices, first introducing a number of topics that we expand later in the book.
  • Chapter 2, How to Model Microservices The importance of concepts like information hiding, coupling, cohesion, and domain-driven design in helping find the right boundaries for your microservices.
  • Chapter 3, Splitting the Monolith Some guidance on how to take an existing monolithic application and break it apart into microservices.
  • Chapter 4, Microservice Communication Styles A discussion of the different types of microservice communication, including asynchronous vs synchronous calls, request-response and event-driven collaboration styles.

Part II, Implementation

Moving from higher-level concepts to more implementation detail, we look at techniques and technologies to help get the best out of microservices.

  • Chapter 5, Implementing Microservice Communication A deeper look at the specific technologies used to implement inter-microservice communication.
  • Chapter 6, Workflow A comparison of Sagas and distributed transactions and their usefulness in modā€ eling business processes involving multiple microservices.
  • Chapter 7, Build Mapping from a microservice to repositories and builds.
  • Chapter 8, Deployment The myriad options around deploying a microservice, including a look at conā€ tainers, Kubernetes and FAAS.
  • Chapter 9, Testing The challenges of testing microservices, including the issues caused by end-to- end tests, and how consumer-driven contracts and in-production testing can help.
  • Chapter 10, From Monitoring to Observability Covers the shift in thinking from static monitoring activities, to thinking more broadly about how improve the observability of microservice architectures, along with some specific recommendations regarding tooling.
  • Chapter 11, Security Microservice architectures can increase the surface area of attack, but also give us more opportunity to defend in depth. In this chapter we explore this balance.
  • Chapter 12, Resiliency A wider look at what resiliency is, and what part microservices can play in improving the resiliency of your applications.
  • Chapter 13, Scaling In this chapter I outline the four axis of scaling, and show how they can be used in combination to scale a microservice architecture.

Part III, People

Ideas and technology donā€™t mean anything without the people and organization to back them up.

  • Chapter 14, User Interfaces From moving away from dedicated front-end teams to the use of BFFs and GraphQL, this chapter explores how microservices and user interfaces can work together.
  • Chapter 15, Organizational Structures Focuses on how stream-aligned and enabling teams can work in the context of microservice architectures.
  • Chapter 16, The Evolutionary Architect Microservice architectures arenā€™t static, so your view of system architecture may need to changeā€”a topic that this chapter explores in depth.

Frequently Asked Questions

Got a question about the book? Then get in touch

Why Did You Write A Second Edition?

I wrote the first edition of Building Microservices in around a year, starting at the beginning of 2014, with the book being released early 2015. This was early in the microservices story, at least in terms of the wider industry's awareness of the term. Since then microservices have gone mainstream in a way that I couldn't predict. With that has come a much wider set of experiences to draw upon, and more technology to explore.

As I worked with more teams in the wake of the first edition, I started to refine my thinking around some of the ideas associated with microservices. In some cases, this meant that ideas which were only at the periphery of my thinking, like information hiding, started to become more clear as foundational concepts that needed to be better highlighted. In other areas, new technology presented both new solutions and new problems for our systems. Seeing so many people flock to Kubernetes in the hope that it would solve all their issues with microservice architectures was certainly one of those moments that gave me pause for thought.

I'd also written the 1st edition of Building Microservices to be not just about what microservices are, but also as a broad overview how this architectural approach changes aspects of software development. So as I looked more deeply at aspects around security, or resiliency, I found myself wanting to go back and expand on those topics that are increasingly important to modern software development.