Difference in Write to Multiple Data Store entity and Write to Data Store entity?

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

Parents
  • 0
    Certified Lead Developer

    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.

Reply Children
No Data