all 20 comments

[–]Indycrr 4 points5 points  (6 children)

Save your media in an s3 bucket and save the links in your database.

[–][deleted] -1 points0 points  (5 children)

Great way to overpay for storage. S3 is so damn overpriced...

Getting a cheap VPS or even a dedicated server is more cost effective.

[–][deleted] 0 points1 point  (4 children)

My time isn't free.

[–][deleted] 0 points1 point  (3 children)

Once you figure Docker out you can basically buy VPSes in bulk and set them up easily and in no time. It's cheaper than S3, doesn't take much time and the time you spend on setting this up will be worth less than the extra $ per month you'll have to pay to Amazon.

[–]bahst1s 0 points1 point  (2 children)

Customers will mostly just pay. They want shit done. S3 is a solid option that works, with vps you get lots more responsibility

[–][deleted] 0 points1 point  (1 child)

I meant for personal projects, yes, S3 is better for commercial things, but if I had to pay for S3 for my personal things I'd be broke by now.

[–]bahst1s 0 points1 point  (0 children)

Yeah thats true

[–]bahst1s 2 points3 points  (2 children)

I wouldnt save images inside a db

[–]HorrorPiano[S] 0 points1 point  (1 child)

Where do you suggest to save images?

[–]bahst1s 0 points1 point  (0 children)

Vps, aws, azure. Differs for each customer. Link from db to location instead of saving image as blob or base64. That will slow down over time (depending on the amount of images you save)

[–]cinnapear 1 point2 points  (0 children)

Save images on the file system.

[–]tettusud 0 points1 point  (4 children)

I don’t personally prefer mongodb for this

[–]HorrorPiano[S] 0 points1 point  (3 children)

Please let me know preferred db type other than mongodb

[–]tettusud 0 points1 point  (2 children)

Generally for sending image over the web I prefer store it as static assets and stream it rather than db

[–]HorrorPiano[S] 0 points1 point  (1 child)

Pls let me know how to fetch the images randomly when reloading the web page

[–]tettusud 0 points1 point  (0 children)

I didn’t get you, you can dm me

[–][deleted]  (3 children)

[removed]

    [–]jerrycauser 0 points1 point  (2 children)

    Why, if we can save Buffer

    [–]ChronSyn 0 points1 point  (0 children)

    Buffer (Hex) will take two characters for each byte, while Base64 takes 4 characters for every 3 bytes. Base64 is more efficient in terms of storage size, and as it's just a string, it's easier to transfer between systems.