Welcome Guest, Not a member yet? Register   Sign In
Blog Database Structure - Categories & Meta Tags
#25

[eluser]dmorin[/eluser]
Sure you could do it that way, but everything is a tradeoff. Sure it's a little more simple at first, but lets say you want to create category pages. How do you list all of the categories that you've used in your blog? You'd probably have to pull back each entry, explode the categories into a single array and then filter out the duplicates. That isn't very efficient. Or you could just have one table that lists each category you've used, but if you're doing that, you're not really saving a lot of effort by storing them all in one field.

Same probably when someone browses to the category page. How do you pull back all of the posts for a given category? Use a LIKE "% catname%" is the first that comes to mind, but that doesn't scale very well to large numbers of posts (though it would probably perform fine for a single blog). The biggest issue with using like is that you'll find some category names inside others. For example, the category "Cat" would also return posts with the category "Category", etc. unless you used a good delimiter.

So sure, it's an option. But do the costs of doing it the "easy" way really make up for the crap you're going to have to put up with?


Messages In This Thread
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-19-2010, 06:51 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-19-2010, 07:36 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-19-2010, 07:48 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-19-2010, 08:15 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-19-2010, 09:18 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-19-2010, 04:32 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-19-2010, 06:58 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-19-2010, 07:05 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 04-20-2010, 07:11 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-03-2010, 10:11 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-03-2010, 11:54 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-03-2010, 02:05 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-03-2010, 02:30 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-03-2010, 06:01 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-03-2010, 08:42 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-04-2010, 02:02 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-04-2010, 09:58 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-04-2010, 10:10 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-04-2010, 12:05 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-04-2010, 12:21 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-04-2010, 07:05 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-04-2010, 08:38 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-06-2010, 09:17 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-06-2010, 11:50 AM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-06-2010, 12:15 PM
Blog Database Structure - Categories & Meta Tags - by El Forum - 05-06-2010, 02:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB