Arquiteturas de Microservices

Published: 2017-10-13, Updated: 2021-09-01

Links

Definição de Microservice

While there is no precise definition of this architectural style, there are certain common characteristics around organization around business capability, automated deployment, intelligence in the endpoints, and decentralized control of languages and data.

Martin Fowler


Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.

Melvyn Conway, 1967

The microservice approach to division is different, splitting up into services organized around business capability.


Minhas considerações sobre o que é e como organizar um Microservice

Products not Projects

Infrastructure Automation

CI, CD

Design for failure

Ele deve estar pronto para se recuperar de restarts abruptos, falha de outro microserviço, falha de outro serviço (banco, broker).

Quanto mais quebrarmos, mais pontos de falhas temos e mais preocupações teremos nesse sentido.

Evolutionary Design

Queremos um sistema que mantenha uma velocidade de desenvolvimento e entrega proxima da constancia de acordo criamos mais software dentro dele.

Organized around Business Capabilities

  1. Os microserviços geralmente vão/devem ser criados e organizados da forma que a empresa se comunica, quebrando esses microservices por responsabilidades de negócio e evitando que várias áreas tenham sistemas compartilhando essa mesma responsabilidade.

Componentization via Services

  1. Um bom microserviço é desenvolvido de uma forma que ele possa ser evoluido ou substituido por outro de forma idependente, fazendo uma analogia com um sistema de som automotivo, por exemplo.
  1. Um microserviço deve ter serviços desenvolvidos dentro dele e quando um serviço muda, o ideal é que outros microserviços não tenham que mudar por isso.
  2. Quanto menos microserviços melhor, porquê:

Smart endpoints and dumb pipes (Endpoints inteligentes e barramentos burros)

  1. Temos que favorecer a comunicação entre os microservices de uma forma que eles recebam uma requisição, processem o dado usando alguma inteligencia e gerem um retorno fazendo isso sem necessitar de orquestradores, transformadores ou sistemas que ficam entre dois microservices aplicando regras de negócio enquanto encaminham a chamada.

Decentralized Governance

O dono e responsável pelo funcionamento do app é quem o criou, isso significa que cada novo microservice é mais uma responsabilidade.

Decentralized Data Management

Separar um modelo de dados que é centralizado, em vários bancos traz dificuldades no dia a dia do desenvolvimento e sustentação da app, ao mesmo tempo fazer várias apps compartilharem o mesmo banco traz a pergunta se não falhamos ao analisar algum dos outros pontos, estamos realmente criando duas apps com responsabilidades distintas? Com interfaces claras? Componentizadas via serviço?


Sobre como quebrar um microservice

Microservices ecosystem is a platform of services each encapsulating a business capability. A business capability represents what a business does in a particular domain to fulfill its objectives and responsibilities. Each microservice expose an API that developers can discover and use in a self-serve manner. Microservices have independent lifecycle. Developers can build, test and release each microservice independently. The microservices ecosystem enforces an organizational structure of autonomous long standing teams, each responsible for one or multiple services. Contrary to general perception and ‘micro’ in microservices, the size of each service matters least and may vary depending on the operational maturity of the organization. As Martin Fowler puts it, "microservices is a label and not the description".


Principais características

Organized around Business Capabilities

When teams are separated along these lines, even simple changes can lead to a cross-team project taking time and budgetary approval. A smart team will optimise around this and plump for the lesser of two evils - just force the logic into whichever application they have access to. Logic everywhere in other words. This is an example of Conway's Law5 in action.

Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.2 — Melvin E. Conway

Componentization via Services

Our definition is that a component is a unit of software that is independently replaceable and upgradeable.

Smart endpoints and dumb pipes

Applications built from microservices aim to be as decoupled and as cohesive as possible - they own their own domain logic and act more as filters in the classical Unix sense - receiving a request, applying logic as appropriate and producing a response. These are choreographed using simple RESTish protocols rather than complex protocols such as WS-Choreography or BPEL or orchestration by a central tool

Decentralized Governance

Splitting the monolith's components out into services we have a choice when building each of them.

Must have an evolutionary Design

Microservice practitioners, usually have come from an evolutionary design background and see service decomposition as a further tool to enable application developers to control changes in their application without slowing down change

Design for failure

A consequence of using services as components, is that applications need to be designed so that they can tolerate the failure of services.

Infrastructure Automation

Many of the products or systems being build with microservices are being built by teams with extensive experience of Continuous Delivery and it's precursor, Continuous Integration

Decentralized Data Management

It means that the conceptual model of the world will differ between systems. This is a common issue when integrating across a large enterprise, the sales view of a customer will differ from the support view.

keywords

microservice commands, microserviços micoservice, microserviço, arquitetura


Fixing Corrupted FileSystem in Linux JQ Commands

Comments