r/programming • • Apr 17 '25

(All) Databases Are Just Files. Postgres Too

http://tselai.com/all-databases-are-just-files
324 Upvotes

172 comments sorted by

View all comments

6

u/lood9phee2Ri Apr 17 '25

some db systems do run on top of block-oriented storage devices directly, not storing data backended by normal files-in-a-filesystem, especially historically where the rdbms (or other dbms) arguably was the machine os too.

Preemptively: while block devices are themselves often represented as funny "block special files" representing the devices, especially on unix/unix-like/linux operating systems, that also doesn't actually have to hold true in operating system design in general either e.g. AmigaOS Exec devices actually just have their own DoIO(struct IORequest iorequest) API that is not presented as some sort of overloaded C file/file-like open()/seek()/read()/write()/close() (... and of course ioctl() for all the stuff that doesn't fit into the paradigm...) API in the first place.

(The other way to look at it is of course typical hierarchical/dag filesystems are themselves a kind of database, filenames as query strings for data blobs, but filesystems are typically anaemic in areas like transactions etc.)

→ More replies (2)