Skip to content

Update PostgreSQL to use the sequence number to check previous events… #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fasar
Copy link

@fasar fasar commented Jan 25, 2023

Dear mattnitshop,

I update the postgresql ddl to use the sequence as the lock for the previous event in the stream.
I also update the unit test.

  • What do you think ?
  • Did you think I miss something ?
  • Using UUID is mandatory ?

If you are agree with that, I will try to update the sqlite.
Thank you for you reply.

Best regards,
Fabien.

@mattbishop
Copy link
Owner

First of all, thank you for the Postgres docker contribution! Would you be able to produce a new PR with just those changes? I would like to merge that in.

@mattbishop
Copy link
Owner

I realized that I left out an important goal of this project, which was to make appending events require replaying events to be certain the new event is appended with an up-to-date model of the ledger state. What I have found with sequence IDs is that developers will write client code that skips the step of replaying events on a race condition. Instead, they manually increment the sequence ID to "find" the latest event rather than replaying.

This is important to ensure the events in the ledger match the business rules managed by the command handlers. It builds trust in the ledger to know the appended events are truly sequential without technical loopholes that the sequentially-incrementing field would expose.

Please let me know if this makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants