Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denormalization of membership constraint. #7

Open
samchon opened this issue Jan 6, 2025 · 0 comments
Open

Denormalization of membership constraint. #7

samchon opened this issue Jan 6, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@samchon
Copy link
Collaborator

samchon commented Jan 6, 2025

erDiagram
"hub_customers" }|--o| "hub_members" : member
"hub_customers" }|--o| "hub_external_users" : external_user
"hub_customers" }|--o| "hub_citizens" : citizen
"hub_external_users" }o--o| "hub_members" : member
"hub_external_users" }o--o| "hub_citizens" : citizen
"hub_members" |o--o| "hub_citizens" : citizen
"hub_member_emails" }o--|| "hub_members" : member
Loading

Add hub_member_id to all tables in the studio that contain hub_customer_id.

All stories in our ecosystem unfold from hub_customers, which is the unit of human connection, and all entities derived from human actions also have a foreign key column called hub_customer_id. The reason they do not directly have hub_member_id is because of the normalization principle of not recording duplicate or referrable data.

However, because of this, it is difficult to create an index for "sorting", so the page-by-page query APIs may be slow. Therefore, as the first plan for backend performance tuning, we will directly record hub_member_id in the main table of the studio, slightly denormalize the tables existing in the page-by-page query APIs, and realize fast sorting through the index.

Related issue: wrtnio/main#1

@samchon samchon added the enhancement New feature or request label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants