Map out the database schema for a SaaS app
About the framework
USER, ORGANIZATION, MEMBERSHIP, PROJECT, and SUBSCRIPTION are the five entities. Membership holds user_id, org_id, and role, allowing the diagram to represent a user’s role within an organization. Projects and subscriptions also carry org_id. Each entity has a UUID primary key.
The relationships show users and organizations with zero or more memberships, organizations with zero or more projects, and exactly one subscription per organization. The subscription includes stripe_id, status, and expires_at; the organization also has a plan field. The Stripe field is a model entry, not a working billing connection.
Before implementation, decide how invitations, duplicate memberships, free organizations, and subscription history should work. Define how organization plan and subscription status remain consistent, and specify authorization separately from the diagram.
What's included
SaaS App Database Schema
✦ Free preview · Sign in to use
Frequently asked questions
The drawn User-to-Membership relationship allows multiple membership records. Each membership links that user to an organization and carries a role.
The sample draws exactly one subscription per organization. Change the relationship if your model allows an organization before billing is set up.
The diagram records ownership relationships. It does not implement authorization or access policies; those rules must be designed and enforced in the application and database as appropriate.
Free to start. No credit card required.