Re: Storing Video's or vedio file in DB.

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Storing Video's or vedio file in DB.
Date: 2014-12-17 18:34:40
Message-ID: 5491CCC0.5050807@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/17/2014 4:55 AM, Thomas Kellerer wrote:
> Turns out the Postgres as well isn't really slower at this than the file system.
>
> For small files around 50k both perform similar: the average time to read the blob from a bytea column was around 2ms whereas the average time to read the blob from the filesystem was around 1ms. The test uses 50 threads to read the blobs using the PK of the table.
>
> "Reading from the filesystem" means looking up the path for the file in the database table and then reading the file from the filesystem.
>
> For larger files around 250k Postgres was actually faster in my tests: 130ms reading the bytea column vs. 260ms reading the file from disk.

with videos, we're likely looking at file sizes in the 100MB to
multi-gigabyte range, unless these are just short snippets. I'm not
very familiar with django and python, does it have facilities to stream
a very large record, or does it always transfer the whole thing as a
chunk in memory? Does it have PostgreSQL Large Object support?

Also, serving video via a webserver, this is generally done with a html5
or flash streaming server, where the web application generates the
embedded link to the video, but the video itself comes from said
streaming thing.... those streaming things are less likely to be able
to read a object out of postgres than they are to stream from the file
system.

--
john r pierce 37N 122W
somewhere on the middle of the left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message harpagornis 2014-12-17 19:38:19 Re: SSL Certificates in Windows 7 & Postgres 9.3
Previous Message Alan Hodgson 2014-12-17 17:37:36 Re: Storing Video's or vedio file in DB.