Dynamic schema tables

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Ambush Commander wrote:The trouble with shuffling around the database schema too much is that it affects everything else that already is in the database. Not too bad if you're just adding a column, but removing and changing columns becomes quite unwieldy when dealing with large datasets.
Agreed, but the question becomes: where is the line for "shuffling ... too much" and when it "becomes quite unwieldy." I think writing a system for dealing with schema changes is certainly manageable -- and in the case that I believe Hockey wants, which is just adding data/search fields, it would be pretty easy.

PS - This is a great warning you who is infamous for tackling programming challenges that most wouldn't touch with a very long barge pole. ;) :D
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Ah, yes, in that light I agree with your sentiments. In that case, I would serialize some sort of representation of the current database schema and stuff it in a flat file for your caching needs. Any code that updates the schema would have to update the cache.
Post Reply