I am developing a java server that stores files on Amazon S3. I need to have transaction management with S3 such that if an operation to an external server fails every file that was saved to S3 must be rollback.
It is basically like transaction management to the database except that the data source in this case is AWS S3, it could have been the file system as well.
I was unable to find existing technologies and was wondering if I just need to implement it or a library/technology exists already for that.
Thx in advance.
There isn't any out of the box way to implement the transaction management; so you have hand code the logic and implementation on your own.
The one advantage you have with respect to the S3 is that, you will never get a dirty read or dirty write. S3 will always gives you the completely processed file ( blob ) although even if it is being currently written. This kind of reduces the burden to putting the efforts in implementation of the critical section, locking etc. It is directly supported by AWS.
So the way I suggest the implementation of the Transaction process is
The other alternative is to push the data to S3, if in the event of roll-back transaction requirement you may delete the S3 key
This might sound subtle but that't how it is, the question scope is broad.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With