Transactions and SimpleDb

Sep 23, 2010 at 5:08 PM

I am using your Simple Savant library for reading/writing into Simple Db. So far it has been working great. I have one question regarding writing data into Simple Db using Simple Savant.

How can I create a Transaction and make sure all the changes are either written into Simple DB or not? There are situations in my application where I end up updating 2 or 3 domains at the same time.

I know Simple DB is not a typical Relational Database but is there workaround or any alternative. I bet other users of Simple Savant must have had similar questions


Sep 23, 2010 at 6:00 PM

SimpleDB doesn't support true transactions, but Savant does include a feature called Reliable Writes to help in cases like yours.The doc page on Versioning and Consistency describes how it works.

Basically, it guarantees that a batch of updates or deletes to multiple domains will either all succeed or all fail. It's not a true transaction because the data may remain in an inconsistent state for a short period of time. However, Savant will eventually complete all parts of the write or continue logging failed update attempts indefinitely. The only times a reliable write will fail persistently are

  1. When your server lacks access to SimpleDB (network or credentials problem)
  2. When your write is violating SimpleDB limits (such as attempting to store too much data in an item or domain)
  3. Due to a Savant or SimpleDb bug.