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

From: Enrico Weigelt
Subject: Re: BLOB's bypassing the OS Filesystem for better Image loading speed?
Date: ,
Msg-id: 20050511232623.GE6485@nibiru.borg.metux.de
(view: Whole thread, Raw)
In response to: BLOB's bypassing the OS Filesystem for better Image loading speed?  ("")
Responses: Re: BLOB's bypassing the OS Filesystem for better Image loading speed?  (PFC)
List: pgsql-performance


*  <> 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:     
---------------------------------------------------------------------
  Realtime Forex/Stock Exchange trading powered by postgresSQL :))
                                            http://www.fxignal.net/
---------------------------------------------------------------------


pgsql-performance by date:

From: Bruce Momjian
Date:
Subject: Re: Intel SRCS16 SATA raid?
From: Alex Stapleton
Date:
Subject: Re: Partitioning / Clustering