[Asterisk-Dev] Perl AGI + MySql Audio

Steven Critchfield critch at basesys.com
Tue Nov 23 18:13:18 MST 2004


On Tue, 2004-11-23 at 19:50 -0500, Tim Mattison wrote:

> Also, an intelligent database will store BLOBs efficiently.  Maybe MySQL
> isn't that smart but PostgreSQL does a great job of it.
> [/opinion on BLOBs]
> 
> Unfortunately I'm not sure that using BLOBs makes complete sense in this
> application but maybe I don't understand it fully.  If you really want
> to use large objects in a DB I highly recommend PostgreSQL.  I think
> that in order to do what you want to do you'll need to write your own
> app_record that uses your database's native API.  Well, at least I'd try
> doing it that way to avoid as many intermediate steps as possible.

While I feel anyone doing real DB work on an open source DB should be
using postgres over mysql anyways, I still think it is a bad idea to
store files in a DB. 

The big problem is still that it requires you to store data via a
protocol that isn't meant for file sharing. If you are doing it on the
same machine as asterisk, you are essentially copying through a
inefficient protocol from the drive to the same drive and getting
nothing but inefficiency. 

It doesn't take very much work to create a function to store and read a
file that has been hashed with something like md5 to a directory and
store the md5 into the database. At that point your file manipulations
are very quick, your database activity is very quick, and your potential
for corruption by having a hiccup in the middle of a store into the DB
is greatly reduced. Not to mention if you use the md5 of the recorded
file, you then have another way to verify the file hasn't been
corrupted. 

-- 
Steven Critchfield <critch at basesys.com>




More information about the asterisk-dev mailing list