linux - SQL or filesystem for FAST storing files/BLOBs? -
i have app stores quite lot of publications files on filesystem, using nested dirs "6/0/3/6/....". files not huge (.jpg, .pdf, similar documents), there's "just" lot of them, running gb hundreds. once stored in fs, typically never rewritten, served on http.
searching, versioning through such files painfully slow. copying such dirs rather cumbersome.
this got me thinking: not better store such data blobs in db (my app using postgres various purposes anyway).
which 1 -- fs or scalable sql db -- perform better around? or pg collapse under weight?
incremental backup much easier filesystem. recovering partial damage. versioning pretty easy on top of file system long don't need atomic change sets, individual file versioning.
on other hand, using db gets transactional behaviour - atomic commit, multiple concurrent consistent snapshots, etc. costs disk storage efficiency , adds overhead access. means can't sendfile()
data directly file system, must several memory copies , encoding , send file.
for high performance server file system going win unless need atomic commit , simultaneous consistent visibility of multiple versions.
there lots of related past questions should read too, concerning whether it's better store images in db or on file system.
Comments
Post a Comment