I'm trying to find this information but without much luck so far.
I have a fairly large file on S3(in a range of 64-128Gb) and I would like to read random byte ranges from it - is it doable? I guess byte-range offset would be very large for chunks somewhere close to the end of the file.
Typical read chunks are 1-12 Kb if that's important.
CodePudding user response:
This won't be a problem.
The Amazon docs state that the Range
header as supported as per spec (but only one range per request):
Range
Downloads the specified range bytes of an object. For more information about the HTTP Range header, see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35
RFC2616 doesn't define any upper limit.
The first-byte-pos value in a byte-range-spec gives the byte-offset of the first byte in a range. The last-byte-pos value gives the byte-offset of the last byte in the range; that is, the byte positions specified are inclusive. Byte offsets start at zero.
This makes sense because the range is automatically limited by the file size, and a system that, say, only supports 32-bit numbers overall will usually also only support files up to a size of 2 GiB (minus one).