I am building a transactional system requiring low latency, but is highly available and fault tolerant. I can ack the transaction immediately, as soon as I can guarantee that it won't be lost due to a single-node failure. Initial thoughts around the main components are Play Framework to receive requests, Akka (of course), and MongoDB as a data store.
To avoid the latency cost of writing to disk, I was considering sending the received message to a second server for temporary storage in an actor's memory state: Play 1 -> receive message from browser Play 1 -> forward message to "journal actor" on Play 2 Play 2 -> ack receipt to Play 1 Play 1 -> ack receipt to browser (now that the message is "safe" in memory on two servers) <-- user-perceived latency up to here Play 1 -> insert into MongoDB Play 1 -> upon confirmation of MongoDB insert, send "delete" to Play 2 Play 2 -> deletes message in memory If Play 1 fails to insert into MongoDB within the time that Play 2 expects the delete, Play 2 attempts an "upsert" into MongoDB (upsert handles the situation in which the initial insert did work, but no delete was received). Akka-persistence could even be used on Play 2 to write the data to disk asynchronously for greater consistency -- though not perfect -- in case of multi-node failure. Thoughts? Is there a better / simpler way to accomplish this? Regards, Raman -- >>>>>>>>>> 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
