Skip to content

Organizing service methods that require multiple dependencies #5

Answered by benbjohnson
seankay asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Sean,

I would probably wrap it how you have done there with postgres wrapping s3. That seems intuitive to me although you could do it the other way around.

I'm not sure you can necessarily make the operation atomic. Regardless of the order you wrap them, if it fails halfway through, then you'll have the attachment stored in only one place. You could have a cleanup operation that removes objects from S3 that have not been persisted in Postgres to fix that though.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Jiraffe7
Comment options

@benbjohnson
Comment options

@Jiraffe7
Comment options

@tsvobo
Comment options

@benbjohnson
Comment options

Answer selected by seankay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants