Data consistency for multiple & connected REST api calls?

Hello all.

Could anyone here help me with the following question (in the context of REST api calls):
e.g. I save a parse object and update the count (which is stored as a separate parse object) in afterSave method. What happens if the saving of the object succeeds but the update of the count fails?
How is data consistency ensured in such cases?

Thanks.

Iā€™d try to ensure an atomic operation by sending a batch request with both operations together and the flag transaction: true

1 Like

Is there any doc or example of transaction: true?

Not yet. But you can see some examples in the test cases: https://github.com/parse-community/parse-server/blob/master/spec/batch.spec.js

1 Like

Thanks for replying :+1: