Situation
I am trying to figure out a rating system right now that contains ratings for servers by players. A user would be able to rate a server in several different categories. Maintainability, performance, and compactness of the storage of the ratings are what I am trying to find a balance for right now. Hopefully we can come up with some good solutions to this.
MB required = (bytes per entry) x (500 reviews) x (4000 servers) / (1024) / (1024)
Method 1: Maintainable bridge table
Allows storing of any number of categories, searching is easy, categories are allowed to have additional attributes as specified in their own table. would require 64 different entries to be equivalent to the holding power of the other methods.
[int Server_ID 4 bytes]
[int Account_ID 4 bytes]
[int rating 2 bytes]
[bigint last_updated 8 bytes]
[int category_id 4 bytes]
Total space required: 2929.7 mb.
Method 2: SET column
If storing less than 64 categories, I could have a SET column to act as a bit flag table.
[int Server_ID 4 bytes]
[int Account_ID 4 bytes]
[SET ratings 8 bytes] (probably less)
[bigint last_updated 8 bytes]
Total space required: 45.77mb.
Method 3: Multiple bit columns
I could just use a bunch of different bit columns that have names on them. Maybe use a comment to pull out a description of the category when displaying it in the actual application.
[int Server_ID 4 bytes]
[int Account_ID 4 bytes]
[multiple bit ratings: 8 bytes??? bytes]
[bigint last_updated 8 bytes]
Total space required???: 45.77mb.