Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggPS3-0000MM-RN for pgsql-general@arkaria.postgresql.org; Mon, 07 Jan 2019 07:35:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ggPS2-0001Fj-2Q for pgsql-general@arkaria.postgresql.org; Mon, 07 Jan 2019 07:35:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggPS1-0001Fc-Nk for pgsql-general@lists.postgresql.org; Mon, 07 Jan 2019 07:35:57 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ggPRy-0003zB-2Z for pgsql-general@lists.postgresql.org; Mon, 07 Jan 2019 07:35:56 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id x077Zi59012628 for ; Mon, 7 Jan 2019 09:35:49 +0200 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id x077Zim1059880 for ; Mon, 7 Jan 2019 09:35:44 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: Use bytearray for blobs or not? To: pgsql-general@lists.postgresql.org References: <07d16f3f-0352-7802-ef1c-bd9987ec623b@matrix.gatewaynet.com> From: Achilleas Mantzios Message-ID: <6caac6d7-d2e7-0c21-a7fe-c6bd4a4a0557@matrix.gatewaynet.com> Date: Mon, 7 Jan 2019 09:35:44 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-25.0 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL,DYN_HAM_SIGNAT1,DYN_SPAM_SUBJ autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 4/1/19 6:02 μ.μ., Rob Sargent wrote: > > On 1/4/19 4:48 AM, Achilleas Mantzios wrote: >> On 4/1/19 1:41 μ.μ., Thomas Güttler wrote: >>> Some months ago I wrote a little application with Python+Django which stores >>> blob data in bytearrays. >>> >>> It works. >>> >>> In the future there will be a lot more traffic, and I am unsure >>> if this is really a good solution. I know this is more FUD than >>> concrete PG issue. >>> >>> What do you think? >> >> Performance (at least for JDBC) is known to be better with blobs. > > Do you have any details on which part is slower with bytea? Original insert, read back to client, general (p)sql access.  I'm moving towards bytea but still have time to change my mind if I cannot > afford the performance hit. No since I never used them (blobs) in production. Basically the java driver does not support streaming. So for very large data (e.g. videos, movies, etc) people use blobs. > >> However, with bytea life is just easier for many reasons (backups, logical replication, other types of replication, sys management, etc). > Yes, and in my case I even get a cheap compression from the original file. >> >>> >>> Which alternatives could be useful? >>> >>> Regards, >>>   Thomas >>> >>> >>> >>> >> >> > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt