-
(I say this not being a prodigy of any sort.) How big is your website? Unless your site is really getting hammered with traffic I can't imagine performance of one table vs. four will really affect you. It's arguably worth having a cleaner design even if it results in a performance hit. Computers and networks are so fast today that you should write the easiest-to-read-and-maintain code possible until such time as you discover a performance bottleneck. Then fix the bottlenecks until things are fast enough again. Premature optimization being the root of all evil etc.
Is the concern clunkiness? Abstract away the clunkiness until it's no longer clunky. Abstract it so you can change the database later if you need to, without changing all the code that relies on the database. If you have raw SQL splattered all over your code, then it might be a hassle to constantly JOIN a billion tables, but you probably have bigger problems than that if you're writing the same SQL over and over. If you have to join four tables to compute some value, so what? Write it once and package the code so you can re-use it.
If you're designing the next Google, then yeah, I've read articles about some of super-huge sites running on flat text files, or simplistic databases with fields full of enormous serialized strings of crap. It's not a sin to have a database that isn't normalized. There's no single right way to do anything.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules