ArtisanTinkerer.github.io

Blog

View on GitHub

title: “Building-Microservices” date: 2018-09-07 layout: default —

https://martinfowler.com/articles/microservices.html

Alternative to monolith

Microservices

### Smart endpoints and dumb pipes

### Decentralized Data Management

### Infrastructure Automation

### Design for failure

### Evolutionary Design

# Sam Newman - Building Microservices

## Loose Coupling

## Synchronous Versus Asynchronous

###Two styles of architecture:

#### Orchestration Central brain guides and drives the process.

#### Choreography Inform each part of the system of it’s job and let it work out the details (finding their way and reacting to others around them. ).

Example: uses Orchestration and request/response, customer service is the brain and can therefore track where a customer is in the process.

With choreographed approach

** I strongly prefer aiming for a choreographed system, where each service is smart enough to understand its role in the whole dance. **

Callbacks?

RPC

REST

Hypermedia As the Engine of Application State (HATEOAS)

### Implementing Asynchronous Event-Based Collaboration

### Complexities of Asynchronous Architectures

### DRY and code reuse

### Access by reference

### Versioning

zzzz

### Summary

Prefer choreography over orchestration.

## Splitting the Monolith

### Example: Shared Static Data Country codes used by several services, options:

1, Db with them in for each service - data consistency challenge 2, Treat static data as code - property file or enum - same consistency challenge 3, Static data in a service. Page 160

### Transactional Boundaries

#### What to do? Eventual consistency is easier to build.

### Reporting

### Cost of Change

## Chapter 4 Microservices Communication Styles In-process - calls within a single process Inter-Process - calls between different processes across a network

We are currently using request-response.

### Synchronous blocking Service calls other service and waits. ### Asynchchronous nonblocking Service makes a call and then carries on processing. ### Request-response Service sends a response and expects a response. ### Event-driven Services emit events. Service emitting is unaware services which consume.

### Common data Services collaborate via shared data source (not common).

## Chapter 6 Deployment ## Chapter 7 Testing Mocking or stubbing - maybe my portal - azure tests are wrong (end-to-end tests?)

## Chapter 8 Monitoring ## Chapter 9 Security ## Chapter 10 Conway’s Law and System Design

# Pakt press books # Level up with a microservices architecture https://confpad.io/2018-10-18-laracon-au-2018/9-level-up-with-a-microservices-architecture