Database design for storing PDF's in Rails -
i working on application allow me upload pdf files , display them when user clicks on it, website http://www.rangairemfg.com/products
i cant decide if store pdfs in database, or if should store them on filesystem , link them through database.
i know paperclip way of doing second option. have suggestions or better way of doing this?
the paperclip option better. can store file in database blob field if want to, adds little value , clog db connection due volume of data being transferred. use database purpose designed for: joining tables of information , getting extremely fast results can load pages quickly. unless don't care slowing db down, should use file system storing files.
paperclip integrates nicely s3, both cheap , reliable. way, user can click link , have new page open direct url of s3 file (exactly same site link to) , rest of site unaffected. idea paperclip stores file url in database, returned super-fast, user connects directly s3 slow bit.
Comments
Post a Comment