Multiple clinics as MultiTenant

This forum is for programmers who have questions about the source code.
Post Reply
SriramChellappan
Posts: 42
Joined: Thu Mar 11, 2021 2:45 pm

Multiple clinics as MultiTenant

Post by SriramChellappan » Wed Sep 22, 2021 1:17 pm

Can we use the Multiple clinics as multi tenant. I see almost all tables have the clinic identifier. Does this mean the application also safeguards the visibility of one clinic information from another clinic?

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Multiple clinics as MultiTenant

Post by jordansparks » Thu Sep 23, 2021 6:44 pm

We have considered multi tenant many times. No, Open Dental will never do multi tenant in one database. It's the sort of thing that would need to be built in from day one. We can't add it as an afterthought. The clinic feature was added after Open Dental was already mature, and the intent was to allow one organization the ability to manage multiple clinics without blocking them from seeing each other. More recently, we have added some security that keeps certain users out of clinics in certain situations. The security around that is not very extensive.
Jordan Sparks, DMD
http://www.opendental.com

SriramChellappan
Posts: 42
Joined: Thu Mar 11, 2021 2:45 pm

Re: Multiple clinics as MultiTenant

Post by SriramChellappan » Sun Sep 26, 2021 3:42 pm

A framework layer between Middle tier and database with a filter for clinic based on the user login, would this work?

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Multiple clinics as MultiTenant

Post by jordansparks » Wed Sep 29, 2021 6:08 pm

I don't quite understand the point. It's not hard to just put a few dozen databases on one machine. If we tried to put multiple customers in one database, that's not very organized. I mean, how would you run a report? It would just be a mess. Why would you even want to do that?
Jordan Sparks, DMD
http://www.opendental.com

SriramChellappan
Posts: 42
Joined: Thu Mar 11, 2021 2:45 pm

Re: Multiple clinics as MultiTenant

Post by SriramChellappan » Fri Oct 01, 2021 8:12 am

I see your point, having one database for each tenant would make sense. However in this scenario would I have one middle tier for each tenant? Can the OD client communicate the tenant id for the middle tier to point to the database based on tenant ID?

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Multiple clinics as MultiTenant

Post by jordansparks » Fri Oct 01, 2021 7:01 pm

I think maybe you are looking for this page:
https://www.opendental.com/manual/multitenant.html
Jordan Sparks, DMD
http://www.opendental.com

SriramChellappan
Posts: 42
Joined: Thu Mar 11, 2021 2:45 pm

Re: Multiple clinics as MultiTenant

Post by SriramChellappan » Sat Oct 02, 2021 3:05 am

I have gone through the link multiple times. In the scenario of hosting 6 databases in the same MySQL server, how would the Middle tier be configured?
Should I run 6 different middle tier with each configured to one database?
Or
the OD client can provide the Middle Tier with Tenant ID and middle tier will direct all the query request to the corresponding database?

SriramChellappan
Posts: 42
Joined: Thu Mar 11, 2021 2:45 pm

Re: Multiple clinics as MultiTenant

Post by SriramChellappan » Sat Oct 02, 2021 7:11 am

I read through this instructions
https://opendental.com/manual/hostmulti ... bases.html

This gives more clarity on how a multi tenancy in one webserver can be achieved. Wouldn't it be easier to maintain if there is one middle tier points to different databases based on the connection established by the client (client providing tenant ID)

Is the middle tier a open source?

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Multiple clinics as MultiTenant

Post by jordansparks » Sun Oct 03, 2021 8:56 am

I suppose that would be a useful improvement, but it would be really complicated. One problem that comes to mind is that this would force all databases to be on the same version. That's a loss of flexibility. It would be harder and more prone to failure to update them all at once instead of one at a time. Yes, the middle tier is open source.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply