Should sites be registered in a separate table for active users?

I’m interested in learning about the best user registration practices. I tend to store site registrations in a separate registration table, and then, as soon as the registration is confirmed by e-mail, transferring data to the users table.

The advantage of this is that reading from the user table does not clutter up the ever activated registrations. Another advantage is that the email field (username) can remain unique in the user table, but if you try to register with an email address that you do not have, the owner of this email address can still register it as an email field mail will not be unique in the registration table.

I am wondering if this is common practice or if there is any reason, is this not a good idea?

+3
source share
5 answers

Activated or not

. , , , . cron, , , x , .

Email

, , ? , , - , ? . , , , , , , .

, ?

, , , .

. , , , , , .

+1

, .

SQL- ( ), 30 .

+1

. , ( 3 ).

. .

+1

, : . , , , , , , , ..

, NOT NULL.

, ; . - , . , .

+1

: " " " " .

" ". ( ), "output" " ". (, "-" , 1 ), " ".

As another answer said, in some cases this may be related to engineering, but it can also be a useful way to encapsulate the complexity of these two separate concepts. It can also be seen as contrary to the principles of normalization, but I suggest that you need to choose the tradeoff between encapsulation and normalization depending on your context.

-1
source

Source: https://habr.com/ru/post/1708564/


All Articles