Stream: implementers
Topic: In-order updates in a transaction/batch
Lloyd McKenzie (May 02 2017 at 19:02):
I want to create a batch or transaction that will create all the instances associated with a workflow scenario. For some instances, that means creating multiple versions of the instance - initial create (PUT) and then subsequent updates, applied in order. However, my read of the specification is that neither Batch nor Transaction will support this. Batch says that all operations must be independent and Transaction says that the entries can be processed in any order. Neither of those work for application of in-order updates. I don't really understand the requirement for order-indepencence in Transaction - why would a server want to be able to process the entries in an order other than the order they're specified in? The only reason I can think of is if there were dependencies and the order of submission was wrong, but it's a lot of work for the server to work out the dependencies and presumably the client has a better chance of getting the order right in the first place. Thoughts on changing transaction so that order matters (and thus allowing updates within a transaction)?
Grahame Grieve (May 02 2017 at 22:27):
it's a limitation to do with processing requirements - if any operation fails, the whole thing fails. Allowing mutual inter-dependencies in a transaction dramatically increases the processing complexity
Lloyd McKenzie (May 03 2017 at 01:47):
I'm not sure I follow. From an SQL perspective, you open a transaction, you process each event in order and, if any fails, you do a rollback. I don't see how requiring the entries to be processed in order adds complexity - I would think the complexity would be trying to decide what order to do them in if it's not dictated ahead of time. If you don't have rollback capability, then transaction is going to be hard no matter what, but I'm not sure how enforcing order ups the ante.
Grahame Grieve (May 03 2017 at 04:22):
not all the consequence are in a transactional store, if you have one
Lloyd McKenzie (May 03 2017 at 10:35):
So how would you recommend that we meet the use-case - being able to create several versions of a single resource at a time?
Grahame Grieve (May 04 2017 at 00:26):
I'm still not sure I follow the use case, other than for education purposes
Lloyd McKenzie (May 04 2017 at 01:33):
Well, if you're wanting to apply all changes in the last hour, that could include some creates and updates. That's essentially all the education case is doing is sumarizing (and wanting to create on test servers) a set of changes that have happened over time.
Jayashree Surnar (Jun 20 2017 at 08:28):
i have gone through the doc(transaction/batch),i understand the diff, but didn't understand when to use what option (transaction/batch)?if some one knows please help.
thank you.
Grahame Grieve (Jun 20 2017 at 11:30):
depends what you want to happen on failure, or whether you want to cross link resources within a single call
Last updated: Apr 12 2022 at 19:14 UTC