On 9/15/05, Bob Showalter <[EMAIL PROTECTED]> wrote:
> Peter Rabbitson wrote:
> > * I store dirty orders as XML in a SQL table with 2 columns - one for
> > the order id and another for the arbitrary XML structure. Problem once
> > again is that my XML can be thousands of characters long.
> 
> I vote for this option. You can use a TEXT or MEDIUMTEXT column to store
> this data (Unicode, UTF-8).
> 

That would be my chocie, too, just because the a straight 'select *'
on the table then produces human-readable output when it's so messed
up the web interface has trouble parsing it.  From a performance
standpoint, though, there's no reason to prefer XML stroed as text to
Data::Dumper output stored as as a blob.

Another option if length is an issue is to store the XML or
Data::Dumper output to an external file and just store the filename in
the DB. It will take up less space on disk--no DB overhead--and the
additional I/O is negligible (in some cases it may actually be more
efficient, depends on your system), especially for a small number of
requests. The only drawback is that you'll have to be careful about
file locking with the human cleanup interface to make sure that two
people don't try to clean the same file at the same time and munge it.
If you Text or Blob the data you can just use a transaction-safe table
and rollbacks. That's not a big loss, though: writing perl code with
e.g. flock is simpler than writing transaction-safge SQL, IMHO.

HTH,

-- jay
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.dpguru.com  http://www.engatiki.org

values of β will give rise to dom!

Reply via email to