SlideShare a Scribd company logo
5
Most read
12
Most read
15
Most read
Jeffrey T. Fritz 
@csharpfritz 
http://csharpfritz.com
Jeffrey T. Fritz 
ASP.Net Developer Evangelist for Telerik 
AJAX controls 
Microsoft MVP, ASPInsider 
Tech Ed 2012 Speaker Idol Finalist, 2013 
Runner-up 
15 years of web development experience 
CodeProject.tv + Pluralsight author 
(coming soon!) 
May 2013 MSDN Magazine: One ASP.Net 
DotNetRocks #855 
Yet Another Podcast #98, #106
Level setting: n-tier architecture 
Event Sourcing – definition, benefits, 
challenges 
How do I get started? 
How do I audit? 
Rebuilding and Reporting Samples
Presentation Layer 
Business Logic Layer 
Data Access Layer 
Database
Event Sourcing: An architectural pattern 
which warrants that your entities do not track 
their internal state by means of direct 
serialization or O/R mapping, but by means 
of reading and committing events to an event 
store 
Event: an immutable object that describes a 
change that has occurred to an entity.
Entities are not stored as a given state in time 
Changes to the entities are persisted 
Stored in the order changes were applied to 
the object 
No concern for ‘prior state’ of the entity
Image courtesy of Greg Young
Introduction to Event Sourcing
Introduction to Event Sourcing
Introduction to Event Sourcing
Simplified data access 
◦ Append-only data store 
◦ Easy to partition 
◦ Easy to replicate 
Event structure allows for greater use of 
‘ubiquitous language’ 
Reporting requirements are required to be 
stored separately
Performance 
◦ Documented performance on an i7 laptop with SSD 
storage: 
15,000 writes / second 
50,000 reads / second 
◦ Aggressively cache query results 
Data never changes
Testing 
◦ Given (Collection of Events) 
◦ When (Action) 
◦ Then (Events expected) 
No duplicate storage of data 
◦ Current State 
◦ Audit log
Tivo for your entities 
◦ Trivial to ‘replay’ the events to a given point in time 
Offline processing 
Conflict Management
Not storing data in relational structure 
◦ Can use RDBMS as a store 
Reporting is NOT immediately available 
Difficult to migrate a legacy app to 
Harder to sell to an organization
ObjectID Change 
Date 
Change 
User 
Field Old Value New Value 
1 9/20/12 Jeff Attend 0 1 
ObjectID Version DateStamp Event 
1 5 9/20/12 RsvpChanged { 
Name: Jeff, 
Attending: true 
}
Jonathan Oliver EventStore 
◦ .Net based tool 
◦ Supports storage in: MySQL, MSSql, SQLite, Access, 
Sql Azure, Amazon RDS, Oracle, Sybase, Postgres, 
DB2, RavenDb, MongoDb, CouchDb, and LOTS more 
◦ http://github.com/joliver/EventStore 
Greg Young Event Store 
◦ JSON based event store 
◦ Proprietary storage engine 
◦ RESTful access 
◦ http://geteventstore.com
Demo: 
Jonathan Oliver Event Store 
Get and Save
AuditLog is just a dump of events 
Call ToString on each event 
Demo – NerdDinner AuditLog
Data can be “re-projected” into any format 
New data can be discovered by the projection 
that wouldn’t normally be visible in 3rd 
normal form 
Alternate storage of data in format for the 
report desired
Offline re-build of reporting data 
NerdDinner.Rebuild
Use AAA syntax 
◦ Arrange (collection of events) 
◦ Act (action) 
◦ Assert (verify output of events)
http://bit.ly/FritzES -- Event Sourcing Links 
http://csharpfritz.com 
@csharpfritz on Twitter 
Thanks for attending!

More Related Content

