Image upload storage strategies

后端 未结 7 625
天命终不由人
天命终不由人 2020-12-04 07:01

When a user uploads an image to my site, the image goes through this process;

  • user uploads pic
  • store pic metadata in db, giving the image a unique id
7条回答
  •  渐次进展
    2020-12-04 07:25

    Have you thought about using something like Amazon S3 to store the files? I run a photo hosting company and after quickly reaching limits on our own server, we switched over to AmazonS3. The beauty of S3 is that there are no limits like inodes and what not, you just keep throwing files at it.

    Also: If you don't like S3, you can always try and break it down into subfolders as much as you can:

    /userid/year/month/day/photoid.jpg

提交回复
热议问题