Reply to Re: [PHP] Storing serialized data to DB

Your name:

Reply:


Posted by "Richard Lynch" on 12/30/05 22:34

On Tue, December 27, 2005 7:11 pm, Sumit Chachra wrote:
> Not very php specific so please pardon me if I am posting in the wrong
> forum.
>
> I have a chunk of data which I am trying to cache. I serialize this
> data
> using the serialize() function in php. I am wondering what would be a
> good
> attribute type in my DB to store such (potentially long) strings? Some
> types
> have 4000 character limits and hence I get JDBC exceptions. I am using
> Oracle DB.

My first answer would be:

Don't put it in the database. Throw it in /tmp or a disk file
somewhere and put the file path into the database.

If you HAVE to put it in the database, then you'd better:
1. Determine the MAXIMUM size of the serialize($chunk) of data.
2. Double that.
3. Find a data type in your database that is BIGGER than that.
4. The only answer is probably a BLOB.

Internally, the database engine is most likely storing the BLOB as a
separate file anyway, and you're getting very very very little gain
out of putting it into the database. See first answer. :-)

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация