[Cialug] 2Blob || !2Blob
Matthew Nuzum
newz at bearfruit.org
Sun Oct 9 11:35:30 CDT 2011
Another pro: as your app scales, if you end up with multiple front end
servers then you only have one service to share, vs using nfs or similar.
A con, related to that: if you are serving media for a web app, then you
have to make a dynamic request every time it's served.
My rule of thumb is that I'll use DB storage if it makes things less
complex, the files are relatively small and my app can deal with the fact
it's making a request each time (or maybe because they change offten enough
they caching is not going to happen much anyway).
If the content is highly static you may want to also consider putting the
files on a remote server using FTP or maybe s3.
On Saturday, October 8, 2011, Zachary Kotlarek <zach at kotlarek.com> wrote:
>
> On Oct 8, 2011, at 5:01 PM, Kevin C. Smith wrote:
>
>> Any thoughts on the subject of storing binary data in an
>> RDB (PostgreSQL in this case)?
>
>
> The pros:
> Atomicity, integrity, etc. -- all the stuff you expect from an RDB
> Keeps all your data in one place, so it's easy to back up or
migrate
> Can use DB permissions to control access (can be important in
shared hosting)
> No need to synchronize with or teach your program about the
filesystem
>
> The cons:
> Poor space efficiency
> DB is loaded to do filesystem things
> Need to be careful to avoid slowing down normal queries (ensure
your DB engine/indexing/partitioning keeps blobs separate)
> Slow file access compared to the normal file system
> No way to manipulate files out-of-band
>
> IMHO there's no hard rule one way or the other. If performance and space
efficiency aren't big concerns using the DB can make things easier just by
keeping everything in the same bag. But there are advantages to letting the
file system do things the file system is good at, as long as you're prepared
for the increased effort required to maintain synchronization among the DB
and file system.
>
> Zach
>
>
--
Matthew Nuzum
newz2000 on freenode, skype, linkedin and twitter
♫ You're never fully dressed without a smile! ♫
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cialug.org/pipermail/cialug/attachments/20111009/db40c4b2/attachment.html>
More information about the Cialug
mailing list