SlideShare a Scribd company logo
Event-Sourcing
your
React-Redux
applications
Maurice de Beijer - @mauricedb
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
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
(Semi) Structured storage
Database CRUD Server HTTP Browser
React
Event-Sourcing your React-Redux applications
A React component to display data
Command Query Responsibility Segregation
Event-Sourcing your React-Redux applications
Command Query Responsibility Segregation
Database
Query Service
Browser
React
Command Service
Read
Update
The JavaScript command
A Redux Action Creator
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
Event Sourcing
Projections
Database
Query
Service
Browser
React
Command
Service
Read
UpdateEvents
Database
Projector
Service
Event Pushing
Projections
Database
Query
Service
Browser
React
Command
Service
Read
UpdateEvents
Database
Projector
Service
Push
Service
Event-Sourcing your React-Redux applications
The permit drafted event
Event-Sourcing your React-Redux applications
Projecting a permit drafted event
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications
React with Redux
View
Server
Store
ActionAPI
HTTP
Use
Updates
Socket
The permit collection reducer
The single permit reducer
The React application startup
Connecting the state to the component
Maurice de Beijer - @mauricedb

More Related Content

PPTX
Event-Sourcing your React-Redux applications
PPTX
Event-Sourcing your React-Redux applications at HolyJS 2016
PPTX
Event-Sourcing your React-Redux applications
PPTX
React - Redux applications & Event Sourcing
PPTX
Event Sourcing your AngularJS applications
PPTX
Event Sourcing your Angular and React applications
PPTX
Event sourcing your React-Flux applications
PPTX
What is new in ASP.NET Core
Event-Sourcing your React-Redux applications
Event-Sourcing your React-Redux applications at HolyJS 2016
Event-Sourcing your React-Redux applications
React - Redux applications & Event Sourcing
Event Sourcing your AngularJS applications
Event Sourcing your Angular and React applications
Event sourcing your React-Flux applications
What is new in ASP.NET Core

What's hot (19)

PDF
Seaside & ReactJS
PPTX
Maurice de Beijer
PPTX
From zero to hero with Docker
PDF
Introduction to Android M
PDF
Leveraging AWS Cognito Identity Pool
PDF
nginx-arquitectural_view
PPTX
Introduzione a web e servizi con .net e azure
PDF
All Things Cloud Native Meetup: Azure Kubernetes Service Basics
PDF
Whirlwind tour of Activiti 7 by Ryan Dawson
PDF
Global Azure Virtual: Container & Kubernetes on Azure
PPTX
Xamarin devdays 2017 - PT - connected apps
PDF
Arsitektur Aplikasi Modern - Faisal Henry Susanto
PDF
Docker Rosenheim Meetup: Policy & Governance for Kubernetes
PDF
Whisk Deploy - Syncing OpenWhisk Projects
PPTX
Introduction to ReactJs & fundamentals
PPTX
React for .net developers
PDF
20160317 lagom sf scala
PPTX
Azure functions: Build apps faster with serverless architecture (March 2018)
PPTX
Web application I have always dreamt of
Seaside & ReactJS
Maurice de Beijer
From zero to hero with Docker
Introduction to Android M
Leveraging AWS Cognito Identity Pool
nginx-arquitectural_view
Introduzione a web e servizi con .net e azure
All Things Cloud Native Meetup: Azure Kubernetes Service Basics
Whirlwind tour of Activiti 7 by Ryan Dawson
Global Azure Virtual: Container & Kubernetes on Azure
Xamarin devdays 2017 - PT - connected apps
Arsitektur Aplikasi Modern - Faisal Henry Susanto
Docker Rosenheim Meetup: Policy & Governance for Kubernetes
Whisk Deploy - Syncing OpenWhisk Projects
Introduction to ReactJs & fundamentals
React for .net developers
20160317 lagom sf scala
Azure functions: Build apps faster with serverless architecture (March 2018)
Web application I have always dreamt of
Ad

Similar to Event-Sourcing your React-Redux applications (20)

PPTX
Event sourcing your React-Redux applications
PPTX
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
PPTX
Maurice de Beijer
PDF
State Models for React with Redux
PPTX
Event-Sourcing your AngularJS applications
PPTX
Event sourcing your AngularJS applications
PDF
How to Redux
PPTX
U3-02-React Redux and MUI.pptxaSDFGNXDASDFG
PDF
Redux State Management System A Comprehensive Review
PDF
A React Journey
PDF
Corso su ReactJS
PPTX
Better React state management with Redux
PPTX
React gsg presentation with ryan jung & elias malik
PDF
Is React reactive?
PDF
Workshop 22: ReactJS Redux Advanced
PDF
Workshop 22: React-Redux Middleware
PDF
React state management with Redux and MobX
PPTX
PDF
Event Sourcing with Laravel and Spatie event sourcing package
PDF
Let's discover React and Redux with TypeScript
Event sourcing your React-Redux applications
Event-Sourcing your React-Redux applications - Maurice de Beijer - Codemotion...
Maurice de Beijer
State Models for React with Redux
Event-Sourcing your AngularJS applications
Event sourcing your AngularJS applications
How to Redux
U3-02-React Redux and MUI.pptxaSDFGNXDASDFG
Redux State Management System A Comprehensive Review
A React Journey
Corso su ReactJS
Better React state management with Redux
React gsg presentation with ryan jung & elias malik
Is React reactive?
Workshop 22: ReactJS Redux Advanced
Workshop 22: React-Redux Middleware
React state management with Redux and MobX
Event Sourcing with Laravel and Spatie event sourcing package
Let's discover React and Redux with TypeScript
Ad

