Best strategy for multi tenant webapp

Hi There, I’m also looking into information on this topic, In general I would say that we both have a similar scenario, although I still haven’t decided on using a subdomain approach just yet. some of the ideas I have are:

  • Have a Tenants collections that’ll hold the registered tenants.
  • I’m interested on having users that can work with different tenants, yet have different roles on each tenant, for that I think alanning:roles Groups suits my needs. Each tenant would be mapped as a roles group.
  • Tenant scoped collections would be indexed by tenant and publications would use the tenant as part of the query.
  • On the client side, would get the active tenant based on a client variable, session variable(?) or in your case, from parsing the subdomain name in the url?

All pretty straight forward as you may see, but so far, I think that should be about it.

I’ve been looking into meteor docs, particularly Connections, I know you can access the client connection from Publications or Methods using this.connection. So I wonder if I could come up with a sort of ConnectionManager that tracks client connections on a tenant, so I don’t need to pass around the tenant on all my subscriptions and/or method calls or in my case, modify most of my current publications and subscriptions so they handle an extra param. This is still and idea though, I’ll give it a try sometime this week and post my findings if its somehow successful :slight_smile:

If anyone else has more experience on this topic, I’d really like to hear your thoughts/ideas as much as @dtamburr surely does.