I want to build a resource sharing site where members can download resources a certain number of times, so I need access to my backend server to determine the number of downloads available to the user. Because the number of downloads is much more than uploads, I want to find an object cloud storage service with cheap egress traffic, cloudflare r2 and Wasabi look like a good fit! I wanted to achieve precise permission control with cloudflare workers, but in reading the documentation for cloudflare workers, I found these limitations:
a. I need to access my backend in cloudflare worker function, which may take 100~500ms or even longer, but the worker can only support 6 concurrent outgoing connections at the same time, does it mean that if 10 users click on the download button at the same time, the extra users need to queue up and wait for my backend to determine the permission?
b. The maximum execution time of worker is 30s, if a resource is too big and the download can't be finished in 30s, will the worker terminate the download?
c. I read the documentation of wasabi and found that I can use Access key to control the access, however, I need to send the key to the user, in that case, the key is leaked, which seems to be suitable for the service that I download by myself, not suitable for my scenario. So is there any object storage service that can execute javascript functions for permission control, and egress traffic is not expensive (google storage is too expensive for mass download scenarios)?