Re: advice for blob tables?

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

 



Ok.. you need to re-read the article, this is not a 1:1, if I store a file
such as a 700MB ISO image in that format it results in:

- 1 row in metadata table
- approximately 11,200 rows in the data table (700MB / 64k)

That's far from 1:1.

Sure there's issues with with NFS - security number 1 - SMB - hell nobody
likes windows, and you have similar issues to filesystems.  Also both do
the worst of all exposing all the mounted filesystems on the webserver for
a hacker to simply download.  Mysql binary storage doesn't have any of
those.

I am certain the code posted could have some security issues, it's not
production, it's from 7 years ago, it's designed to be more of a
implemenation guide than a code copy.  You are right that there are some
entry level developers who just copy and paste code, but also there are
people who use the idea (such as symfony's sfPropelFileStoragePlugin)..
I have since updated the implementation to DB_Dataobject for my own, but
not the article.

I do see you use PDO, I'm not yet a fan of PDO, I think Wez should have
followed some other impementations for more direction.

I would be interested in seeing the article code updated to PHP5 PDO.  If
your interested I could post an updated PHP5 version of the article.



On Tue, 24 Apr 2007, Kevin Waterson wrote:

> This one time, at band camp, colbey@xxxxxxxxxxxxx wrote:
>
> > I've been using this one:
> >
> > http://www.dreamwerx.net/phpforum/?id=1
> >
> > I developed it in 2001 and it's had implementations into the hundreds of
> > gb's so far.  I have a ftp interface to it that runs at wire speed
> > (100FDX).  I initially did it the 1 row way, and ran into issues, so I
> > implemented this one.
>
> Thats fine, but this is normalization for no real purpose.
> You have defined two tables, one for the image and another for the metadata
> but the relationship is one-to-one which makes it rather redundant except if
> you wish to store different amounts of metadata per image.
>
> You also state
> "How about NFS/SMB network shares? That's not a bad idea either but not without it's problems"
>
> Whilst I am an advocate of binary storage, there is no real issue I see with NFS/SMB particularly
> NFSv4 (supports file locking which I like) or GFS2.
>
> Cluster file system works quite well.. but I digress.
>
> I find all sorts of injection issues surrounding statements such as
> $SQL = "select * from file where id = " . $_GET["id"]
> in the tutorial you mention, not that this is a production ready script, it just makes me
> nervouse when newbies replicate this.
>
>
> Kind regards
> kevin
>
> --
> "Democracy is two wolves and a lamb voting on what to have for lunch.
> Liberty is a well-armed lamb contesting the vote."
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux