I m working on a project management app, where every company (which uses our app) will have a personal subdomain: company.domain.com. For many reasons I decided to use a separate database for each company.
公司可以邀请人们(通过电子邮件)共同开展项目工作。 用户可以归属多个公司(应当出现在多个数据库中)。 但是,用户数据以及日志信息储存在一个缝合器中,因为用户使用相同的用户名称、每个公司的密码及其第一名称,每个公司的名称相同。
What I do now, is the following:
- there exists a separate database with: users, identities (user_id, username, password).
- there also exists a users table in every database of each company, containing the same data about the user (actually only 3 fields: first name, last name, time zone).
Is there a better solution for this? If you have questions about the question :) please ask.
I m 采用php + mysql。