Hamed F
Hamed F

Reputation: 840

General Database Design for Authorization & Authentication Webservice that use in all range of application

See this picture please (My Authentication & Authorization Database Design)

My Authentication & Authorization Database Design

All tables are good! Except USER (USER table have different scenarios in different applications - USER can be Personnel, Employee, ...)

I want to have a web service and a general Authentication & Authorization in one database so I must add a table for ApplicationName and add ApplicationID field to all tables, it's not a problem

But my problem is user table in different applications user table is different

How I can manage user table for general purpose for different applications and different necessaries?

Must I insert all users records of all applications into web service user table?

Upvotes: 2

Views: 6551

Answers (1)

Ultimater
Ultimater

Reputation: 4738

I'd suggest having a centralized table (`accounts` or `users` are good names) which assigns an id to all personnel and employees alike. Then merely reference the user's id in your `personnel` or `employee` tables so you can give each user whatever table structures they need. For easier queries, you can add checkbox-like columns to the centralized table identifying whether the user exists in other tables etc.

Upvotes: 2

Related Questions