How to implement multiple users subscription plans without multi tenancy?

Hey all,

I’m working on a project that is considering user count based subscription plans. The development is fairly far along and was not built with multi tenancy in mind. At this point, it really is not an option.

So, outside of multi tenancy, what are some other solutions to this problem? I have some ideas around using a combination of roles, a has many through relationship between the master user and sub users, and a count attribute, however, I feel like this is not the best solution.

Has anyone fought something similar before? I would love to hear some other approaches and how they fared over time.

Thanks!

I believe the situation you’re describing is multi-tenancy regardless of how you implement it behind the scenes.

Perhaps you could clarify what you mean by “At this point, it really is not an option”. In other words, what specific implementation, association, foreign key, etc. are you trying to avoid?

Multitenancy is a method of data segregation where records are siloed under some form of parent identifier, usually across multiple databases, or in the case of Postgres, multiple schemas.

Multitenancy is definitely not a requirement for multi-user style account management but is certainly one option for implementation.

To clarify it is not an option… This a client’s application that was built prior to my involvement and whose architecture is built out from the good ol’ trusty, rusty single Devise User model. A change such as subdomain based multitenancy, which is what I would normally use, is not practical because:

  1. The app has active users. Recreating their data under a multitenancy configuration is outside the budget and frankly, something I don’t want to manage.
  2. Some features depend on the the existing routing and URLs such that a change would be time consuming (aka manual) and thus outside the budget.
  3. SSL’s have already been purchased and multitenancy would require a new wildcard SSL, which is… outside the budget.

So, no multitenancy, period.

I have some ideas on how I would roll up the functionality but was really hoping for a couple “been there, done that” war stories from some of the thoughbot crew.