Multi-user Web Application Database Design

前端 未结 2 1757
耶瑟儿~
耶瑟儿~ 2021-02-08 13:21

I\'m working on a web application that will be a hosted, multi-user solution when it is finished. I\'m trying to figure out the best way to handle the database design for my ap

相关标签:
2条回答
  • 2021-02-08 13:44

    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).

    0 讨论(0)
  • 2021-02-08 13:54

    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.

    0 讨论(0)
提交回复
热议问题