I’m implementing a functionality in our app where users buy a subscription and create their workspace. Each subscription plan has different storage limits (e.g, 5 GB for a small plan). We use Backblaze B2 for storage, and currently, we create a separate bucket whenever an organization is created, which works fine.
However, I need to limit the bucket upload size according to the subscription plan the user has purchased. I have researched a lot but couldnt find a way to enforce storage limits on Backblaze buckets. Moreover, Backblaze doesn’t seem to offer a way to get the storage size of a bucket or a whole folder.
I have gone through Backblaze documentation and searched online for any existing solutions or workarounds but haven’t found a way to directly limit the storage size of a bucket. I expected to find a method or API that allows setting storage quotas or retrieving the total size of a bucket to enforce these limits programmatically.
Additionally, I’m using @aws-sdk/client-s3
for managing S3-compatible storage.
Does anyone know how to implement storage limits on Backblaze B2 buckets based on the user’s subscription plan? Any advice or workarounds would be greatly appreciated. Thanks!