Live data from Hacker News

Amazon S3 Adds Put-If-Match (Compare-and-Swap)

aws.amazon.com

121–130 of 166 posts

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#121
post #11
post #8

Be still my beating heart. I have lived to see this day. Genuinely, we've wanted this for ages and we got half way there with strong consistency.

Might finally be possible to do this on S3: https://pkg.go.dev/github.com/ncruces/go-gcp/gmutex

Huh. Does this mean that the AWS terraform provider could implement state locking without the need for a DDB table the way the GCP provider does?

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#122
post #11

Earlier quoted context omitted.

Might finally be possible to do this on S3: https://pkg.go.dev/github.com/ncruces/go-gcp/gmutex

Huh. Does this mean that the AWS terraform provider could implement state locking without the need for a DDB table the way the GCP provider does?

Correct

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#123

Earlier quoted context omitted.

Worked out how? There’s no implementation. It’s just conjecture.

It's right there: > Our bet that S3 would get it in a reasonable time-frame worked out!

How? This is a technical forum. Unless you’re saying any consumer of S3 can now spam links to their product on this thread with impunity. (Hey maybe they’re using cas).

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#125

Ah so its not only me that uses AWS primitives for hackily implementing all sorts of synchronization primitives. My other favorite pattern is implementing a pool of workers by quering ec2 instances with a certain tag in a stopped state and starting them. Starting the instance can succeed only once - that means I managed to snatch the machine. If it fails, I try again, grabbing another one. This is one of those things…

What would you say would be the "clean" way to implement a pool of workers (using EC2 instances too)?

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#126

Does this mean, in theory we will be able to manage multiple concurrent writes/updates to s3 without having to use new solutions like Regatta[1] that was recently launched? https://news.ycombinator.com/item?id=42174204

Here's how I would think about this. Regatta isn't the best way to add synchronization primitives to S3, if you're already using the S3 API and able to change your code. Regatta is most useful when you need a local disk, or a higher performance version of S3. In this case, the addition of these new primitives actually just makes Regatta work better for our customers -- because we get to achieve even stronger consistency.

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#127

Ah so its not only me that uses AWS primitives for hackily implementing all sorts of synchronization primitives. My other favorite pattern is implementing a pool of workers by quering ec2 instances with a certain tag in a stopped state and starting them. Starting the instance can succeed only once - that means I managed to snatch the machine. If it fails, I try again, grabbing another one. This is one of those things…

What would you say would be the "clean" way to implement a pool of workers (using EC2 instances too)?

etcd?

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#128

Ah so its not only me that uses AWS primitives for hackily implementing all sorts of synchronization primitives. My other favorite pattern is implementing a pool of workers by quering ec2 instances with a certain tag in a stopped state and starting them. Starting the instance can succeed only once - that means I managed to snatch the machine. If it fails, I try again, grabbing another one. This is one of those things…

What would you say would be the "clean" way to implement a pool of workers (using EC2 instances too)?

not sure, probably either an eks cluster with a job scheduler pod that creates jobs via the batch api. The scheduler pod might be replaced by a lambda. Another possibility is something cooked up with a lambda creating ec2 instances via cdk and the whole thing is kept track by a dynamodb table.

the first one is probably cleaner (though I don't like it, it means that I need the instance to be a kubernetes node, and that comes with a bunch of baggage).

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#129
post #115

Ah so its not only me that uses AWS primitives for hackily implementing all sorts of synchronization primitives. My other favorite pattern is implementing a pool of workers by quering ec2 instances with a certain tag in a stopped state and starting them. Starting the instance can succeed only once - that means I managed to snatch the machine. If it fails, I try again, grabbing another one. This is one of those things…

If you use hourly billed machines...Sounds like the world most expensive semaphore :-)

except we are actually using them :)

Re: Amazon S3 Adds Put-If-Match (Compare-and-Swap)

#130
post #115

Ah so its not only me that uses AWS primitives for hackily implementing all sorts of synchronization primitives. My other favorite pattern is implementing a pool of workers by quering ec2 instances with a certain tag in a stopped state and starting them. Starting the instance can succeed only once - that means I managed to snatch the machine. If it fails, I try again, grabbing another one. This is one of those things…

If you use hourly billed machines...Sounds like the world most expensive semaphore :-)

EC2 bills by the second.
Post reply on HN