The idea of database design in which multiple subsystems share user information?

< H2 > question < / H2 >

there are two independent systems. System An is the class information management system and system B is the book management system.
the current design idea is that system An and system B are divided into two independent business projects, and their databases are also independent, divided into A database and B database.
the only connection between system An and system B is the user information table, that is, the user information in system An also exists in system B.
how can the design of the database be reasonable for the system with this requirement?

< H2 > my thoughts < / H2 >

scenario 1

since both database An and database B have user tables, but their contents are the same, I can develop a separate C system dedicated to the basic information of these Synchronize users.
difficulty: user information Synchronize is too troublesome, always think it is not very good to do so.

scenario 2

separate the user information table into a third database, and check directly across databases when system An or system B needs to access user information.
difficulty: cross-database joint search feels more troublesome--;

< H2 > Summary: < / H2 >

I am not very clear about the specific design ideas, or do I already have a mature solution for this requirement? Ask for advice.

Apr.02,2021

oAuth is just to solve your problem


users make a library and application, which I call pass
table designed as follows
user

ID,...

Login credentials (because there are so many subsystems, it is impossible to use cookie for authentication)

token,created_at,expires_at,user_id,platform(platformABplatform)

the system provides RPC or HTTP interfaces for specific service stations to call. Roughly list of APIs:

  1. registered users
  2. user login
  3. check whether the user's token is valid
Menu