Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux