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

How do you deal with polymorphism in a database?

Take a look at Martin Fowler’s Patterns of Enterprise Application Architecture: Single Table Inheritance: When mapping to a relational database, we try to minimize the joins that can quickly mount up when processing an inheritance structure in multiple tables. Single Table Inheritance maps all fields of all classes of an inheritance structure into a single … Read more

What’s The Best Practice In Designing A Cassandra Data Model? [closed]

For me, the main thing is a decision whether to use the OrderedPartitioner or RandomPartitioner. If you use the RandomPartitioner, range scans are not possible. This means that you must know the exact key for any activity, INCLUDING CLEANING UP OLD DATA. So if you’ve got a lot of churn, unless you have some magic … Read more

Should I use a single or multiple database setup for a multi-client application? [closed]

I usually add ClientID to all tables and go with one database. But since the database is usually hard to scale I will also make it possible to run on different database instances for some or all clients. That way you can have a bunch of small clients in one database and the big ones … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)