by statico · 5y ago · 0 comments
I'm happy to pay $1/mo, but when I tried to upload https://camo.githubusercontent.com/9ec8d13de2878c899fda0bd43... I got this, which doesn't look like what I uploaded: https://cln.sh/4coS9T / https://imgz.org/i5qphFzd.gif
EDIT: This is very odd, I'm not really doing any processing on the uploaded files, so it should definitely return the originals. I will have this fixed soon though.
EDIT2: Unfortunately, the saved image in the DB itself is corrupt, so you will need to reupload after I solve this.
EDIT3: Alright this should be fixed! Now I can start submitting animated GIFs there.
EDIT4: Ironically, now ONLY animated GIFs work, because 2am is when I do some of my best work. Stand by...
Whoa now... you're putting images in the database?
Most (all?) large-scale high-volume image storage architectures I'm aware of do not store billions of images as blobs in a database. Instead, they typically store the images as files. The database only holding metadata info and a pointer to the image filename location (or url if using AWS S3 or CDN).
E.g. Facebook is one of the largest MySQL sites (if not the largest) and they don't store photos directly in MySQL.
Binary data in databases is usually not a great idea, but tolerable in low amounts.
I can't imagine storing images in a database, you're probably better off with a document store.
Relational Databases (well, the ones that I know the internals of) tend to have soft limits on row sizes, in PostgreSQL this is 8kb (which is very small for an image); to overcome this limitation Postgres uses what they call a TOAST table, which forces compression by default, which absolutely crumbles on binary data.
https://www.postgresql.org/docs/13/storage-toast.html
But, if it works, I'm not complaining- and I'm very certain that other such sites have worse architectural flaws in the beginning- this one is pretty easy to overcome if it becomes an issue and can be alleviated with aggressive caching of CDNs/varnish to buy you time if there's immediate issues. :)
But yes, there's probably time for that optimization later, if the service takes off.
and the uploaded image was a negative of it.
it resulted in https://imgz.org/i5Q2gzwB.png
If you are willing to pay for things, then any good old web host + FTP are your friends.
Also faster than uploading to the cloud, and then having the other party download it.