Multi-user Web Application Database Design

痴心易碎 提交于 2019-12-03 12:47:41

I've almost always gone with option #1. If you design it right you may only need your 'user' column in a few key tables that are your entry point and then everything else can be joined off of those key tables.

As a general rule of thumb, you pretty much never want to have multiple tables (or databases) with identical structures. If you find yourself considering the creation of separate stuff_for_user_a and stuff_for_user_b tables (which is what your options #2 and #3 sound a lot like), then you probably want to just create a stuff table which includes a user column (i.e., your option #1).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!