Skip to content
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

feature: Support processing an event as part of a transaction. #9

Open
joerdav opened this issue Apr 12, 2022 · 2 comments
Open

feature: Support processing an event as part of a transaction. #9

joerdav opened this issue Apr 12, 2022 · 2 comments

Comments

@joerdav
Copy link

joerdav commented Apr 12, 2022

Use case

We have a bit of code that modifies a few different dynamo records. Currently this is done as separate transactions so can result in orphaned data. We also want to add some conditions to the expression.

One of the transactions is a stream Process, which would make it difficult to batch the changes into one transaction.

Suggestion

My suggestion is for the stream.Processor to have some kind of additional function that processes events but returns them as dynamodb transactions rather than applying them.

Other options

Another option would be to allow passing other transactions that could be on other tables into the Process function. I think this makes less sense though, and isn't very intuitive.

@a-h
Copy link
Owner

a-h commented Apr 30, 2022

I've had a go at your suggestion, is this what you had in mind? https://github.com/a-h/stream/tree/split_prepare_exec

@joerdav
Copy link
Author

joerdav commented May 12, 2022

This is exactly what I had in mind!

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

No branches or pull requests

2 participants