Modern Software Architecture-Domain Models, CQRS, and Event Sourcing - Notes
FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a...
Transcript of FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a...
![Page 1: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/1.jpg)
FORGET ME PLEASE?EVENT SOURCING & THE GDPR
Michiel Rook - @michieltcs
![Page 2: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/2.jpg)
DISCLAIMER: I AM NOT A LAWYER
![Page 3: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/3.jpg)
GDPR
![Page 4: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/4.jpg)
GENERAL DATA PROTECTION REGULATION
![Page 5: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/5.jpg)
' Regulation (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC (Data Protection Directive)
-General Data Protection Regulation
![Page 6: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/6.jpg)
A SHORT HISTORY
![Page 7: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/7.jpg)
1995
Data Protection Directive
![Page 8: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/8.jpg)
1995
Data Protection Directive
2012
GDPR proposal
![Page 9: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/9.jpg)
1995
Data Protection Directive
2012
GDPR proposal
2016
GDPR adopted
![Page 10: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/10.jpg)
1995
Data Protection Directive
2012
GDPR proposal
2016
GDPR adopted
25 May 2018
GDPR enforceable
![Page 11: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/11.jpg)
REGULATION
![Page 12: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/12.jpg)
PROTECTS EU CITIZENS
![Page 13: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/13.jpg)
DATA PROTECTION ACT
![Page 14: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/14.jpg)
BROAD & VAGUE
![Page 15: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/15.jpg)
PRIVACY BY DESIGN
![Page 16: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/16.jpg)
' The controller shall implement appropriate technical and organisational measures for ensuring that, by default, only personal data which are necessary for each specific purpose of the processing are processed. -GDPR, Article 25
![Page 17: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/17.jpg)
DATA PROTECTION OFFICER
![Page 18: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/18.jpg)
SUPERVISORY AUTHORITY
![Page 19: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/19.jpg)
FINES
![Page 20: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/20.jpg)
€20 MILLION OR 4% OF ANNUAL TURNOVER
![Page 21: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/21.jpg)
YOU
![Page 22: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/22.jpg)
RAISE YOUR HAND
IF YOU HAVE
![Page 23: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/23.jpg)
read CQRS / Event Sourcing theory
RAISE YOUR HAND
IF YOU HAVE
![Page 24: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/24.jpg)
read CQRS / Event Sourcing theory
followed a tutorial, built a hobby project
RAISE YOUR HAND
IF YOU HAVE
![Page 25: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/25.jpg)
read CQRS / Event Sourcing theory
followed a tutorial, built a hobby project
used it in production
RAISE YOUR HAND
IF YOU HAVE
![Page 26: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/26.jpg)
Axon Framework Spring Boot
![Page 27: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/27.jpg)
QUICK RECAP CQRS + EVENT SOURCING
![Page 28: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/28.jpg)
CQRS
![Page 29: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/29.jpg)
COMMAND QUERY RESPONSIBILITY
SEGREGATION
![Page 30: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/30.jpg)
STORAGE SIDEVS.
QUERY SIDE
![Page 31: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/31.jpg)
UI
@michieltcs
![Page 32: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/32.jpg)
Domain
UI
Command
commands
Aggregates
@michieltcs
![Page 33: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/33.jpg)
Domain
UI
Command
Repository
Event Store
commands
events
Aggregates
@michieltcs
![Page 34: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/34.jpg)
Domain
UI
Event Bus
Event Handlers
Command
Repository
Database Database
Event Store
commands
events
events
Aggregates
@michieltcs
![Page 35: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/35.jpg)
Domain
UI
Event Bus
Event Handlers
Command
Repository
Data Layer
Database Database
Event Store
commands
events
events
queries DTOs
Aggregates
@michieltcs
![Page 36: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/36.jpg)
EVENT SOURCING
![Page 37: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/37.jpg)
' Event Sourcing ensures that all changes to application state are stored as a sequence of events.
-Martin Fowler
![Page 38: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/38.jpg)
ACTIVE RECORD VS. EVENT SOURCING
Account Id Account number Balance1234 12345678 �50,00
... ... ...
Money WithdrawnAccount Id 1234
Amount �50,00
Money DepositedAccount Id 1234
Amount �100,00
Account OpenedAccount Id 1234
Account number 12345678
@michieltcs
![Page 39: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/39.jpg)
COMMANDS TO EVENTS
Deposit MoneyAccount Id 1234
Amount �100,00
@michieltcs
1 @Value 2 public class DepositMoney { 3 @TargetAggregateIdentifier 4 String accountId; 5 BigDecimal amount; 6 }
![Page 40: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/40.jpg)
COMMANDS TO EVENTS
Deposit MoneyAccount Id 1234
Amount �100,00command handler
@michieltcs
1 @CommandHandler 2 public void depositMoney(DepositMoney command) { 3 apply(new MoneyDeposited( 4 command.getAccountId(), 5 command.getAmount(), 6 ZonedDateTime.now())); 7 }
![Page 41: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/41.jpg)
COMMANDS TO EVENTS
Deposit MoneyAccount Id 1234
Amount �100,00
Money DepositedAccount Id 1234
Amount �100,00command handler
@michieltcs
1 @Value 2 public class MoneyDeposited { 3 String accountId; 4 BigDecimal amount; 5 ZonedDateTime timestamp; 6 }
![Page 42: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/42.jpg)
AGGREGATES
@michieltcs
an Aggregate handles Commands and generates Events based on the current state
![Page 43: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/43.jpg)
AGGREGATES
@michieltcs
1 class BankAccount { 2 @AggregateIdentifier 3 private String accountId; 4 private String accountNumber; 5 private BigDecimal balance; 6 7 // ... 8 @EventHandler 9 public void accountOpened(AccountOpened event) { 10 this.accountId = event.getAccountId(); 11 this.accountNumber = event.getAccountNumber(); 12 this.balance = BigDecimal.valueOf(0); 13 } 14 15 @EventHandler 16 public void moneyDeposited(MoneyDeposited event) { 17 this.balance = this.balance.add(event.getAmount()); 18 } 19 }
![Page 44: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/44.jpg)
AGGREGATE STATE
Account number Balance12345678 �0,00
Account number Balance12345678 �100,00
Account number Balance12345678 �50,00
event handler
event handler
event handler
@michieltcs
Money WithdrawnAccount Id 1234
Amount �50,00
Money DepositedAccount Id 1234
Amount �100,00
Account OpenedAccount Id 1234
Account number 12345678
![Page 45: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/45.jpg)
VALIDATING COMMANDS
@michieltcs
1 @CommandHandler 2 public void withdrawMoney(WithdrawMoney command) throws 3 OverdraftDetectedException { 4 if (balance.compareTo(command.getAmount()) >= 0) { 5 apply(new MoneyWithdrawn( 6 command.getAccountId(), 7 command.getAmount(), 8 ZonedDateTime.now())); 9 } else { 10 throw new OverdraftDetectedException(accountNumber, balance, command. 11 getAmount()); 12 } 13 }
![Page 46: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/46.jpg)
TESTING AGGREGATES
@michieltcs
1 public class BankAccountTest { 2 private FixtureConfiguration<BankAccount> fixture; 3 4 @Before 5 public void createFixture() { 6 fixture = new AggregateTestFixture<>(BankAccount.class); 7 } 8 9 @Test 10 public void noOverdraftsOnEmptyAccount() { 11 fixture.given(new AccountOpened(ACCOUNT_ID, ACCOUNT_NUMBER)) 12 .when(new WithdrawMoney(ACCOUNT_ID, new BigDecimal(20))) 13 .expectException(OverdraftDetectedException.class); 14 } 15 16 private final static String ACCOUNT_ID = "accountId"; 17 private final static String ACCOUNT_NUMBER = "accountNumber"; 18 }
![Page 47: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/47.jpg)
EVENT SOURCING& GDPR
![Page 48: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/48.jpg)
CONSENT
![Page 49: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/49.jpg)
' Where processing is based on consent, the controller shall be able to demonstrate that the data subject has consented to processing of his or her personal data.
-GDPR, Article 7
![Page 50: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/50.jpg)
REGISTERING CONSENT
![Page 51: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/51.jpg)
' ...the request for consent shall be presented in a manner which is clearly distinguishable from the other matters...
-GDPR, Article 7
![Page 52: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/52.jpg)
REVOKING CONSENT
![Page 53: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/53.jpg)
' The data subject shall have the right to withdraw his or her consent at any time. ... It shall be as easy to withdraw as to give consent.
-GDPR, Article 7
![Page 54: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/54.jpg)
WHY USE EVENT SOURCING / CQRS?
![Page 55: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/55.jpg)
CAPTURE INTENT
![Page 56: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/56.jpg)
DEMONSTRATING CONSENT
![Page 57: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/57.jpg)
EVENT LOGAS AUDIT LOG
![Page 58: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/58.jpg)
NEW READ MODELS
![Page 59: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/59.jpg)
EASIER DEBUGGING
![Page 60: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/60.jpg)
EVENT LOG AS AUDIT LOG
@michieltcs
ConsentedToNewsletters
![Page 61: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/61.jpg)
EVENT LOG AS AUDIT LOG
@michieltcs
ConsentedToNewsletters
ConsentedToDataGathering
![Page 62: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/62.jpg)
EVENT LOG AS AUDIT LOG
@michieltcs
ConsentedToNewsletters
ConsentedToDataGathering
RevokedConsentToNewsletters
![Page 63: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/63.jpg)
"RIGHT TO ACCESS"
![Page 64: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/64.jpg)
' The data subject shall have the right to obtain from the controller confirmation as to whether or not personal data ... are being processed, and ... access to the personal data ...
-GDPR, Article 15
![Page 65: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/65.jpg)
"RIGHT TO ERASURE"
![Page 66: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/66.jpg)
' The data subject shall have the right to obtain from the controller the erasure of personal data concerning him or her without undue delay
-GDPR, Article 17
![Page 67: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/67.jpg)
PERSONALLY IDENTIFIABLE INFORMATION
![Page 68: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/68.jpg)
' ‘personal data’ means any information relating to an identified or identifiable natural person; an identifiable natural person is one who can be identified, directly or indirectly
-GDPR, Article 4
![Page 69: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/69.jpg)
GROUNDS
![Page 70: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/70.jpg)
' .. the personal data are no longer necessary .. the data subject withdraws consent on which the processing is based
-GDPR, Article 17
![Page 71: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/71.jpg)
EXCEPTIONS
![Page 72: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/72.jpg)
' .. to comply with a legal obligation .. for the establishment, exercise or defence of legal claims (*)
-GDPR, Article 17
![Page 73: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/73.jpg)
UNDUE DELAY
![Page 74: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/74.jpg)
INFORM 3RD PARTIES
![Page 75: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/75.jpg)
BACKUPS?
![Page 76: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/76.jpg)
PROCESSING GDPR ART. 17 REQUESTS
@michieltcs
RightToErasureInvoked
![Page 77: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/77.jpg)
PROCESSING GDPR ART. 17 REQUESTS
@michieltcs
RightToErasureInvoked
Notify 3rd parties
![Page 78: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/78.jpg)
PROCESSING GDPR ART. 17 REQUESTS
@michieltcs
RightToErasureInvoked
Remove from read
models
Notify 3rd parties
![Page 79: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/79.jpg)
PROCESSING GDPR ART. 17 REQUESTS
@michieltcs
RightToErasureInvoked
Remove from event
store
Remove from read
models
Notify 3rd parties
![Page 80: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/80.jpg)
PROCESSING GDPR ART. 17 REQUESTS
@michieltcs
RightToErasureInvoked
Remove from event
store
?
Remove from read
models
Notify 3rd parties
![Page 81: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/81.jpg)
IMMUTABLE EVENTS?
![Page 82: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/82.jpg)
COMPENSATING ACTIONS
![Page 83: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/83.jpg)
@michieltcs
Ledger EntryAug 14 Inventory �15600,00
Accounts Payable �15600,00
![Page 84: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/84.jpg)
@michieltcs
Ledger EntryAug 14 Inventory �15600,00
Accounts Payable �15600,00
Ledger EntryAug 14 Inventory �16500,00
Accounts Payable �16500,00
![Page 85: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/85.jpg)
@michieltcs
Ledger EntryAug 14 Inventory �15600,00
Accounts Payable �15600,00
Ledger EntryAug 14 Inventory �16500,00
Accounts Payable �16500,00
Ledger Correction EntryAug 14 Inventory �900,00
Accounts Payable �900,00
![Page 86: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/86.jpg)
COMPENSATING ACTIONS
class MoneyWithdrawn { String accountId; BigDecimal amount; }
class WithdrawalRolledBack { String accountId; BigDecimal amount; }
Typo: too much withdrawn!
![Page 87: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/87.jpg)
COMPENSATING ACTIONS
class AccountOpened { String accountId; String accountNumber; }
class DuplicateAccountClosed { String accountId; }
Duplicate account number!
![Page 88: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/88.jpg)
GDPR?
![Page 89: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/89.jpg)
STRATEGIES
![Page 90: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/90.jpg)
ONLY REMOVE FROM PROJECTION?
![Page 91: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/91.jpg)
LEGAL DEFENCE?
![Page 92: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/92.jpg)
' .. adequate, relevant and limited to what is necessary in relation to the purposes for which they are processed (‘data minimisation’)
-GDPR, Article 5
![Page 93: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/93.jpg)
UPCASTING?
![Page 94: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/94.jpg)
UPCASTING
Event Store
Event_V1
Upcaster
Event_V2
Event Handler
@michieltcs
![Page 95: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/95.jpg)
UPCASTING
Event Store
Event_V1
Upcaster
Event_V2
Event Handler
@michieltcs
Event_V2 = f(Event_V1)
![Page 96: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/96.jpg)
UPCASTING
Event Store
Event_V1
Upcaster
Event_V2
Event Handler
@michieltcs
Event_V2 = f(Event_V1)
![Page 97: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/97.jpg)
DELETING EVENTS
![Page 98: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/98.jpg)
DELETING EVENTS
![Page 99: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/99.jpg)
MODIFYING EVENTS
![Page 100: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/100.jpg)
MODIFYING EVENTS
![Page 101: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/101.jpg)
COPY & FILTER
![Page 102: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/102.jpg)
VERSIONED EVENT STORE
![Page 103: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/103.jpg)
VERSIONED EVENT STORE
events_v1
[ { "id": "12345678", "type": "AccountOpened", "aggregateType": "Account", "aggregateIdentifier": "1234", "sequenceNumber": 0, "payloadRevision": "1.0", "payload": { ... }, "timestamp": ... ... }, ... ]
@michieltcs
![Page 104: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/104.jpg)
COPY & REPLACE
![Page 105: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/105.jpg)
VERSIONED EVENT STORE
Loop over existing events
Apply upcaster
Add queued events
Use new event store
New events Queue
@michieltcs
![Page 106: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/106.jpg)
VERSIONED EVENT STORE
events_v2
[ { "id": "12345678", "type": "AccountOpened", "aggregateType": "Account", "aggregateIdentifier": "1234", "sequenceNumber": 0, "payloadRevision": "2.0", "payload": { ... }, "timestamp": ... ... }, ... ]
@michieltcs
![Page 107: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/107.jpg)
STORE PII EXTERNALLY
![Page 108: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/108.jpg)
STORE PII EXTERNALLY
@michieltcs
1 @Value 2 public class AccountOpened { 3 String accountId; 4 String accountNumber; 5 String name; 6 }
![Page 109: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/109.jpg)
STORE PII EXTERNALLY
@michieltcs
1 @Value 2 public class AccountOpened { 3 String accountId; 4 }
![Page 110: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/110.jpg)
STORE PII EXTERNALLY
@michieltcs
AccountOpened External Storage
1 @Value 2 public class AccountOpened { 3 String accountId; 4 }
Account Id Account number Name1234 12345678 John Doe
... ... ...
![Page 111: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/111.jpg)
STORE PII EXTERNALLY
@michieltcs
AccountOpened External Storage
1 @Value 2 public class AccountOpened { 3 String accountId; 4 }
Account Id Account number Name1234 12345678 ANON
... ... ...
![Page 112: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/112.jpg)
STORE PII EXTERNALLY
@michieltcs
AccountOpened External Storage
1 @Value 2 public class AccountOpened { 3 String accountId; 4 }
Account Id Account number Name1234 12345678 ANON
... ... ...
![Page 113: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/113.jpg)
CRYPTO ERASURE
![Page 114: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/114.jpg)
ENCRYPT EVENTS
![Page 115: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/115.jpg)
DECRYPT EVENTS
![Page 116: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/116.jpg)
ENCRYPT FIELD VALUES
![Page 117: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/117.jpg)
DECRYPT FIELD VALUES
![Page 118: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/118.jpg)
ENCRYPTING EVENTS
@michieltcs
<org.demo.AccountOpened> <accountId>80f49161</accountId> <accountNumberIban>NL00ABNA012345678</accountNumberIban> <firstName>Foo</firstName> <lastName>Bar</lastName> ... </org.demo.AccountOpened>
![Page 119: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/119.jpg)
ENCRYPTING EVENTS
@michieltcs
<org.demo.AccountOpened> <accountId>80f49161</accountId> <accountNumberIban>2dqjHkY8Mc8+cek4vs/9hzgkob4J3fZJNIJh2sAXlJ0=</accountNumberIban> <firstName>N5Y27vd0UbKo6FIu5c7QGQ==</firstName> <lastName>OSKrzfuuuayuUNXYS5YUug==</lastName> ... </org.demo.AccountOpened>
![Page 120: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/120.jpg)
ENCRYPTING EVENTS
Generate event
Find / create
encryption key
Encrypt payload values
Storeevent
@michieltcs
![Page 121: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/121.jpg)
DECRYPTING EVENTS
Loadevent
Find associatedencryption
key
Decrypt payload values
Processevent
@michieltcs
![Page 122: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/122.jpg)
SHEDDING THE KEY
Loadevent
Find associatedencryption
key
Decrypt payload values
Processevent
@michieltcs
X
![Page 123: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/123.jpg)
AXON GDPR MODULE
@michieltcs
1 @Value 2 public class AccountOpened { 3 @DataSubjectId 4 String accountId; 5 6 @PersonalData 7 String accountNumberIban; 8 9 @PersonalData 10 String firstName; 11 12 @PersonalData 13 String lastName; 14 }
![Page 124: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/124.jpg)
KEY MANAGEMENT
![Page 125: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/125.jpg)
PERFORMANCE
![Page 126: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/126.jpg)
RE-ENCRYPT DATA AT REST
![Page 127: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/127.jpg)
CLOSING WORDS
![Page 128: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/128.jpg)
GDPR
![Page 129: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/129.jpg)
CHALLENGES
![Page 130: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/130.jpg)
FRAMEWORK SUPPORT
![Page 131: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/131.jpg)
(IM)MUTABILITY
![Page 132: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/132.jpg)
AUDIT TRAIL
![Page 133: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/133.jpg)
DEMONSTRATING CONSENT
![Page 134: FORGET ME PLEASE? EVENT SOURCING & THE GDPR · read CQRS / Event Sourcing theory followed a tutorial, built a hobby project used it in production RAISE YOUR HAND IF YOU HAVE. Axon](https://reader033.fdocuments.net/reader033/viewer/2022042403/5f16572239e25118cf6e3e5e/html5/thumbnails/134.jpg)
FUTURE?