I'm in the early stages of building my startup, and I'm trying to decide on the best approach for storing user-uploaded videos. I'm using Golang with the Gin framework for the backend and I was thinking of initially using local storage for these files during development. My plan is to switch to VPS storage later on as things stabilize. However, I'm not entirely convinced this is the most effective long-term solution. I'm concerned if a VPS can handle a significant amount of video uploads and storage as my user base expands. I also worry about the safety of the data—like what happens if I accidentally delete the video folder or if the server crashes? Losing user videos would be disastrous. Should I stick with local or VPS storage, or is there a better option right off the bat?
5 Answers
Do the math on how much storage you'll need as your user base grows. If users can upload unlimited videos, you might end up exceeding your VPS limits quickly, impacting profitability. Also, you need a solid backup plan; that's non-negotiable especially if you're looking to scale.
Local storage can work at first, but consider switching to something like S3 or an object-based storage system for better durability. Providers like AWS even offer versioning and other safeguards against accidental deletes, and having automated backups is a smart way to prevent data loss. Think ahead about scalability too!
You should definitely look into using something like Cloudflare R2 for storage. It's great and has an S3 compatible Go SDK! If you're worried about user privacy, you can keep buckets private and generate signed URLs for user access. Let me know if you need an example!
Using Cloudflare R2 or S3 with signed URLs is a solid approach! Especially if you think you won't generate too much data initially, a VPS could suffice, but don’t forget to hash your video filenames to prevent unauthorized access. It's a security measure you don’t want to overlook!
Yeah, definitely! Keeping user data private and secure is paramount. I hadn't heard about Cloudflare R2 before; must check it out!
If you decide to use a VPS, treat it as temporary. It's crucial to have a proper storage solution that can scale, like using dedicated object storage for persistence. And remember, user-uploaded content can be tricky—storing it on a different host can provide better security and separation of duties!

I completely agree! R2 is a fantastic choice. The SDK makes it pretty easy to integrate without a major learning curve.