2018-03-27 at 10:35 PM UTC
only if you dont want to retain ownership of them
2018-03-27 at 11:03 PM UTC
aldra
JIDF Controlled Opposition
I don't like to do it because it puts extra load on the database and increases the chances of corruption
depends on the application though I guess - if it's just light duty and small images it shouldn't be an issue
2018-03-29 at 7:59 AM UTC
What's the application? If you're talking about a webserver you expect to be under any kind of load the answer is that you don't. Databases are generally not well optimized for blobs, even when they do support them, if they don't then you fuck your DB's caching and seek tradeoffs hard by storing images. Conversely your filesystem is very good at handling image sized files and apache/nginx/lighttpd takes advantages of this.
Typically you'll want to store files on a disk on the same machine as your web server and store paths or something you can resolve to a path in the DB, at least up to CDN levels of load. After that it changes a bit but storing images in DBs, even sharded ones, isn't what you want. The extra backup effort is well worth it.
2018-03-29 at 8:01 AM UTC
or be a bum like me and say fuck it. fun fact: everyone's avatar will be lost in a single disk failure.
2018-03-29 at 8:05 AM UTC
Dfg
Tuskegee Airman
[compulsively riposte the emigrant]
1) Use database for storing link/url
2) Store them on the harddisk or CDN
And backup shit regularly.
2018-03-29 at 4:34 PM UTC
aldra
JIDF Controlled Opposition
it depends on how much load you anticipate I guess.
S3 is used for storage, Cloudfront is used as a CDN to cache files - having your users access data from the Cloudfront cache is cheaper than having them access S3 directly, but if you're not planning on a lot of traffic it may be more troublesome setting up Cloudfront in the first place.
2018-03-29 at 5:08 PM UTC
Yes. Also be sure to run the server on your PC in your mom's basement, using her connection and no CDN