You seem to be looking for solutions to two problems:

* how to talk to non-transactional APIs in a transactional way, and
* how to ensure distributed transactionality.

The first is independent of Akka, and there is no generic solution. For
the second, there are some solutions (two phase commit), again outside
Akka scope. They are seriously heavy weight while not being completely
reliable, and they are rather at odds with the reactive paradigm of
'letting it crash', i.e. embracing failure.

If you are building a reactive system, you might want to approach the
prolem along the lines of sending (unreliable) update requests to all
participating resources, living with temporary inconsistencies, and
reconciling them later if and when needed. This approach is sometimes
called "inverse transactions".

--> hope this helps

Am 12.02.2017 um 05:07 schrieb Sovon Nath:
> Thanks Arno!
> 
> My question was related to, how should I call multiple APIs and ensure,
> that all of these calls are successful and happens only once. The
> solution you provided, for DB, can also be for APIs. I still have some
> doubts about this:
> - What if the API calls take time, and we drop it from the calling
> function, but in the backend it was successful
> - What if the job that is performing the commit has to do it over
> multiple DB and some succeed and some fail 
> 
> Also, how should be orchestrate the API calls.
> 
> On Saturday, February 11, 2017 at 4:17:34 AM UTC-5, Arno Haase wrote:
> 
>     Assuming you are thinking about transactional access to a relational
>     database, you could have an actor representing the transaction. Every
>     write goes to it as a message, and it stores these operations. A
>     'commit' message can then trigger the actual database transaction, with
>     all writes being done in a single burst.
> 
>     There are some limitations to this, mainly that there is no direct
>     feedback based on a single write operation (e.g. number of affectred
>     rows for an update to implement optimistic locking). You can get around
>     these by adding a protocol on top, but that increases complexity and
>     puts some burden on using code.
> 
>     - Arno
> 
>     Am 10.02.2017 um 23:29 schrieb Sovon Nath:
>     > Hi All,
>     > I am trying to evaluate Akka for one of our use cases. Is there any
>     > standard pattern to implement ACID transactions in Akka? Also is
>     there
>     > any recommended orchestration tools that we can use for Akka APIs?
>     >
>     > --
>     >>>>>>>>>>> Read the docs: http://akka.io/docs/
>     >>>>>>>>>>> Check the FAQ:
>     > http://doc.akka.io/docs/akka/current/additional/faq.html
>     <http://doc.akka.io/docs/akka/current/additional/faq.html>
>     >>>>>>>>>>> Search the archives:
>     https://groups.google.com/group/akka-user
>     <https://groups.google.com/group/akka-user>
>     > ---
>     > You received this message because you are subscribed to the Google
>     > Groups "Akka User List" group.
>     > To unsubscribe from this group and stop receiving emails from it,
>     send
>     > an email to [email protected] <javascript:>
>     > <mailto:[email protected] <javascript:>>.
>     > To post to this group, send email to [email protected]
>     <javascript:>
>     > <mailto:[email protected] <javascript:>>.
>     > Visit this group at https://groups.google.com/group/akka-user
>     <https://groups.google.com/group/akka-user>.
>     > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
> 
> -- 
>>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google
> Groups "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to