PDF
Event Sourcing: Introduction & Challenges
PDF
A visual introduction to Event Sourcing and CQRS
PPTX
CQRS and Event Sourcing
KEY
Event Driven Architecture
PDF
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
PPTX
Axon Framework, Exploring CQRS and Event Sourcing Architecture
PDF
Saturn 2018: Managing data consistency in a microservice architecture using S...
PDF
Introducing Saga Pattern in Microservices with Spring Statemachine
Event Sourcing: Introduction & Challenges
A visual introduction to Event Sourcing and CQRS
CQRS and Event Sourcing
Event Driven Architecture
Building and deploying microservices with event sourcing, CQRS and Docker (Be...
Axon Framework, Exploring CQRS and Event Sourcing Architecture
Saturn 2018: Managing data consistency in a microservice architecture using S...
Introducing Saga Pattern in Microservices with Spring Statemachine

What's hot (20)

PDF
Microservice Architecture with CQRS and Event Sourcing
PPTX
Microservices Part 3 Service Mesh and Kafka
PDF
Building Event Driven (Micro)services with Apache Kafka
PPTX
Micro services Architecture
PDF
MicroCPH - Managing data consistency in a microservice architecture using Sagas
PPTX
CQRS recipes or how to cook your architecture
PDF
Work shop eventstorming
PDF
Microservices and SOA
PDF
Introduction to docker
PDF
Building Microservices with Event Sourcing and CQRS
PPTX
Introduction to Microservices Patterns
PDF
Introduction to Spring WebFlux #jsug #sf_a1
PDF
Logging and observability
PPTX
Spring Webflux
PPTX
Domain Driven Design
PPSX
Microservices, Containers, Kubernetes, Kafka, Kanban
PDF
Microservices architecture
PPTX
Introduction to microservices
PPSX
Agile, User Stories, Domain Driven Design
PPTX
Saga about distributed business transactions in microservices world
Microservice Architecture with CQRS and Event Sourcing
Microservices Part 3 Service Mesh and Kafka
Building Event Driven (Micro)services with Apache Kafka
Micro services Architecture
MicroCPH - Managing data consistency in a microservice architecture using Sagas
CQRS recipes or how to cook your architecture
Work shop eventstorming
Microservices and SOA
Introduction to docker
Building Microservices with Event Sourcing and CQRS
Introduction to Microservices Patterns
Introduction to Spring WebFlux #jsug #sf_a1
Logging and observability
Spring Webflux
Domain Driven Design
Microservices, Containers, Kubernetes, Kafka, Kanban
Microservices architecture
Introduction to microservices
Agile, User Stories, Domain Driven Design
Saga about distributed business transactions in microservices world
Ad

Viewers also liked (19)

PPTX
Visual Studio 2015 for Web Developers - Codestock 2015 slides
PPTX
Visual Studio 2015 - Whats New ?
PPT
Vs2010and Ne Tframework
PPTX
Visual studio 2015 ide new features
PPTX
Introduction to c#
PPTX
Visual Studio 2015: Increase your Productivity
PDF
Visual Basic.Net & Ado.Net
PPT
Visual studio 2015 and .net core 5 – get ready to rumble
PPTX
Big Data Analytics for Non Programmers
ODP
How to Use Slideshare
PPTX
Introduction to NoSQL Databases
PPTX
What is big data?
PPTX
Big data ppt
PDF
DAMA Webinar - Big and Little Data Quality
PPT
Big Data
PDF
A Beginners Guide to noSQL
PDF
Working With Big Data
PPTX
What is Big Data?
PDF
Visual Design with Data
Visual Studio 2015 for Web Developers - Codestock 2015 slides
Visual Studio 2015 - Whats New ?
Vs2010and Ne Tframework
Visual studio 2015 ide new features
Introduction to c#
Visual Studio 2015: Increase your Productivity
Visual Basic.Net & Ado.Net
Visual studio 2015 and .net core 5 – get ready to rumble
Big Data Analytics for Non Programmers
How to Use Slideshare
Introduction to NoSQL Databases
What is big data?
Big data ppt
DAMA Webinar - Big and Little Data Quality
Big Data
A Beginners Guide to noSQL
Working With Big Data
What is Big Data?
Visual Design with Data
Ad

Similar to Introduction to Event Sourcing (20)

PDF
Building and deploying microservices with event sourcing, CQRS and Docker (Ha...
PDF
Building Microservices with Scala, functional domain models and Spring Boot -...
PDF
#JaxLondon: Building microservices with Scala, functional domain models and S...
PDF
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
PDF
Building and Deploying Microservices with Event Sourcing, CQRS and Docker
PDF
Building microservices with Scala, functional domain models and Spring Boot (...
PDF
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
PDF
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
PDF
About The Event-Driven Data Layer & Adobe Analytics
PDF
Event Sourcing, Stream Processing and Serverless (Benjamin Stopford, Confluen...
PDF
Developing functional domain models with event sourcing (sbtb, sbtb2015)
PDF
Event Sourcing, Stream Processing and Serverless (Ben Stopford, Confluent) K...
PPT
What's New for Data?
PDF
Developing event-driven microservices with event sourcing and CQRS (phillyete)
PDF
Ymens - Bouncing off clouds - Rapid Development for Cloud Ready Applications...
PPTX
Cloud and azure and rock and roll
PDF
SplunkApplicationLoggingBestPractices_Template_2.3.pdf
PDF
FIWARE Wednesday Webinars - Architecting Your Smart Solution Powered by FIWARE
PDF
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
PDF
Sukumar Nayak-Agile-DevOps-Cloud Management
Building and deploying microservices with event sourcing, CQRS and Docker (Ha...
Building Microservices with Scala, functional domain models and Spring Boot -...
#JaxLondon: Building microservices with Scala, functional domain models and S...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and Deploying Microservices with Event Sourcing, CQRS and Docker
Building microservices with Scala, functional domain models and Spring Boot (...
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
Developing Event-driven Microservices with Event Sourcing & CQRS (gotoams)
About The Event-Driven Data Layer & Adobe Analytics
Event Sourcing, Stream Processing and Serverless (Benjamin Stopford, Confluen...
Developing functional domain models with event sourcing (sbtb, sbtb2015)
Event Sourcing, Stream Processing and Serverless (Ben Stopford, Confluent) K...
What's New for Data?
Developing event-driven microservices with event sourcing and CQRS (phillyete)
Ymens - Bouncing off clouds - Rapid Development for Cloud Ready Applications...
Cloud and azure and rock and roll
SplunkApplicationLoggingBestPractices_Template_2.3.pdf
FIWARE Wednesday Webinars - Architecting Your Smart Solution Powered by FIWARE
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Sukumar Nayak-Agile-DevOps-Cloud Management

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
DOCX
The AUB Centre for AI in Media Proposal.docx
Understanding_Digital_Forensics_Presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Encapsulation_ Review paper, used for researhc scholars
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Programs and apps: productivity, graphics, security and other tools
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The AUB Centre for AI in Media Proposal.docx

Introduction to Event Sourcing

  • 1. Jeffrey T. Fritz @csharpfritz http://csharpfritz.com
  • 2. Jeffrey T. Fritz ASP.Net Developer Evangelist for Telerik AJAX controls Microsoft MVP, ASPInsider Tech Ed 2012 Speaker Idol Finalist, 2013 Runner-up 15 years of web development experience CodeProject.tv + Pluralsight author (coming soon!) May 2013 MSDN Magazine: One ASP.Net DotNetRocks #855 Yet Another Podcast #98, #106
  • 3. Level setting: n-tier architecture Event Sourcing – definition, benefits, challenges How do I get started? How do I audit? Rebuilding and Reporting Samples
  • 4. Presentation Layer Business Logic Layer Data Access Layer Database
  • 5. Event Sourcing: An architectural pattern which warrants that your entities do not track their internal state by means of direct serialization or O/R mapping, but by means of reading and committing events to an event store Event: an immutable object that describes a change that has occurred to an entity.
  • 6. Entities are not stored as a given state in time Changes to the entities are persisted Stored in the order changes were applied to the object No concern for ‘prior state’ of the entity
  • 7. Image courtesy of Greg Young
  • 11. Simplified data access ◦ Append-only data store ◦ Easy to partition ◦ Easy to replicate Event structure allows for greater use of ‘ubiquitous language’ Reporting requirements are required to be stored separately
  • 12. Performance ◦ Documented performance on an i7 laptop with SSD storage: 15,000 writes / second 50,000 reads / second ◦ Aggressively cache query results Data never changes
  • 13. Testing ◦ Given (Collection of Events) ◦ When (Action) ◦ Then (Events expected) No duplicate storage of data ◦ Current State ◦ Audit log
  • 14. Tivo for your entities ◦ Trivial to ‘replay’ the events to a given point in time Offline processing Conflict Management
  • 15. Not storing data in relational structure ◦ Can use RDBMS as a store Reporting is NOT immediately available Difficult to migrate a legacy app to Harder to sell to an organization
  • 16. ObjectID Change Date Change User Field Old Value New Value 1 9/20/12 Jeff Attend 0 1 ObjectID Version DateStamp Event 1 5 9/20/12 RsvpChanged { Name: Jeff, Attending: true }
  • 17. Jonathan Oliver EventStore ◦ .Net based tool ◦ Supports storage in: MySQL, MSSql, SQLite, Access, Sql Azure, Amazon RDS, Oracle, Sybase, Postgres, DB2, RavenDb, MongoDb, CouchDb, and LOTS more ◦ http://github.com/joliver/EventStore Greg Young Event Store ◦ JSON based event store ◦ Proprietary storage engine ◦ RESTful access ◦ http://geteventstore.com
  • 18. Demo: Jonathan Oliver Event Store Get and Save
  • 19. AuditLog is just a dump of events Call ToString on each event Demo – NerdDinner AuditLog
  • 20. Data can be “re-projected” into any format New data can be discovered by the projection that wouldn’t normally be visible in 3rd normal form Alternate storage of data in format for the report desired
  • 21. Offline re-build of reporting data NerdDinner.Rebuild
  • 22. Use AAA syntax ◦ Arrange (collection of events) ◦ Act (action) ◦ Assert (verify output of events)
  • 23. http://bit.ly/FritzES -- Event Sourcing Links http://csharpfritz.com @csharpfritz on Twitter Thanks for attending!