1 of 32

EVENT SOURCING

for Real-time Data Processing

Jakpat Mingmongkolmitr

Real-world Use Case of

2 of 32

OLTP vs OLAP

3 of 32

What is

Event Sourcing?

4 of 32

5 of 32

6 of 32

7 of 32

8 of 32

Commands & Events

9 of 32

Event vs State

10 of 32

Event Logs

11 of 32

Event Store

12 of 32

Real-world Use Case

of Event Sourcing?

13 of 32

Smart Contracts

14 of 32

Smart Contracts

15 of 32

ERC-20 Token Standard

16 of 32

Transfer Event

17 of 32

Commands & Events

18 of 32

Real-time Data

Processing?

19 of 32

Portfolio

20 of 32

Portfolio

21 of 32

Aggregation: Materialized Views

22 of 32

Maintaining Materialized Views

23 of 32

Portfolio - My Wallet

24 of 32

Adding Wallet Projector

25 of 32

Performance?

26 of 32

Total Order

27 of 32

Causality defines a partial order, not total order.

Causality

28 of 32

Partial Order

0x7AE2F5B9e386cd1B50A4550696D957cB4900f03a

0xae5d13b1322bf30235e0dad96bf37a5336bb82bd

29 of 32

Partial Order

Partition by Wallet Address

30 of 32

But Wait, There’s More of

Event Sourcing.

31 of 32

  • Command Query Responsibility Segregation (CQRS)
  • Snapshots
  • Log Compaction

Event Sourcing

  • Consistent Writes
  • Optimistic Concurrency Control (OCC)
  • Fault Tolerance
  • Idempotence

32 of 32

Question & Answer