Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
docs: ADR for outbox pattern and production modes #292
docs: ADR for outbox pattern and production modes #292
Changes from 3 commits
c3a9c06
317b2dc
a4776d0
7dda7af
a7434e1
a49d859
55d4957
b5c816f
f932462
71dc150
09ff159
289e3f8
4053629
5f9d24b
9fc5e16
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there three modes or four here? Events default to post-commit, or you can configure immediate, on_commit, outbox. post-commit = on_commit?
from reading below it looks like post-commit is current adhoc behavior which all needs to be changed to on_commit future regulated behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, I should clean that up -- it's just three modes. Post-commit/on-commit are supposed to be the same thing. I wasn't sure whether or not to draw a distinction between the current ad-hoc behaviors and the intended modes via naming differences. Probably I shouldn't do that, and should use consistent names for the two. Maybe I'll go back and use the mode names in the Context section rather than using pre-commit and post-commit there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to consistently use names "immediate" and "on-commit".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just drop this one? What I'm getting at is that if all events run through one commit hook, they're easier to think about. Is there ever an important reason to get the event out before the DB write?
Although maybe if all events are sent the same one having this feature is close to free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... yes, I think we could! All of the current events are about a change in application state, so if a transaction rolls back then we should not send the event. I can imagine future events that are more about a request, or an attempt having been made, but we can add that mode if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed immediate as a mode, and described it instead as something that could be added in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if
django-jaiminho
could either move to the consequence section, or be a lighter touch on this ADR. I feel like this ADR is more general, and doesn't need to be tied to a specific implementation, although we do need to choose one, and it is fine to document what we will be trying. That also could be its own ADR, but my point is that if we decide on a different implementation, it really shouldn't supersede this ADR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could break out an implementation plan subsection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been moved to a new subsection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: review this update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it? Can't I just configure all my events to be post-commit send in a config file?
or maybe I misunderstood and the three producer models are in code, not all the same in code and then at "send" do one of three things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, it doesn't become more complicated if you opt not to use outbox. (I just... have opinions here.) I can dial that back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't current web calls that produce events already have the broker latency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might depend on the implementation. The Kafka implementation queues events for delivery to the broker, but that happens asynchronously to the request. Another implementation might do synchronous delivery (including raising an exception in the request thread if the broker communication fails!)