Live data from Hacker News

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

aws.amazon.com

141–150 of 166 posts

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

#141

So...are we closer to getting to use S3 as a...you guessed it...a database? With CAS, we are probably able to get a basic level of atomicity, and S3 itself is pretty durable, now we have to deal with consistency and isolation...although S3 branded itself as "eventually consistent"...

S3 is strongly consistent since 4 years ago. https://aws.amazon.com/blogs/aws/amazon-s3-update-strong-rea...

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

#142

I had no idea people rely on S3 beyond dumb storage. It almost feels like people are trying to build out a distributed OLAP database in the reverse direction.

1. SELECT ... INTO OUTFILE S3

2. glue jobs to partition by some columns reporting uses

3. query with athena

4. ???

5. profit (celebrate reduced cost)

This thing costs couple $ a month for ~500gb of data. Snowflake wanted crazy amounts of money for the same thing.

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

#143

Earlier quoted context omitted.

Autoscaling and task queue based workloads, if my cloud theory is still relevant.

Agreed. Scaling based on the length of the queue, up to some maximum.

Even better, based on queue latency instead of length

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

#144
post #133
post #130

Earlier quoted context omitted.

EC2 bills by the second.

Some... "Your Amazon EC2 usage is calculated by either the hour or the second based on the size of the instance, operating system, and the AWS Region where the instances are launched" - https://repost.aws/knowledge-center/ec2-instance-hour-billin... https://aws.amazon.com/ec2/pricing/on-demand/

MacOS instances appear to be the sole remaining exception since RHEL got on board.

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

#145
post #133

Earlier quoted context omitted.

Some... "Your Amazon EC2 usage is calculated by either the hour or the second based on the size of the instance, operating system, and the AWS Region where the instances are launched" - https://repost.aws/knowledge-center/ec2-instance-hour-billin... https://aws.amazon.com/ec2/pricing/on-demand/

MacOS instances appear to be the sole remaining exception since RHEL got on board.

Thanks Corey. Always nice to get the TL;DR from an authority on the subject.

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

#146
post #84

Earlier quoted context omitted.

S3 has supported SHA-256 as a checksum algo since 2022. You can calculate the hash locally and then specify that hash in the PutObject call. S3 will calculate the hash and compare it with the hash in the PutObject call and reject the Put if they differ. The hash and algo are then stored in the object's metadata. You simply also use the SHA-256 hash as the key for the object. https://aws.amazon.com/blogs/aws/new-addit…

Unfortunately, for a multi-part upload it isn't a hash of the total object, it is a hash of the hashes for each part, which is a lot less useful. Especially if you don't know how the file was partititioned during upload. And even if it was for the whole file, it isn't used for the ETag, so, so it can't be used for conditional PUTs. I had a use case where this looked really promising, then I ran into the multipart upl…

If parts are aligned on a 1024-byte boundary and you know each part's start offset, it should be possible to use the internals of a BLAKE3 tree to get the final hash of all the parts together even as they're uploaded separately. https://github.com/C2SP/C2SP/blob/main/BLAKE3.md#13-tree-has...

Edit: This is actually already implemented in the Bao project which exploits the structure of the BLAKE3 merkle tree structure to offer cool features like streaming verification and verifying slices of a file as I described above: https://github.com/oconnor663/bao#verifying-slices

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

#147
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.

So....given CAP, which one did they give up

Based on my general experience with S3, they jettisoned A years ago (or maybe never had it).

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

#149

An open-source implementation of Amazon S3 - MinIO has had it for almost two years (relevant post: https://blog.min.io/leading-the-way-minios-conditional-write... ). Strangely, Amazon is catching up just now.

It's not surprising at all. The scale of AWS, in particular S3, is nearly unfathomable, and the kind of solutions they need for "simple" things are totally different at that size. S3 was doing 1.1million requests a second back in 2013.[1]

I wouldn't be surprised if they saw over 100mil/req/sec globally by now. That's 100 million requests a second that need strong read-your-write consistency and atomicity at global scale. The number of pieces they had to move into place for this to happen is probably quite the engineering tale.

[1] https://aws.amazon.com/blogs/aws/amazon-s3-two-trillion-obje...

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

#150

Earlier quoted context omitted.

Agreed. Scaling based on the length of the queue, up to some maximum.

Even better, based on queue latency instead of length

The single best metric I've found for scaling things like this is the percent of concurrent capacity that's in use. I wrote about this in a previous HN comment: https://news.ycombinator.com/item?id=41277046

Scaling on things like the length of the queue doesn't work very well at all in practice. A queue length of 100 might be horribly long in some workloads and insignificant in others, so scaling on queue length requires a lot of tuning that must be adjusted over time as the workload changes. Scaling based on percent of concurrent capacity can work for most workloads, and tends to remain stable over time even as workloads change.

Post reply on HN