Optimal data architecture for tagging, clouds, and searching (like StackOverflow)?

Wow I just wrote a big post and SO choked and hung on it, and when I hit my back button to resubmit, the markup editor was empty. aaargh. So here I go again… Regarding Stack Overflow, it turns out that they use SQL server 2005 full text search. Regarding the OS projects recommended by … Read more

Relational vs. Dimensional Databases, what’s the difference?

A star schema really lies at the intersection of the relational model of data and the dimensional model of data. It’s really a way of starting with a dimensional model, and mapping it into SQL tables that somewhat resemble the SQL tables you get if you start from a relational model. I say somewhat resemble … Read more

What’s the best way to store changes to database records that require approval before being visible?

Definitely store them in the main table with a column to indicate whether the data is approved or not. When the change is approved, no copying is required. The extra work to filter the unapproved data is the sort of thing databases are supposed to do, when you think about it. If you index the … Read more

Database Architecture for “Badge” System & Arbitrary Criteria (MySQL/PHP)

Given that the badge criteria can be arbitrarily complex, I don’t think you can store it in a database table broken down into “simple” data elements. Trying to write a “rules engine” that can handle arbitrarily complex criteria is going to take you down the path of basically re-writing all the tools that you have … Read more

What is the best way to manage permissions for a web application – bitmask or database table?

I think it’s a general rule of thumb to stay away from mystical bitstrings that encode the meaning of the universe. While perhaps clunkier, having a table of possible permissions, a table of users, and a link table between them is the best and clearest way to organize this. It also makes your queries and … Read more