piresashwin
piresashwin

Reputation: 165

How to Design Optimal Database Design to Handle Subscription And Its Usage

What would be a optimal solution to design database to handle Subscriptions

E.g I have subscription plans which consists of :

How to track the usage and maintain history of the user's subscriptions.
Manage Renewals / Expire Plans

Upvotes: 1

Views: 2145

Answers (1)

Saravanan
Saravanan

Reputation: 7854

You should have the following tables

  1. Customers

  2. Subscriptions

  3. Price plans (references subscription)

  4. Price plan line items (references price plan)

  5. Customersubscriptions (references customers and subscription)

  6. CustomerSubscriptionHistory

  7. Credit types

  8. CustomerCredits (references customer & credit types)

  9. CustomerCreditHistory

  10. Invoice ( reference customer)

  11. PaymentTypes (cash, card, bitcoins etc...)

  12. PaymentHistory (can track failure & success in 1 table)

I have listed the entities based on my understanding, HTH

Upvotes: 3

Related Questions