Slide 1

Slide 1 text

Paris TypeScript June 4th 2019

Slide 2

Slide 2 text

Premier Field Engineer @spontoreau In ❤️ with Co-organizer

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Data Driven Development Domain Driven Design Domain Driven Development != Data structure MCD CRUD Behavior Bounded Context Event

Slide 5

Slide 5 text

Bounded context Independent Autonomous Loosely coupled

Slide 6

Slide 6 text

Query Just a read operation Command Data validation Business logic Persistence CQRS

Slide 7

Slide 7 text

CQRS GetOrderById Query UpdateProduct Command GetProducts Query DeleteOrder Command … … Dispatcher Dispatcher QueryHandler CommandHandler Validation Plugin Monitoring Plugin Telemetry Plugin … Eventual consistency

Slide 8

Slide 8 text

Consistency • All system nodes needs to manipulate exactly the same data at the same time. Availability Partition tolerance • Requests must succeed. • Node failure must not create a complete system failure. A distributed system can only guarantee 2 constrains at the same time, not 3… you have to embrace eventual consistency when building Microservices! Eventual consistency?

Slide 9

Slide 9 text

https://martinfowler.com/eaaDev/EventSourcing.html Event Sourcing

Slide 10

Slide 10 text

CQRS & Event Sourcing GetOrderById Query UpdateProduct Command GetProducts Query DeleteOrder Command … … Dispatcher Dispatcher QueryHandler CommandHandler Projection Projection Aggregate State Events

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Cosmos DB as an Event Store Read Enpoint Write Enpoint Event Store Projector Read DB publish trigger persist query

Slide 13

Slide 13 text

Resources https://docs.microsoft.com/en-us/azure/cosmos-db/introduction https://docs.microsoft.com/en-us/azure/cosmos-db/create-sql-api-nodejs https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed https://medium.com/@thomasweiss_io/planet-scale-event-sourcing-with-azure- cosmos-db-48a557757c8d https://www.youtube.com/watch?v=5YNJpGwj_Zs https://docs.microsoft.com/en-US/azure/architecture/patterns/cqrs https://docs.microsoft.com/en-us/azure/architecture/patterns/event-sourcing https://docs.microsoft.com/en- us/dotnet/standard/microservices-architecture/microservice-ddd-cqrs-patterns/ https://docs.nestjs.com/recipes/cqrs https://gitpitch.com/jrouaix/cqrs-es-presentation/master#/ https://www.youtube.com/watch?v=qBLtZN3p3FU https://www.youtube.com/watch?v=LDW0QWie21s

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content