Re: BLOB's bypassing the OS Filesystem for better Image loading speed?

From: Enrico Weigelt <weigelt(at)metux(dot)de>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: BLOB's bypassing the OS Filesystem for better Image loading speed?
Date: 2005-05-11 23:26:23
Message-ID: 20050511232623.GE6485@nibiru.borg.metux.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

* apoc9009(at)yahoo(dot)de <apoc9009(at)yahoo(dot)de> wrote:

Hi,

> My next queststion is dedicated to blobs in my Webapplication (using
> Tomcat 5 and JDBC
> integrated a the J2EE Appserver JBoss).
>
> Filesystems with many Filesystem Objects can slow down the Performance
> at opening and reading Data.

As others already pointed out, you probably meant: overcrowded
directories can make some filesystems slow. For ext2 this is the case.
Instead reiserfs is designed to handle very large directories
(in fact by using similar indices like an database does).

If your application is an typical web app your will probably have
the situation:

+ images get read quite often, while they get updated quite seldom.
+ you dont want to use image content in quries (ie. match against it)
+ the images will be transfered directly, without further processing
+ you can give the upload and the download-server access to a shared
filesystem or synchronize their filesystems (ie rsync)

Under this assumptions, I'd suggest directly using the filesystem.
This should save some load, ie.

+ no transfer from postgres -> webserver and further processing
(server side application) necessary, the webserver can directly
fetch files from filesystem
+ no further processing (server side application) necessary
+ backup and synchronization is quite trivial (good old fs tools)
+ clustering (using many image webservers) is quite trivial

Already mentioned that you've got to choose the right filesystem or
at least the right fs organization (ie. working with a n-level hierachy
to keep directory sizes small and lookups fast).

An RDBMS can do this for you and so will save some implementation work,
but I don't think it will be noticably faster than an good fs-side
implementation.

Of course there may be a lot of good reasons to put images into the
database, ie. if some clients directly work on db connections and
all work (including image upload) should be done over the db link.

cu
--
---------------------------------------------------------------------
Enrico Weigelt == metux IT service
phone: +49 36207 519931 www: http://www.metux.de/
fax: +49 36207 519932 email: contact(at)metux(dot)de
---------------------------------------------------------------------
Realtime Forex/Stock Exchange trading powered by postgresSQL :))
http://www.fxignal.net/
---------------------------------------------------------------------

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Edin Kadribasic 2005-05-11 23:28:25 Re: Optimizer wrongly picks Nested Loop Left Join
Previous Message Alex Stapleton 2005-05-11 22:56:54 Re: Partitioning / Clustering