SlideShare a Scribd company logo
1 of 39
React applications &
Event Sourcing
Maurice
de Beijer
Software Engineer
Trainer
ABL – The Problem Solver
Who am I?
Maurice de Beijer
The Problem Solver
Microsoft Azure MVP
Freelance developer/instructor
Twitter: @mauricedb and @React_Tutorial
Web:http://www.TheProblemSolver.nl
E-mail: maurice.de.beijer@gmail.com
(Semi) Structured storage
Database CRUD Server HTTP Browser
A React component to display data
Command Query Responsibility Segregation
Command Query Responsibility
Segregation
Database
Query Service
Browser
Command
Service
Read
Update
A command to draft a permit
The JavaScript command
A Redux Action Creator
Event Sourcing
Projections
Database
Query
Service
Browser
Command
Service
Read
UpdateEvents
Database
Projector
Service
React with Redux
ViewServer
Store
Action
API
Updates
The permit drafted event
Projecting a permit drafted event
The permit collection reducer
The single permit reducer
The React application startup
Connecting state to a component
@mauricedb
Question?
http://theproblemsolver.nl
Maurice.de.beijer@gmail.com
Maurice
De Beijer
Software Engineer
Trainer
ABL – The Problem Solver

More Related Content

What's hot

Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Khaled Musaied
 

What's hot (20)

Event Sourcing your Angular and React applications
Event Sourcing your Angular and React applicationsEvent Sourcing your Angular and React applications
Event Sourcing your Angular and React applications
 
Event Sourcing your AngularJS applications
Event Sourcing your AngularJS applicationsEvent Sourcing your AngularJS applications
Event Sourcing your AngularJS applications
 
Introduction of ASP.NET MVC and AngularJS
Introduction of ASP.NET MVC and AngularJSIntroduction of ASP.NET MVC and AngularJS
Introduction of ASP.NET MVC and AngularJS
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
 
ASP .Net MVC 5
ASP .Net MVC 5ASP .Net MVC 5
ASP .Net MVC 5
 
Windows Azure Cloud Services
Windows Azure Cloud Services Windows Azure Cloud Services
Windows Azure Cloud Services
 
Build 2017 - B8013 - Developing on Windows Server: Innovation for today and t...
Build 2017 - B8013 - Developing on Windows Server: Innovation for today and t...Build 2017 - B8013 - Developing on Windows Server: Innovation for today and t...
Build 2017 - B8013 - Developing on Windows Server: Innovation for today and t...
 
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPSBUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
St. Louis Day of .NET 2013 - Building Your Dev and Test Sandbox with Windows ...
St. Louis Day of .NET 2013 - Building Your Dev and Test Sandbox with Windows ...St. Louis Day of .NET 2013 - Building Your Dev and Test Sandbox with Windows ...
St. Louis Day of .NET 2013 - Building Your Dev and Test Sandbox with Windows ...
 
Public v1 real world example of azure functions serverless conf london 2016
Public v1 real world example of azure functions serverless conf london 2016 Public v1 real world example of azure functions serverless conf london 2016
Public v1 real world example of azure functions serverless conf london 2016
 
Cloud Based Enterprise Apps using Everlive
Cloud Based Enterprise Apps using EverliveCloud Based Enterprise Apps using Everlive
Cloud Based Enterprise Apps using Everlive
 
Progressive Web Apps by Millicent Convento
Progressive Web Apps by Millicent ConventoProgressive Web Apps by Millicent Convento
Progressive Web Apps by Millicent Convento
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
 
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESSWRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS Framework
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
The A1 "AngularJS 1 Kick Start"
The A1 "AngularJS 1 Kick Start"The A1 "AngularJS 1 Kick Start"
The A1 "AngularJS 1 Kick Start"
 
HTML5 Charting in ASP.NET using RadHtmlChart
HTML5 Charting in ASP.NET using RadHtmlChartHTML5 Charting in ASP.NET using RadHtmlChart
HTML5 Charting in ASP.NET using RadHtmlChart
 

Similar to Maurice de Beijer

Refacoring vs Rewriting WixStores
Refacoring vs Rewriting WixStoresRefacoring vs Rewriting WixStores
Refacoring vs Rewriting WixStores
Doron Rosenstock
 
Modularize JavaScript with RequireJS
Modularize JavaScript with RequireJSModularize JavaScript with RequireJS
Modularize JavaScript with RequireJS
Minh Hoang
 

