4 ms·
>Yes, it's a database. That's where you're meant to put DATA. Most (all?) large-scale high-volume image storage architectures I'm aware of do not store billion
by jasode 5y ago
>Yes, it's a database. That's where you're meant to put DATA.
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.
- stavros 5y agoI'm joking, but the volume for IMGZ is way too low (and always will be) for data storage to matter.
- jamesjyu 5y agoStill low even after HN surge?
- stavros 5y agoLet me check... TWO more images were added today! At this rate, I'm going to need to buy a whole datacenter by next week. https://imgz.org/blog/2020/12/23/haha-suckers/ https://imgz.org/blog/2020/12/23/haha-suckers/
- gauravjain13 5y agoDon't knock exponential growth!
- ryan-allen 5y agoI like you (and I like storing images in the database). EDIT: I uploaded an image into your database https://imgz.org/i3joC5jC/ https://imgz.org/i3joC5jC/
- toomuchtodo 5y agoMajestic Taco.
- stavros 5y agoThat is an excellent image, worthy of gracing my database.
- matkoniecz 5y agoBTW, https://imgz.org/i9xyk2H2.png https://imgz.org/i9xyk2H2.png is broken and included prominently in https://imgz.org/blog/2020/12/23/haha-suckers/ https://imgz.org/blog/2020/12/23/haha-suckers/ Not sure is it some intentional irony or an actual bug.
- stavros 5y agohttps://imgz.org/i9xyk2H2/ https://imgz.org/i9xyk2H2/
- 6510 5y agoIll take the job.
- jrochkind1 5y agoI understand that postgres is pretty decent at storing large binary data though? I've been meaning to investigate trying storing images in postgres on a hobby web project where it could be convenient; I'd still want to make sure I was streaming bytes from postgres to the client, not loading the whole image into memory and only once fully loaded sending it to the client. Looking at the pg API's for my language/platform of choice, it looked at least plausible to do this with a BLOB.
- Arnt 5y agoPostgres is indeed good at that. I know from experience. If you want to commit ten things every second all week, don't transfer so much data in a single transaction that you hold any important locks for half a minute. And if you use replication, test while replicating. If the blobs you store are small enough to not disturb your commit rate, then pg's drawbacks are IMO smaller than those of the alternatives, particularly if you want some sort of commit that returns when both image data and something else have been committed.
- jrochkind1 5y agoThanks for info! So you've stored images in the db in production and had it work out fine? I don't want to commit ten things a second. It would be a pretty read-heavy write-light load. Sounds like that would avoid one path of riskiness at least.
- Arnt 5y agoYes, exactly. Many people answer a question like this: "How good is postgres at storing big blobs, relative to small things?" Postgres is indeed worse at storing large things. However, I think the most interesting question is something along these lines: "What's best, storing everything in Postgres and accepting that inefficiency for the big blobs, or implementing transactions, replication and/or backup with a part of the data in Postgres and the big blobs elsewhere?" I'm awfully fond of having working backups, and postgres' performance problems with the blobs haven't been big enough that I've really noticed.
- Arnt 5y agoI too do that, in a different context, and it's fine. Databases have problems with big items, but images aren't big in that sense nowadays. The problems relate mostly to backups/copies/reloads, that kind of thing, and copying an image doesn't cause anything to hiccup. A transaction that transferred 1MB over a modem line was a problem, that could block other commits for a long time, on today's networks 1MB doesn't take long.