A
A
Artyom Beloborodov2019-08-19 12:07:25
Database design
Artyom Beloborodov, 2019-08-19 12:07:25

How to properly organize the storage of users in the database?

There are three types of users:
- visitors
- speakers
- exhibitors
Each type has its own set of fields and logic.
- Visitors register, mark events of interest, in fact everything. They register themselves, if they can recover the password.
- Speakers participate in events, for the most part they are added not by themselves, but by their agents. There may sometimes be duplicates that are fixed.
- Exhibitors are also added by their agents, essentially just as public representatives.
In the future, an application is planned in which all three categories will be able to communicate with each other. Those. single point of entry.
Problem-Question:
Now all three categories of users are stored in different tables and, in fact, these are different models.
In general, everything is clear except for the stage of connecting all three entities to organize a single entry point to the application. How to eliminate potential duplicates and make a selection of three tables.
If all types of users are combined and stored in one table with additional fields, then the question arises of the logical separation of business processes and the complexity of adding new users by agents, if there are any.
How would you design the storage of three heterogeneous entities that require a single identity for authorization?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Алексей Уколов, 2019-08-19
@alexey-m-ukolov Куратор тега Laravel

Для этого есть готовый механизм: Custom Guards.

трех разнородных сущностей, требующих единого идентификатора для авторизации?
Если вам действительно нужен единый сквозной идентификатор, то проще всего использовать одну таблицу регистраций + N таблиц профилей (по одной для каждого типа).
Как устранять потенциальные дубли и делать выборку по трем таблицам.
This is highly dependent on the logic and requirements of the application.

S
Stalker_RED, 2018-01-21
@bogomazov_vadim

Maybe write a task queue already , and pull them through setInterval? Or a chain of promises , if the delays are not just on a timer.
Another version of the queue, with the removal of completed tasks https://jsfiddle.net/qtmqxv5q/1/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question