this post was submitted on 24 Oct 2023
22 points (100.0% liked)
Programming
13368 readers
1 users here now
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You're assuming the file system overhead is smaller than the overhead of a database stored on the file system, and that's a pretty bold statement.
The issue isn't storage and retrieval, it's search, it always has been. Your comment being a document or not isn't the hard part or the expensive part. Associating your comment with the post, comments, and likes is where the hard parts come in.
Yeah, you could make every comment a document of sorts and store each one as a file and add an index that points to the files, but you'd be introducing a bunch of overhead caused by the file system.
It's kind of a similar idea for why you don't store a movie as a directory with a picture for each frame. You absolutely could, but there are very good reasons not to do so.
Database are just hyper optimized versions of "storing documents." I think you're severely overestimating the cost of moving a few bits around to change how data is represented.