BlogsShopifyS3 Partitioning and Request Rate Management

S3 Partitioning and Request Rate Management

S3 Partitioning and Request Rate Management

1
posts
2018

Shopify has evolved its approach to managing cloud storage usage, specifically Amazon S3, to address increasing error rates and latencies caused by rapid merchant growth. Initial efforts focused on understanding the impact of S3's internal partitioning mechanism on request rates and rate limits. The core problem identified was that a spike in activity from a single shop could trigger a 'SlowDown' exception for an entire partition, affecting multiple shops. To mitigate this, Shopify implemented a strategy of prefixing asset operations with a hash-generated digest derived from the shop ID and asset path. This injection of entropy distributes writes across more partitions, reducing the likelihood of hitting a single partition's rate limit and causing widespread failures. This change resulted in a significant reduction in SlowDown events and a notable decrease in read latencies for digested assets, improving overall platform reliability and performance. The lessons learned are applicable to other cloud storage providers as well.

2018

Future Proofing Our Cloud Storage Usage - Shopify

2/26/2018

This post details the implementation of a strategy to mitigate S3 'SlowDown' exceptions and reduce latencies by prefixing asset operations with a hash-generated digest. This digest is derived from the shop ID and asset path, effectively distributing writes across more S3 partitions. The change was applied to new shops and led to a significant drop in SlowDown events and a reduction in median and 95th percentile latencies for S3 GET operations.