Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 872C69FB9CD for ; Thu, 12 Apr 2007 10:42:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 62995-01-5 for ; Thu, 12 Apr 2007 10:41:59 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.231]) by postgresql.org (Postfix) with ESMTP id 613FC9FB9E3 for ; Thu, 12 Apr 2007 10:42:05 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 70so481209wra for ; Thu, 12 Apr 2007 06:42:04 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PHNPSlOChN48tDQ9NUBW0d88Q2j9yeeY+ev5/mDb5RJQG0Tj9EUpxaHi3H5oUZC+VD36WMlhB99UaGD37L1lr0JXAgmFQagvyg6TwSHtsIy9+n3PJl3PIBB4EFc8MToOlscoHwsXqv3YPjAM+242Y813e/D+rtCbpzwF7/0THTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NLUK2ij1GNYUa3J/1SSUx85h6KCYj9IjxvVmlRFQ5yor5ujDv8nBi/W7dIVHAh9A2iUfGZ3xir11TV3gjnEmHCfpjVefmSijaY6MpTLXA4JwCi8SmKkZbcs1SnH5kcLu4CLOYmyWKkIiLEG0wRVRomdIMlENL0PeHS0RY0osguk= Received: by 10.78.193.19 with SMTP id q19mr349471huf.1176385323541; Thu, 12 Apr 2007 06:42:03 -0700 (PDT) Received: by 10.78.35.18 with HTTP; Thu, 12 Apr 2007 06:42:03 -0700 (PDT) Message-ID: Date: Thu, 12 Apr 2007 09:42:03 -0400 From: "Merlin Moncure" To: "Alexandre Vasconcelos" Subject: Re: Large objetcs performance Cc: pgsql-performance@postgresql.org In-Reply-To: <26551fb50704040703n75d9b8d9p7ab4bf11109dfe63@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <26551fb50704040703n75d9b8d9p7ab4bf11109dfe63@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/251 X-Sequence-Number: 24128 On 4/4/07, Alexandre Vasconcelos wrote: > We have an application subjected do sign documents and store them > somewhere. The files size may vary from Kb to Mb. Delelopers are > arguing about the reasons to store files direcly on operating system > file system or on the database, as large objects. My boss is > considering file system storing, because he is concerned about > integrity, backup/restore corruptions. I'd like to know some reasons > to convince them to store these files on PosgtreSQL, including > integrity, and of course, performance. I would like to know the file > system storing disadvantages as well. This topic actually gets debated about once a month on the lists :-). Check the archives, but here is a quick summary: Storing objects on the file system: * usually indexed on the database for searching * faster than database (usually) * more typical usage pattern * requires extra engineering if you want to store huge numbers of objects * requires extra engineering to keep your database in sync. on postgresql irc someone suggested a clever solution with inotify * backup can be a pain (even rsync has its limits) -- for really big systems, look at clustering solutions (drbd for example) * lots of people will tell you this 'feels' right or wrong -- ignore them :-) * well traveled path. it can be made to work. Storing objects on the database: * slower, but getting faster -- its mostly cpu bound currently * get very recent cpu. core2 xeons appear to be particularly good at this. * use bytea, not large objects * will punish you if your client interface does not communicate with database in binary * less engineering in the sense you are not maintaining two separate systems * forget backing up with pg_dump...go right to pitr (maybe slony?) * 1gb limit. be aware of high memory requirements * you get to work with all your data with single interface and administrate one system -- thats the big payoff. * less well traveled path. put your r&d cap on and be optimistic but skeptical. do some tests. merlin