Globalcode – Open4education
Microservices e Event Sourcing
em Larga Escala
Vinicius Vieira Gomes
vvgomes.com
ThoughtWorks
Globalcode – Open4education
Agenda
Contexto
CRUD & REST
Event Sourcing
CQRS
Event Driven Architecture
Conclusões
Mais Informações
Globalcode – Open4education
Contexto
Globalcode – Open4education
Contexto
Uma plataforma de serviços bancários
Globalcode – Open4education
Contexto
8 times
70 pessoas
2 países
Dezenas de pontos de integração
Globalcode – Open4education
Contexto
Requisitos
Globalcode – Open4education
Contexto
Requisitos
Auditoria
Globalcode – Open4education
Contexto
Requisitos
Auditoria
AML / Fraud
Globalcode – Open4education
Contexto
Requisitos
Auditoria
AML / Fraud
BI / Analytics
Globalcode – Open4education
Contexto
Requisitos
Auditoria
AML / Fraud
BI / Analytics
Performance para leitura
Globalcode – Open4education
Contexto
Requisitos
Auditoria
AML / Fraud
BI / Analytics
Performance para leitura
Consistência para escrita
Globalcode – Open4education
Contexto
Requisitos
Auditoria
AML / Fraud
BI / Analytics
Performance para leitura
Consistência para escrita
Arquitetura Open/Closed
Globalcode – Open4education
CRUD & REST
Globalcode – Open4education
CRUD & Rest
Globalcode – Open4education
CRUD & Rest
Globalcode – Open4education
CRUD & REST
Em resumo:
Estado atual é tudo que temos
Difícil representar “User Intent” com fidelidade
Serviços precisam se conhecer
Leitura e escrita no mesmo modelo
Globalcode – Open4education
Event Sourcing
Globalcode – Open4education
Event Sourcing
Pense em um eCommerce CRUD
Globalcode – Open4education
Event Sourcing
Momento 1
Usuário começa a navegar nos produtos
Globalcode – Open4education
Event Sourcing
Momento 2
Usuário adiciona um produto no carrinho
Globalcode – Open4education
Event Sourcing
Momento 3
Usuário adiciona mais um produto no carrinho
Globalcode – Open4education
Event Sourcing
Momento 4
Usuário remove um produto do carrinho
Globalcode – Open4education
Event Sourcing
Momento 5
Usuário finaliza a compra
Globalcode – Open4education
Event Sourcing
O mesmo eCommerce com Event Sourcing
Globalcode – Open4education
Event Sourcing
Momento 1
Usuário começa a navegar nos produtos
Globalcode – Open4education
Event Sourcing
Momento 2
Usuário adiciona um produto no carrinho
Globalcode – Open4education
Event Sourcing
Momento 3
Usuário adiciona mais um produto no carrinho
Globalcode – Open4education
Event Sourcing
Momento 4
Usuário remove um produto do carrinho
Globalcode – Open4education
Event Sourcing
Momento 5
Usuário finaliza a compra
Globalcode – Open4education
Event Sourcing
Globalcode – Open4education
Event Sourcing
Domain Events
Persistem acontecimentos no sistema
Payload e metadados
Imutáveis e imortais
Globalcode – Open4education
Event Sourcing
Domain Events
Globalcode – Open4education
Event Sourcing
Commands
Globalcode – Open4education
Event Sourcing
Aggregates
Globalcode – Open4education
Command Query Responsibility
Segregation
Globalcode – Open4education
CQRS
Event Store é
Eficiente para escrita
Não tão eficiente para leitura
Globalcode – Open4education
CQRS
Command Query Responsibility Segregation
Globalcode – Open4education
Event Driven Architecture
Globalcode – Open4education
Event Driven Architecture
Tecnologias
Java 8
Axon
Spring Boot
ActiveMQ
Oracle
MongoDB
Hadoop / Hive
Globalcode – Open4education
Event Driven Architecture
Globalcode – Open4education
Event Driven Architecture
Serviços desacoplados
Bounded Contexts
Consistência global
Globalcode – Open4education
Event Driven Architecture
Demo
Globalcode – Open4education
Event Driven Architecture
Desafios
CQRS + REST
vvgomes.com/cqrs-and-rest
Upcasters
Snapshots
Event Replay
Sagas
Globalcode – Open4education
Conclusões
Globalcode – Open4education
Conclusões
Requisitos
Auditoria
AML / Fraud
BI / Analytics
Performance para leitura
Consistência para escrita
Arquitetura Open/Closed
Globalcode – Open4education
Mais Informações
Blog do Martin Fowler
Greg Young
Chris Richardson
Axon Framework
Datomic
Globalcode – Open4education
Microservices e Event Sourcing
em Larga Escala
Vinicius Vieira Gomes
vvgomes.com
ThoughtWorks

TDC2016SP - Trilha Microservices