为不同组织组织数据数据库的最有效方法
所以这更多的是一个理论问题。我对数据库相当陌生,但这是我的问题。我有一个网站,其中的用户将分为不同的组织。这些组织彼此无关,我想将它们全部存储在单独的数据库中吗?不同的表?或者将它们存储在相同的数据库和表中,并用列来指定它们属于哪个组织?目前正在使用 SQLite,但愿意迁移。
So this is more of a theoretical question. I am fairly new to databases, but here is my issue. I have a website which has users which will be divided up into different organizations. These organizations have nothing to do with each other, would I want to store them all in separate databases? different tables? or store them in the same databases and tables with columns to specify which organization they are a part of? Currently using SQLite but willing to move.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你基本上有两个选择。
1#:
将所有内容保存在一个数据库中,向表中添加其他字段以及一些逻辑来决定谁有权访问什么内容。缺点:这会很混乱,优点:将数据从一个组织传输到另一个组织时遇到的问题会更少。
2#:
为每个组织创建一个全新的数据库。缺点:在组织之间传输数据时需要更多的数据传输,优点:逻辑和数据混乱少得多。 :)
我更喜欢第二种选择。但有很多软件都是在构建时考虑到第一个选项的。
You basically have two options.
1#:
Hold everthing in one database, add additional fields to your tables and some logic to deceide who has access to what. Cons: That will be a mess, Pros: you will have less issues when transferring data from one organization to another.
2#:
Create a fresh new database for each organization. Cons: More data transfer needed when transferring data between organizations, Pros: Far less logic and data mess. :)
I would prefer the second option. But there is a lot of software out there which was build with the first option in mind.