More from Maurice De Beijer [MVP] (20)

PPTX
Full-stack App in half a Day: Next.js 15 Development Bootcamp
PPTX
Production-ready Next.js App with Cursor AI
PPTX
Building Robust Web Applications with Test-Driven Development and Playwright:...
PDF
Mastering React Server Components and Server Actions in React 19
PPTX
Practice TypeScript Techniques Building React Server Components App
PPTX
A foolproof Way to Estimate a Software Project
PPTX
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
PPTX
Build reliable Svelte applications using Cypress
PPTX
Building Reliable Applications Using React, .NET & Azure
PPTX
Concurrent Rendering Adventures in React 18
PPTX
Building reliable applications with React, C#, and Azure
PPTX
Building large and scalable mission critical applications with React
PPTX
Building Reliable Applications Using React, .NET & Azure
PPTX
Why I am hooked on the future of React
PPTX
Building reliable web applications using Cypress
PPTX
Getting started with React Suspense and concurrent rendering
PPTX
React suspense, not just for Alfred Hitchcock
PPTX
From zero to hero with the Reactive extensions for JavaScript
PPTX
Why I am hooked on the future of React
PPTX
The new React
Full-stack App in half a Day: Next.js 15 Development Bootcamp
Production-ready Next.js App with Cursor AI
Building Robust Web Applications with Test-Driven Development and Playwright:...
Mastering React Server Components and Server Actions in React 19
Practice TypeScript Techniques Building React Server Components App
A foolproof Way to Estimate a Software Project
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Build reliable Svelte applications using Cypress
Building Reliable Applications Using React, .NET & Azure
Concurrent Rendering Adventures in React 18
Building reliable applications with React, C#, and Azure
Building large and scalable mission critical applications with React
Building Reliable Applications Using React, .NET & Azure
Why I am hooked on the future of React
Building reliable web applications using Cypress
Getting started with React Suspense and concurrent rendering
React suspense, not just for Alfred Hitchcock
From zero to hero with the Reactive extensions for JavaScript
Why I am hooked on the future of React
The new React

Recently uploaded (20)

PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
Empathic Computing: Creating Shared Understanding
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
MYSQL Presentation for SQL database connectivity
“AI and Expert System Decision Support & Business Intelligence Systems”
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Monthly Chronicles - July 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Event-Sourcing your React-Redux applications

Editor's Notes

  • #4: Why? I want to create better applications Most applications store the current state http://www.flickr.com/photos/celestinechua/9661913835
  • #6: Deepwater Horizon Offshore Drilling Platform on Fire https://www.flickr.com/photos/ideum/4711481781
  • #7: Most applications store the current state If you are lucky there is an audit trail of sorts http://www.flickr.com/photos/ell-r-brown/4011702143
  • #8: http://www.flickr.com/photos/willowbl00/12459211923
  • #9: http://www.flickr.com/photos/sukiweb/10223596316
  • #10: The server is often just a simple gateway with just some validation logic
  • #11: There is nothing wrong with a CRUD application if the problem domain is simple http://www.flickr.com/photos/juhansonin/5144239690
  • #12: A basic React component to show a list of permits
  • #13: 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
  • #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: Still storing just the current state Database structure is often normalized and optimized for updating Most application read far more frequently then update
  • #16: A command to update/create a draft permit
  • #17: The JavaScript command to send to the server
  • #18: Using Flux Standard Actions
  • #19: We are still storing only the current state No trace of how we got there http://www.flickr.com/photos/danrocha/15602018982
  • #20: Event Sourcing is a very old idea that has become popular again over recent years. Invented by Greg Young 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
  • #21: https://www.flickr.com/photos/eisenbahner/4051462178/
  • #22: Fra Luca Bartolomeo de Pacioli (1447–1517) The Father of Accounting and Bookkeeping https://en.wikipedia.org/wiki/Luca_Pacioli
  • #23: 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/
  • #24: Invented by Greg Young 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
  • #25: Another service subscribes to the same events And pushes them to each connected client
  • #26: Events are never erased or updated An append only model http://www.flickr.com/photos/horiavarlan/4263326117
  • #27: A permit aggregate root
  • #28: A domain event to describe the drafted permit
  • #29: Events are projected out to the read model Observed facts = events Derived facts = projections http://www.flickr.com/photos/fotnmc/7172465908
  • #30: Projecting an event to the read model
  • #31: https://en.wikipedia.org/wiki/File:Mercator_projection_SW.jpg
  • #32: https://en.wikipedia.org/wiki/File:Mollweide_projection_SW.jpg
  • #33: Flux has a very similar and explicit way of working with data.
  • #34: A Redux reducer function for a collection of permits. It calls another reducer for individual permits Very functional: Old State + Action = New State
  • #35: A Redux reducer function for a single permit.
  • #36: 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.
  • #37: The React-Redux connect functions makes data from the store available as props for the child React component.
  • #38: More info: Greg Young: http://goodenoughsoftware.net/ Martin Fowler: http://martinfowler.com/eaaDev/EventSourcing.html Daniel Whittaker: http://danielwhittaker.me/tag/event-sourcing/ João Bragança: https://github.com/thefringeninja/derp.inventory Damian Hickey: http://dhickey.ie/?tag=/Event-Sourcing https://www.flickr.com/photos/stevendepolo/4582437563/