Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Microservice Everything Redux Eng

Microservice Everything Redux Eng

Microservice everything redux - English version

Jakub Marchwicki

March 28, 2019
Tweet

More Decks by Jakub Marchwicki

Other Decks in Technology

Transcript

  1. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 2/98 @kubem ~ http://jakub.marchwicki.pl the

    5 why’s of microservices the 5 why’s of microservices Microservices? Microservices? Microservices? Microservices? Microservices? Why? Why? Oh, why? Oh dear God, why? Damn it! Why?
  2. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 4/98 @kubem ~ http://jakub.marchwicki.pl microservices,

    how it all started? microservices, how it all started? All names, characters, and incidents portrayed in this story are ctitious. No identi cation with actual persons (living or deceased), places, and buildings is intended or should be inferred.
  3. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 17/98 @kubem ~ http://jakub.marchwicki.pl microservices

    microservices — James Lewis and Martin Fowler “the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API
  4. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 19/98 @kubem ~ http://jakub.marchwicki.pl µservices

    µservices Small business domain Independent; independently deployed Running in it’s own process Managing it’s data Loosely integrated using common communication protocols
  5. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 22/98 @kubem ~ http://jakub.marchwicki.pl microservices

    are good microservices are good Clean code Single responsibility modules Faster than monoliths Easier to manage Easier to scale Docker, Docker, Docker, Docker potentialy faster to deploy, works faster independent teams, independent codebases at this point we should at least mention Docker
  6. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 24/98 @kubem ~ http://jakub.marchwicki.pl (…

    ) collection of task-oriented or dedicated systems that pool their resources and capabilities together to create a new, more complex system which offers more functionality and performance than simply the sum of the constituent systems
  7. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 25/98 @kubem ~ http://jakub.marchwicki.pl system

    of systems system of systems (… ) collection of task-oriented or dedicated systems that pool their resources and capabilities together to create a new, more complex system which offers more functionality and performance than simply the sum of the constituent systems
  8. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 32/98 // Exibit A +------------------+

    +-------------+ | | | | | Access control | | Resources | | | | service | +------------------+ | | +-------------+ +----------------+ | | | Users | | repository | | | +----------------+ //
  9. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 33/98 // Exibit A +------------------+

    +-------------+ | | | | | Access control | | Resources | | | | service | +------------------+ | | +-+-----------+ ^ | | +----------------+ | | | | | Users | | | repository | | | | | +----------------+ (1) + //
  10. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 34/98 // Exibit A +------------------+

    +-------------+ | | | | | Access control | | Resources | | | | service | +------------------+ | | +-+-------+---+ ^ | | | | | +----------------+ | | | | | | | Users | | | (2) | repository | | +-----------> | | | +----------------+ (1) + //
  11. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 35/98 // Exibit A +------------------+

    +-------------+ | | | | | Access control | | Resources | | | | service | +------------------+ | +<---------+ +-+-------+---+ (3) | ^ | | | | | | | +----------------+ | | | | | | | Users | | | (2) | repository | | +-----------> | | | +----------------+ (1) + //
  12. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 36/98 // Exibit A +------------------+

    +-------------+ | | | | (4) | Access control | | Resources +------------>+ | | service | +------------------+ | +<---------+ +-+-------+---+ (3) | ^ | | | | | | | +----------------+ | | | | | | | Users | | | (2) | repository | | +-----------> | | | +----------------+ (1) + //
  13. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 37/98 // Exibit A +------------------+

    +-------------+ | | | | (4) | Access control | | Resources +------------>+ | | service | +------------------+ | +<---------+ +-+-------+---+ (3) | ^ | | | | | | | | | | +----------------+ | | | | | | | | | Users | | | | (2) | repository | | | +-----------> | | | | +----------------+ (1) | + | (5) v //
  14. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 39/98 @kubem ~ http://jakub.marchwicki.pl microservices

    journey microservices journey — Christopher Alexander “A Piecemeal Growth is the process of building something a step at a time. Each step consists of evaluating the current system, deciding what should be done next (what should be fixed or improved) and then adding a piece or making a change.
  15. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 41/98 +-----------------------------------------------+ | | |

    +-----------------------------------+ | | | | | | | Boundary: SOAP | | | | | | | +-----------------------------------+ | | | | | | | EJB | | | | | | | +-----------------------------------+ | | | | | | +--------+ +-------+ +----------+ | | | | | | | | | | | JAX-WS | | JPA | | DROOLS | | | | | | | | | | | +--------+ +-------+ +----------+ | | | | | | JBoss 4.2.x | | | +-----------------------------------------------+
  16. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 43/98 +-----------------------------------------------+ | | |

    +--------------------+--------------+ | | | | | | | | Boundary: SOAP | JSF | | | | | | | | +--------------------+--------------+ | | | | | | | EJB | | | | | | | +-----------------------------------+ | | | | | | +--------+ +-------+ +----------+ | | | | | | | | | | | JAX-WS | | JPA | | DROOLS | | | | | | | | | | | +--------+ +-------+ +----------+ | | | | | | JBoss 4.2.x | | | +-----------------------------------------------+
  17. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 44/98 +-----------------------------------------------+ | | |

    +-----------------+-----------------+ | +---------------+ | | | | | | | | | Boundary: SOAP | REST endpoint | <--------------+ | Dedicated | | | | | | | mobile | | +-----------------+-----------------+ | | Single Page | | | | | | Application | | | EJB | | | | | | | | | | | +-----------------------------------+ | +---------------+ | | | | | +--------+ +-------+ +----------+ | | | | | | | | | | | JAX+WS | | JPA | | DROOLS | | | | | | | | | | | +--------+ +-------+ +----------+ | | | | | | JBoss 4.2.x | | | +-----------------------------------------------+
  18. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 46/98 @kubem ~ http://jakub.marchwicki.pl microservices

    checklist microservices checklist Small business domain Independent; independently deployed Running in it’s own process Managing it’s data Loosely integrated using common communication protocols     
  19. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 47/98 @kubem ~ http://jakub.marchwicki.pl microservices

    checklist microservices checklist Small business domain Independent; independently deployed Running in it’s own process Managing it’s data Loosely integrated using common communication protocols     
  20. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 49/98 @kubem ~ http://jakub.marchwicki.pl —

    James Lewis “ We define libraries as components that are linked into a program and called using in-memory calls, while services are out-of-process components who communicate with remote procedure calls
  21. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 50/98 @kubem ~ http://jakub.marchwicki.pl consumer

    driven contracts consumer driven contracts (… ) drives the development of the Provider from its Consumers point of view, which means consumer describes what and how it wants to receive the information (in a form of a contract) and then provider implements the service following the given contract.
  22. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 52/98 +--------------------------------------+ | | |

    web / controllers | | | +-----------+--------------------------+ | | (1) ^ | | v | (5) | +-------------------------------------+ | | | application logic | | | +--+-------------------------+--------+ | | | (2) ^ | (4) | | | v | (3) v | +----------+--+ +------------------+ | | | | | MySQL | | filesystem | | | | | +-------------+ +------------------+
  23. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 55/98 Proxy +-----+ +------------------+ |

    | /* | | +----------------+--------------------------> | | | | | | The Old stuff | | | | | +--------+ | | | | | | | | | +------------------+ | | | | | | | | | Elastic Search | | | | data push | | | | | | | | | | | +------------------+ | | | | /search | | | | | +--------------------------> | | <------+ | | | Elastic Search | | | | index | | | | | +-----+ +------------------+
  24. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 56/98 @kubem ~ http://jakub.marchwicki.pl microservices

    checklist microservices checklist Small business domain Independent; independently deployed Running in it’s own process Managing it’s data Loosely integrated using common communication protocols     
  25. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 58/98 @kubem ~ http://jakub.marchwicki.pl Andrew

    Tanenbaum — Distributed Systems (2007) - Principles & Paradigms “(… ) as every parent of a small child knows, converting a large object into small fragments is considerably easier than the reverse process.
  26. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 59/98 Write through update query

    +--------------------------+ +----------------------------------+ -------------------->| update denormalized view |-------->| update persistent (master) store | +--------------------------+ +----------------------------------+ Write behind update query +----------------------------------+ +---------------------------+ ---------------->| update persistent (master) store |----------->| update denormalized views | +----------------------------------+ +---------------------------+ Read through read query +--------------------------+ +---------------------------+ <---------------------| update denormalized view |<--------------| read persistent store | +--------------------------+ +---------------------------+
  27. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 69/98 @kubem ~ http://jakub.marchwicki.pl distributed

    computing distributed computing Leslie Lamport — Microsoft mailing list 1987 A distributed system is one in which the failure of a computer you didn’t even know existed can render your own computer unusable.
  28. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 71/98 @kubem ~ http://jakub.marchwicki.pl fallacies

    of distributed computing fallacies of distributed computing — 1994 - 1998 (is) a set of assertions made by L Peter Deutsch and others at Sun Microsystems describing false assumptions that programmers new to distributed applications invariably make
  29. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 81/98 @kubem ~ http://jakub.marchwicki.pl Client-Side

    Service Discovery / Load balancing Service registers itself in a central repository. The repository also provides an information about other services availability. Other services request the information and autonomously decide which instances are called. Server-Side Service Discovery / Load balancing Service registers itself in a central repository. Other services access the repository (single address), which internally forwards the request to an available instance.
  30. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 83/98 @kubem ~ http://jakub.marchwicki.pl brewer’s

    theorem (cap theorem) brewer’s theorem (cap theorem) — 1998 (… ) it is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: Consistency, Availability and Partition tolerance.
  31. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 84/98 @kubem ~ http://jakub.marchwicki.pl Consistency

    Every read receives the most recent write or an error Availability Every request receives a (non-error) response – without the guarantee that it contains the most recent write Partition tolerance The system continues to operate despite an arbitrary number of messages being dropped (or delayed) by the network between nodes
  32. 3/28/2019 Microservices, microservices everywhere file:///home/jakub/workspaces/slides/microservices-microservice_everything/slides.html?print-pdf#/ 93/98 @kubem ~ http://jakub.marchwicki.pl pacelc

    theorem pacelc theorem — Daniel J. Abadi 2012 Ignoring the consistency/latency tradeoff of replicated systems is a major oversight [in CAP], as it is present at all times during system operation, whereas CAP is only relevant in the arguably rare case of a network partition.