数据库设计需要优化 [英] Need Optimization in Database Design

查看:61
本文介绍了数据库设计需要优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表用两种不同的方法:



GroupModule:

Id,GroupId,ModuleId,Permission(varchar() )

1 1 1查看:true,创建:false,删除:true,编辑:true

2 1 2查看:true,创建:true,删除:true,编辑:false





GroupModule:

Id,GroupId,ModuleId,PermissionId



在第一个例子中,我将创建一个prsing方法,以便我可以为特定组执行授权。



In Second例如我有许可证的



由于这是最重要的表格,因为它用于授权目的,因此对性能非常关注。



在这种情况下最好的方法是什么。

我已经发布了另外两个问题,但我没有收到任何回复,如果你需要,请告诉我更多解释。

解决方
我个人创建用于存储您的权限表。然后是一个表来存储组或用户拥有的权限。我不会将他们的所有权限连接成一个列。


I have a table applied in two different approaches:

GroupModule:
Id, GroupId, ModuleId, Permission(varchar())
1 1 1 View:true,Create:false,Delete:true,Edit:true
2 1 2 View:true,Create:true,Delete:true,Edit:false


GroupModule:
Id,GroupId,ModuleId,PermissionId

In the first example i would have create a prsing method so that i can perform authorization for a specific Group.

In Second example i have permissionid's

Since this is the most important table ,as it is used for authorization purpose, so there is a great concern for performance.

What would be the best approach in this scenario.
I have posted two other questions but i have not recieved any response, kindly let me know if you need more explanation.

解决方案

I personally would create a table for storing your permissions. Then a table to store what permissions either a group or user has. I would not concatenate all their permissions together into a single column.


这篇关于数据库设计需要优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