469,641 Members | 1,534 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,641 developers. It's quick & easy.

using Postgres to store many small files

I am currently working on a Java web application in which we are making
use of the JDBC driver for Postgres 7.4.1. Part of our application
allows the administrators to manage a large number of small images,
most of them not exceeding 5KB. There is about a gigabyte of these
small files. We're currently storing the files on disk and the other
information about the file in the database (historical reasons that I
won't complain about here).
I recently discovered the Hibernate project and was pleasantly
surprised how simple it was to store an image in Postgres as a bytea
using Hibernate's BLOB support. I'm wondering if Postgres would have
any problem handling all of our files if we were to put them into
Postgres as bytea data. And how well would Postgres scale as the
number of files increased?
Our Java application and Postgres are currently running on the same
machine, a dual Xeon 2.6Ghz with 1GB of RAM. We are currently not
working this machine very hard at all.
Thanks,
-M@
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
1 5941
On Thursday 04 March 2004 01:03, Matthew Hixson wrote:
[snip]
I recently discovered the Hibernate project and was pleasantly
surprised how simple it was to store an image in Postgres as a bytea
using Hibernate's BLOB support. I'm wondering if Postgres would have
any problem handling all of our files if we were to put them into
Postgres as bytea data. And how well would Postgres scale as the
number of files increased?
PG itself cares nothing whether the data is text or bytea - it won't be able
to compress the data much presumably (if they are GIF/JPEG). The only issue I
can think of is that you will have to access these images through PG rather
than the filesystem - worth checking there aren't any little utilities
relying on that.
Our Java application and Postgres are currently running on the same
machine, a dual Xeon 2.6Ghz with 1GB of RAM. We are currently not
working this machine very hard at all.


More RAM might be an idea - it's not expensive. Also - consider whether this
will have an impact on your backup plans.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sam | last post: by
1 post views Thread by Anthony Ewell | last post: by
48 posts views Thread by Edwin Quijada | last post: by
3 posts views Thread by warwick.poole | last post: by
16 posts views Thread by Michal Hlavac | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.