I'm writing an application which will run on AWS. It contains user uploads like images and videos and I want to store that data in S3. I'm wondering how to prevent one user uploading gigabytes of data as I will pay for it. I can:
- limit single file upload size (let's say 50MB, as videos are allowed)
- limit amount of file uploads (let's say 1000, just an arbitrary number)
But if someone wants, he could make several accounts and fill my storage with trash. I can also check my bucket size, before every upload, and only upload if my bucket volume < 50GB for example. But these computations are very expensive for some simple uploads.
Should I change to another storage service where I can put a limit? Or is there a common way to solve my issue? Or should I just trust my users?