阻止列表表(IP、Mac、电子邮件、姓名、用户名)
我正在创建阻止列表,以根据 IP 地址、MAC 地址、电子邮件地址、姓名(名字/姓氏)、商标名称和用户名阻止用户操作。那么,这些表中的每一个都应该是一个单独的查找表,还是可以有一个 block_list 表来包含所有这些表?每个人都是独立于彼此的个体。
该列表将在少数地方使用 ->
用户注册 - 根据 IP、MAC、电子邮件和密码阻止帐户注册任何不允许的名字/姓氏
用户名创建 - 根据受限制的用户名阻止用户名创建
个人资料详细信息 - 根据不允许的电子邮件阻止添加个人资料电子邮件 公共页面 - 阻止人们根据有限的商标名称列表命名页面。
另外,将其保存在数据库中还是文本文件中更好?除商标名称外,其他所有内容均为英文。对于商标,我可能会使用特定于区域的阻止,因此需要多语言支持。
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 one 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会给每个人准备一张自己的桌子。
将它们结合起来如何使您的查询运行得更快?不会的。
这并不是说您不知道自己拥有什么,如果您在块 MAC 地址表中检查了 MAC 地址,那么它将是您的主密钥,该主密钥将被定义为 MAC 的确切正确长度和类型地址。
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.
拥有 1 个包含所有值并有一列 - block_type 的表怎么样?您将需要一个 block_type 的查找表,其中 1=IP。 2 =MAC,...这是您只需 2 个表即可管理的。但我会让更专业的人来回答这个问题,因为我是数据库新手。
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.
您可以将所有条目放在一个表中。查看实体-属性-值方法或使用无模式 NoSQL 数据存储。
http://en.wikipedia.org/wiki/Entity-attribute-value_model
如果您正在中间层处理“阻塞”,则可以将列表作为序列化对象(例如 JSON)转储到表中。
You can put all the entries in a single table. Check out the Entity-Attribute-Value approach or use a schemaless NoSQL datastore.
http://en.wikipedia.org/wiki/Entity-attribute-value_model
If you're processing the 'blocking' in the middle tier, you can just dump the lists as serialized objects (e.g. JSON) into the table.