HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Question on Design for User + User Groups + User Types + Subscriptions Model

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
groupsuserdesignmodelfortypesquestionsubscriptions

Problem

I am redeveloping an existing web application with both weak source code and a weak underlying database design. I'm trying to develop things in a way that future expansion will be much easier, namely:

  • Supporting new login mechanisms



  • Supporting new user types (ie new subscriptions plans)



  • Supporting new user roles



Here are a few screenshots of my unfinished schema. Do you see any problems / data inconsistencies that could arise from this design?

Orange squares are primary keys, and blue squares are foreign keys. Had to split this up into two images.

Users / Subscriptions / Auth Groups:

User Groups / Subscription Types:

Thanks in advance!

Solution

I think you overdid normalization:

  • I dont see the purpose of the user_names table, i would store the names in the user


table

  • Same for basic_user table, i would store the email and password in the user table as well



  • A subscription can have multiple statuses? if not i would put id_status in the subscription table

Context

StackExchange Database Administrators Q#1192, answer score: 5

Revisions (0)

No revisions yet.