views:

30

answers:

2

I am creating block lists to block user actions based on IP address, MAC address, Email address, Name (first/last name), Trademark names and Usernames. So should each of these be a separate lookup table or can there be 1 blocked_list table with all these in? Each is individual independent of the other.

The list will be used in few places ->
User signup - block account signup based on IP, MAC, email & any disallowed First/last name
Username creation - block username creation based on restricted usernames
Profile details - block profile email being added based on disallowed emails Public pages - block people from naming pages based on a restricted list of trademarked names.

Also, is it better to keep this in the DB or a text file? Except trademark names everything else will be in english. For trademarks I may use region specific blocking so need multi-lang support.

A: 

I'd make each their own table.

how would combining them make your queries run any faster? it wouldn't.

It isn't like you won't know what you have, if you have a MAC address check in the block MAC address table for it, it would be your primary key which would be defined to the exact proper length and type for a MAC address.

KM
A: 

What about having 1 table with all the values in and have a column - block_type. You will need a lookup table for block_type where 1=IP. 2 =MAC,... This was you can manage this with only 2 tables. But I'll let someone more professional answer this as I am new myself to databases.

kino