More on this book
Community
Kindle Notes & Highlights
by
Sam Newman
Read between
December 3 - December 3, 2015
Building a Team
The Bounded Context
the analogy of cells, where “[c]ells can exist because their membranes define what is in and out and determine what can pass.”
having an existing codebase you want to decompose into microservices is much easier than trying to go to microservices from the beginning.
ask first “What does this context do?”, and then “So what data does it need to do that?”
The Technical Boundary It can be useful to look at what can go wrong when services are modeled incorrectly.
Both services spoke in terms of low-level, RPC-style method calls,
SOAP? XML-RPC? REST? Protocol buffers?
Enrolling a new customer may need to kick off additional processes,
Synchronous Versus Asynchronous
remote procedure call (RPC) and REpresentational State Transfer (REST).
Remote Procedure Calls Remote procedure call refers to the technique of making a local call and having it execute on a remote service somewhere.
TCP offers guarantees about delivery, whereas UDP doesn’t but has a much lower overhead.
They can fail fast, they can fail slow, and they can even malform your packets.
A failure could be caused by the remote server returning an error, or by you making a bad call. Can you tell the difference, and if so, can you do anything about it?
REST REpresentational State Transfer (REST) is an architectural style inspired by the Web.
I strongly recommend you take a look at the Richardson Maturity Model, where the different styles of REST are compared.
Use it badly, and it can be as insecure and hard to scale as any other technology out there. Use it right, though, and you get a lot of help.
The Hypertext Application Language (HAL) attempts to fix this by defining some common standards for hyperlinking for JSON
One pattern I saw used effectively by one of our teams was to delay the implementation of proper persistence for the microservice, until the interface had stabilized enough.
For server-to-server communications, if extremely low latency or small message size is important, HTTP communications
REST in Practice (O’Reilly),
Traditionally, message brokers like RabbitMQ try to handle both problems.
you observe the outcome of an operation (or set of operations) and react when something changes.
RealEstate.com.au makes use of a tailored service template to help bootstrap new service creation.
With events, we’re saying this happened, but we need to know what happened. If we’re receiving updates due to a Customer resource changing, for example, it could be valuable to us to know what the Customer looked like when the event occurred.
Defer It for as Long as Possible The best way to reduce the impact of making breaking changes is to avoid making them in the first place.
Semantic versioning is a specification that allows just that. With semantic versioning, each version number is in the form MAJOR.MINOR.PATCH. When the MAJOR number increments, it means that backward incompatible changes have been made. When MINOR increments, new functionality has been added that should be backward compatible. Finally, a change to PATCH states that bug fixes have been made to existing functionality.
when I retrieve a customer record, do I need to pull back all the same data for a mobile shop as I do for a helpdesk application? One solution to this approach is to allow consumers to specify what fields to pull back when they make a request, but this assumes that each service supports this form of interaction.
Backends for Frontends
use of these backends to one specific user interface or application, as we see in Figure 4-10.
Staging a service separation
Chef, Puppet, and Ansible all support multiple different common technology-specific build artifacts too.

