R2 is Cloudflare's blob storage provider. We use it to store all of the release assets stored by the Release Worker.
R2 stores files flatly, meaning a directory does not exist in R2.
However, R2 allows characters such as slashes (/) in an object's name.
For directories we can then specify a prefix (like nodejs/release/) and R2 will only return objects that has a name that starts with that prefix.
R2 allows integration with Workers through their bindings API. We use this when fetching files.
Due to some performance issues we were seeing with R2's list binding command, we opted to use R2's S3 API for listing directories.
We have two R2 buckets:
-
dist-staging- Holds staged releases. This bucket is private and should not be publicly accessible. -
dist-prod- Holds released versions of Node.js. Everything in this bucket should be considered publicly accessible.
(see Release Process for more information on how we use these buckets)