Building Microservices: Designing Fine-Grained System by Sam Newman

  • View
    1.722

  • Download
    0

  • Category

    Software

Preview:

Citation preview

services?What is Microservices?

Microservices are small, autonomous services that work

together

ModelliModelling Microservices

What makes a good service? Loose Coupling + High Cohesion

The Bounded ContextSpecific responsibility enforced by explicit boundaries

grationIntegration

Avoid breaking changes

Technology Agnostics

Simple for Consumers

Hide internal implementation detail

Integration Technology - what are we looking for?

Avoid at all cost:The Shared Database

Decide between:

Synchronous vs AsynchronousOrchestration vs Choreography

RecommendationsAvoid database integration at all cost

Strongly consider REST for request/response integration

Prefer choreography over orchestration

Avoid breaking changes and the need to version

User IntUser Interface

API Composition

UI Fragment Composition

API Gateway - not like this

Backends for Frontends done properly

estingTesting

Mike Cohn’s Test Pyramid

End-to-end tests are...Flaky, brittle, and slow

Consumer-Driven tests to the rescueNo real tests against the real consumers, use consumer-driven contract (CDC)

Recommendations

Optimize for fast feedback

Avoid end-to-end tests when possible (use consumer-driven contracts)

Use consumer-driven contracts to provide conversation between teams

Understand the trade-off between putting more efforts into testing and detecting

issues faster in production

Topics not coveredSplitting the Monolith

Deployment

Monitoring

Security

...and many more

Any organization that designs a system will inevitably produce a design whose structure is a copy of the

organization’s communication structure

Recommended