Flexibility has its uses, but it shouldn't be the ultimate goal.
To make a good product means more than decreasing potential
future modifications. For a software product, there's also a
business interest, and there usually happen to be users as well.
To make a table as flexible as possible, you'd make every column
BLOB, GBLOB or whatever your favourite database has. Then you can
store anything in there, and lots and lots of it!
But it's better to stop and think "why in the heck am I using a database
in the first place"? Because you have valuable data. Data that might
be more valuable than programmer time. People (and programs) need to
access the data, trust the data to be correct, and they need to be able
to access it fast. The stricter the better. If you have an SSN column
of maximal 9 characters, it's not possible to stuff 10 chars in it -
the database will reject it. You can put "gooble" in it, and that's why
a numeric field would be better. Speed can also be an issue. The smaller
a row is, the more fit in a page, and the faster access will be. Also,
the smaller your database is, the faster backups (and not unimportant,
restores) will be. Don't get the idea diskspace is cheap, sure a disk
at your local PC store doesn't cost a lot, but if you have to house it,
mirror it, backup it and pay the person doing all this, the cost no longer
Flexibility is a trade off, and especially with database more flexibility
can easily mean a significant price you have to pay in speed and size.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||