Open chibenwa opened 3 months ago
Note from @pvi-github
We can reuse the event bus from TMail and add the following events: BlobAdded
and BlobDeleted
to asynchronously manage the replication.
Failure mode anaysis:
S3 site 1 is unavailable: reads are unaffected as they will fallback on site 2. Writes will fails. Manual intervention will be required to swap site 1 and 2 in the configuration to resume operations (and run a manual sync when site 1 come back online)
Why
Achieve real time synchronosation between 2 S3 buckets while "Asynchronous Replication" is not supported by the S3 provider
How
Write a BlobStoreDAO that write synchronously into 2 distinct S3BlobStoreDAO
Write path
Write in parallel in blobStore A and B, return any error.
Read path
Read from A, fallback to B in case of error.
In case of unavailability of A or B in order to recover writes, explicit reconfiguration to use only blob store A (or B) would be needed.