Re: Use bytearray for blobs or not?

From: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Use bytearray for blobs or not?
Date: 2019-01-07 07:35:44
Message-ID: 6caac6d7-d2e7-0c21-a7fe-c6bd4a4a0557@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Rowley 2019-01-07 08:08:49 Re: Optimizing the same PREPAREd static query (without parameters)
Previous Message Mitar 2019-01-07 05:53:42 Optimizing the same PREPAREd static query (without parameters)