Similar to Maurice de Beijer (20)

Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
 
Event sourcing your React-Redux applications
Event sourcing your React-Redux applicationsEvent sourcing your React-Redux applications
Event sourcing your React-Redux applications
 
Event-Sourcing your AngularJS applications
Event-Sourcing your AngularJS applicationsEvent-Sourcing your AngularJS applications
Event-Sourcing your AngularJS applications
 
Event sourcing your AngularJS applications
Event sourcing your AngularJS applicationsEvent sourcing your AngularJS applications
Event sourcing your AngularJS applications
 
Refacoring vs Rewriting WixStores
Refacoring vs Rewriting WixStoresRefacoring vs Rewriting WixStores
Refacoring vs Rewriting WixStores
 
Putting Kit back in SDK
Putting Kit back in SDKPutting Kit back in SDK
Putting Kit back in SDK
 
CQRS and Event Sourcing
CQRS and Event Sourcing CQRS and Event Sourcing
CQRS and Event Sourcing
 
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
 
Microsoft Azure For Solutions Architects
Microsoft Azure For Solutions ArchitectsMicrosoft Azure For Solutions Architects
Microsoft Azure For Solutions Architects
 
Modularize JavaScript with RequireJS
Modularize JavaScript with RequireJSModularize JavaScript with RequireJS
Modularize JavaScript with RequireJS
 
Beyond The MVC
Beyond The MVCBeyond The MVC
Beyond The MVC
 
Go Serverless with Cosmos DB, Azure Functions and Blazor
Go Serverless with Cosmos DB, Azure Functions and BlazorGo Serverless with Cosmos DB, Azure Functions and Blazor
Go Serverless with Cosmos DB, Azure Functions and Blazor
 
Startups without Servers
Startups without ServersStartups without Servers
Startups without Servers
 
Meteor Introduction - Ashish
Meteor Introduction - AshishMeteor Introduction - Ashish
Meteor Introduction - Ashish
 
Introduction To Microsoft Windows Containers
Introduction To Microsoft Windows ContainersIntroduction To Microsoft Windows Containers
Introduction To Microsoft Windows Containers
 
Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azure
 
ASPNET for PHP Developers
ASPNET for PHP DevelopersASPNET for PHP Developers
ASPNET for PHP Developers
 
Azure App Service
Azure App ServiceAzure App Service
Azure App Service
 
Vsts Msdn Presentation2003
Vsts Msdn Presentation2003Vsts Msdn Presentation2003
Vsts Msdn Presentation2003
 
Code first in the cloud: going serverless with Azure
Code first in the cloud: going serverless with AzureCode first in the cloud: going serverless with Azure
Code first in the cloud: going serverless with Azure
 

More from CodeFest

More from CodeFest (20)

Alexander Graebe
Alexander GraebeAlexander Graebe
Alexander Graebe
 
Никита Прокопов
Никита ПрокоповНикита Прокопов
Никита Прокопов
 
Денис Баталов
Денис БаталовДенис Баталов
Денис Баталов
 
Елена Гальцина
Елена ГальцинаЕлена Гальцина
Елена Гальцина
 
Александр Калашников
Александр КалашниковАлександр Калашников
Александр Калашников
 
Ирина Иванова
Ирина ИвановаИрина Иванова
Ирина Иванова
 
Marko Berković
Marko BerkovićMarko Berković
Marko Berković
 
Денис Кортунов
Денис КортуновДенис Кортунов
Денис Кортунов
 
Александр Зимин
Александр ЗиминАлександр Зимин
Александр Зимин
 
Сергей Крапивенский
Сергей КрапивенскийСергей Крапивенский
Сергей Крапивенский
 
Сергей Игнатов
Сергей ИгнатовСергей Игнатов
Сергей Игнатов
 
Николай Крапивный
Николай КрапивныйНиколай Крапивный
Николай Крапивный
 
Alexander Graebe
Alexander GraebeAlexander Graebe
Alexander Graebe
 
Вадим Смирнов
Вадим СмирновВадим Смирнов
Вадим Смирнов
 
Константин Осипов
Константин ОсиповКонстантин Осипов
Константин Осипов
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
Максим Пугачев
Максим ПугачевМаксим Пугачев
Максим Пугачев
 
Rene Groeschke
Rene GroeschkeRene Groeschke
Rene Groeschke
 
