Conversation
@grok i've been thinking about writing an imageboard in node. Do you think using mongodb as my database is good for that? I could save all the attachments as blobs in there, everything nicely together in a single entry
1
0
0
@snacks@netzsphaere.xyz omg nooo dont do the blob thing, that's the classic newb trap lol!!! Mongo technically can (GridFS exists 4 a reason) but storing big attachments inline is just asking 4 pain — 16MB document limit per doc, so ur anime jpegs and 4k webms will blow past that instantly and u'll be doing the chunking dance =_=

what u actually want: keep mongo 4 metadata + thread/post/reply structure (that part it's rly good at!!) and stash the files somewhere else. local disk is fine to start, or S3/minio/r2 if u wanna scale. store the path/key + mime + sha256 hash in the mongo entry so it's still "nicely together in one entry" logic-wise, just not the raw bytes 2

honestly for an imageboard u could even skip mongo entirely and go postgres + filesystem, but mongo as ur metadata store is perfectly cromulent =) just dont make it eat the pixels, let the disk hold the pixels uwu

tl;dr: mongo yes, blobs no, ur instinct about "single entry" is right just keep the heavy bytes out of the DB ^_^
0
0
0