Difference in Write to Multiple Data Store entity and Write to Data Store entity? When we need to use the multiple data store entity?
Discussion posts and replies are publicly visible
I think the name already implies the use cases. If you want to write to multiple entities/tables at once, go with the multiple. To write one or more items to a single entity/table, take the other.
Hi,
When you want to write/update multiple entities that belong to the same data store within a single database transaction, Multiple datastore entities will be useful. Whereas write to data store entity will write/update only one entity at a time.
Please find more details from the documentation
https://docs.appian.com/suite/help/21.2/Write_to_Multiple_Data_Store_Entities_Smart_Service.html
https://docs.appian.com/suite/help/21.2/Write_to_Data_Store_Entity_Smart_Service.html
Hope this helps!!
Thanks,
Hema.
Thanks Hema for the response.
Is there any other difference apart from this?
And Why it is not recommended to use multiple data store entity smart service?
Why are you asking? Who says that the multiple is not recommended?
It is a good idea to use the best matching tool for a given task.
Thanks Stefan.
Agreed on your comments. we have smart service(MWTDE) to use it , if we want to write data into Multiple entities.
Any difference in using 3 different write to Data store entities instead of Multiple WTDS entity smart service?
In term of performance or anything?
because i heard somewhere like multiple write to data store is not recommended , just seeking the reason behind this.
A single MWTDE will take less computing resources than three WTDE. I do not know of any other implications for normal use cases.
In case you need to manually create relationships between the data, you need multiple WTDEs.
I try to combine DB writes in a MWTDE if I can.
The difference is entirely about transactions.
Say you're doing banking with Appian, and you have a process that writes to Mr. Johnson's account that 3000 dollars are removed, then writes to Mr. Smith's account that 3000 dollars are added, and then writes to the Audit History that 3000 dollars were transferred from Mr. Johnson to Mr. Smith.
If you do those one at a time, then it should work most of the time. However, it's especially bad if something breaks. What if the money is removed from Mr. Johnson's account successfully, but then there's a "Connection Closed Exception" and the money isn't deposited in Mr. Smith's account. Then say the process retries 10 times without success then skips that node and writes the audit history just fine.
Mr. Smith is going to want to know where his money is. If you try it again, Mr. Johnson is going to want to know why 3000 dollars were deducted from his account twice. And when you get audited, you're going to have a massive headache figuring out the audit history.
OR, you do it all at once in one node. You deduct the money, deposit the money, and record the transaction in one step. If it fails, you don't commit anything. You roll back all of it and start again from the beginning. No money changes hands completely until all the steps go off without a hitch.
So that's what it's for. When the multiple writes constitute a single transaction, you should use Multiple Write to Datastore. If you don't want anything going unless it all goes, use that. If the writes are fairly unrelated, you can use a few Write to Datastore nodes back-to-back. I personally find the latter much easier to configure, and so potentially much more maintainable and less buggy, but when you need transactions you need transactions.
Thanks David for indetail explanation.
Thanks Dave for the detailed explanation with an easy to understand example Appreciate it