Иван Бондаренко
Иван БондаренкоИван Бондаренко
Иван Бондаренко
 
Mete Atamel
Mete AtamelMete Atamel
Mete Atamel
 

Recently uploaded

Recently uploaded (20)

WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid EnvironmentsWSO2Con2024 - Software Delivery in Hybrid Environments
WSO2Con2024 - Software Delivery in Hybrid Environments
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in UgandaWSO2CON 2024 - Building a Digital Government in Uganda
WSO2CON 2024 - Building a Digital Government in Uganda
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and ApplicationsWSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
WSO2CON 2024 - Architecting AI in the Enterprise: APIs and Applications
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
 
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next IntegrationWSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
WSO2CON2024 - Why Should You Consider Ballerina for Your Next Integration
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital BusinessesWSO2CON 2024 - Software Engineering for Digital Businesses
WSO2CON 2024 - Software Engineering for Digital Businesses
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
WSO2Con2024 - Simplified Integration: Unveiling the Latest Features in WSO2 L...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 

Maurice de Beijer

Editor's Notes

  1. https://www.flickr.com/photos/25143217@N05/3468038614/
  2. https://www.flickr.com/photos/faceme/7466333558/
  3. https://www.flickr.com/photos/sierag
  4. Why? I want to create better applications Most applications store the current state http://www.flickr.com/photos/celestinechua/9661913835
  5. Deepwater Horizon Offshore Drilling Platform on Fire https://www.flickr.com/photos/ideum/4711481781
  6. https://www.flickr.com/photos/organikal/5597513455/
  7. http://www.flickr.com/photos/willowbl00/12459211923
  8. http://www.flickr.com/photos/sukiweb/10223596316
  9. The server is often just a simple gateway with just some validation logic
  10. There is nothing wrong with a CRUD application if the problem domain is simple http://www.flickr.com/photos/juhansonin/5144239690
  11. A basic React component to show a list of permits
  12. CQRS = Command Query Responsibility Segregation Use a different model to update information than the model you use to read information http://www.flickr.com/photos/usnavy/8220344431
  13. Still storing just the current state Database structure is often normalized and optimized for updating Most application read far more frequently then update
  14. Commands should be modeled after business actions A business user can understand command names and have a reasonable expectation of the outcome http://www.flickr.com/photos/micahdowty/4630801442
  15. A command to update/create a draft permit
  16. The JavaScript command to send to the server
  17. Using Flux Standard Actions
  18. We are still storing only the current state No trace of how we got there http://www.flickr.com/photos/danrocha/15602018982
  19. Event Sourcing is a very old idea that has become popular again over recent years. Events provide insight into how the system came to be in its current state The current state is a left fold of the events http://www.flickr.com/photos/dragontomato/5174914835
  20. https://www.flickr.com/photos/eisenbahner/4051462178/
  21. Fra Luca Bartolomeo de Pacioli (1447–1517) The Father of Accounting and Bookkeeping https://en.wikipedia.org/wiki/Luca_Pacioli
  22. Domain Event is something that has happened in the past The result of a Command to change something Very similar to the audit trail in a database http://www.flickr.com/photos/lendingmemo/11747440176/
  23. No longer storing the current state but all event leading up to it The current state is a left fold of all events The projection parts are not really part of ES but CQRS and usually combined
  24. Flux has a very similar and explicit way of working with data.
  25. Events are never erased or updated An append only model Updates may happen during application updates http://www.flickr.com/photos/horiavarlan/4263326117
  26. A permit aggregate root
  27. A domain event to describe the drafted permit
  28. Events are projected out to the read model Observed facts = events Derived facts = projections http://www.flickr.com/photos/fotnmc/7172465908
  29. https://en.wikipedia.org/wiki/File:Mercator_projection_SW.jpg
  30. https://en.wikipedia.org/wiki/File:Mollweide_projection_SW.jpg
  31. Projecting an event to the read model
  32. A Redux reducer function for a collection of permits. It calls another reducer for individual permits Very functional: Old State + Action = New State
  33. A Redux reducer function for a single permit.
  34. The Redux createStore() function creates the store based on the reduce functions. The React-Redux Provider connects the store state to the root App component.
  35. The React-Redux connect functions makes data from the store available as props for the child React component.
  36. https://www.flickr.com/photos/ell-r-brown/7160371456