Microservices

  • Small services
  • Independently deployable units
  • For scalability and availability
  • Fault isolation

Microservice Architecture

microservice-architecture Image: microservices.io

Monoliths vs Microservices

monoliths-vs-microservices Image: martinfowler.com

infographic-microservices Image: pivotal.io

Scale cube

scale-cube Image: microservices.io

Service

Service-oriented architecture (SOA) - A service is a discrete unit of functionality that can be accessed remotely and acted upon and updated independently

Philosophy

  • Continuous integration and delivery/deployment (CI/CD)
  • Cloud native
  • Enterprise application
  • Loosely coupled, collaborating services
  • Expose an API for 3rd parties to consume
  • Integrate with other applications, external services
  • Support web, mobile web, native mobile applications

Do one thing and do it well - Unix philosophy

  • Decomposition
    • Single responsibility principle (SRP) - a responsibility of a class as a reason to change, and states that a class should only have one reason to change.
    • Common closure principle (CCP) - classes that change for the same reason should be in the same package.
    • Decompose by business capability
    • Decompose by Domain-driven design (DDD) subdomain.
    • Decompose by verbs / nouns / usecases
  • Representational state transfer (REST)
  • Atomicity, consistency, isolation, durability (ACID)
  • Cross-cutting concern
    • Persistence
    • Caching
    • Security
    • Logging

Reference Sites

Books

building-microservices-book

microservice-patterns-book