Multi-tenant architecture / feedback

I would say that ‘hiding patients from users that are not supposed to see them’ is in fact the primary goal of the Data Filter module. Therefore it can also be leveraged to achieve multi-tenancy, but that was not its primary intent. Anyway this is why I mentioned it. It uses Hibernate filters under the hood btw.

Whether one can achieve the data segregation that is demanded by a given business case will be up to each implementation’s configuration that is fed to the module. It would be great is if you could test it for multi-tenancy when it is a little more ready. So if the above seems to fit your end goal as well, I’d be more than happy to keep you in the loop. We’re planning a POC demo either next week or the week after.

Cc @snehabagri @wyclif @lilian


And I am not saying that we shouldn’t pursue other types of multi-tenancy strategies such as the spike that you’ve done (:+1:) , just trying to join forces wherever possible.

My quick thinking on this is that IF the ‘one database-multiple schema’ strategy could work (and my understanding is that you’re not sure yet that this would improve the situation) then we should aim at providing support for Postgres. It hinges on your remark:

Even when this works (Postgres, H2), you still have to create the tables one at a time for each schema, so it doesn’t seem to give much improvement.

I have no idea, but if there is a chance that there is an acceptable performance hit with Postgres when running Liquibase changesets… etc over multiple schemas, then this is the way IMO.

2 Likes

Thank you so much @atlcto for sharing your spike on this. :slight_smile:

Basing on your target use case, what do you think of @angshuonline’s post in regards to this? Bahmni as Multi-Tenant SAAS solution

@dkayiwa I would completely agree with @angshuonline’s post! :100:

@gschmidt can you comment on what AMPATH was looking for in terms of multi tenancy?

Let’s check with @jdick and @nkimaina their thoughts on this,

Hello There, Enjoyed your discussion. Is this architecture implemented?

Yes, it was the basis for Automated cloud hosting of OpenMRS.. It is no longer running or being worked on as my hours were cut back in February. I’m happy to share any of the scripts with the community if you are interested in developing it further.

1 Like

Hi @atiq, not sure which architecture you’re referring to but in the meantime we have been using Data Filter to segregate data based on 1) the user allowed locations and 2) the patients locations (both of which follow strict business definition rules), and it’s been working like a charm.

2 Likes

Thanks for your reply @mksd, I am thinking of single instance of application with multiple databases, serving multiple hospitals.Thanks

Hello Thanks for Your Response. I have successfully implemented Location Based Access Control and Yes it’s working like a charm. Thanks for your suggestions.

Thanks for your response Patrick. I have solved the requirements with the help of Location based Access control to filter the data. I appreciate your work what you have done towards multi-tenancy.

Hello @atiq trust you are great. I would like to engage you regarding your implementation of your requirements if you dont mind?

Thanks i have solved it

@banji please share with the rest of the community how you have solved your issue, this could benefit and help countless others out there.

1 Like

Thanks @mksd hope you are great and doing well. Thanks so much for all the phenomenal work you and your team are doing as well as the rest of the community. You guys are truly awesome. I sincerely mean it. Please keep up the phenomenal work.

How i solved it can be found in this really long thread here, i still reference myself Location Based Access Control - v0.1.0 Released - #75 by banji

Work still in progress though but we’ve crossed the hurdle regarding the LBAC implementation with you and others help. Can’t thank you enough. Please keep up the great work.

Anyone requiring specifics regarding this after reading the thread above can inquire, will be more than glad to respond. Basically working with LBAC module and Data-filter regarding data segregation strategy. Thank you @wyclif too!! and @dkayiwa ! smiles, you guys are simply wonderful. Thank you!

Addendum, i am still following threads carefully and saw some discussions regarding going deeper using hibernate or something wrt to mult-tenancy…i wish i was a programmer lol , hoping to reach that level someday with persistence and passion and contribute my quota as well. You have my support and best wishes always.

With Regards

1 Like

hi everyone, new member joining here and enjoyed catching up on the multi-tenancy discussion so far. @banji @atiq may I inquire how your multi-tenant implementations have gone? any issue running / maintaining?

Hello Kevin,

No issues using Datafilter. Working flawlessly. But please note it not true multi tenancy in the deep technical sense but more of a data segregation strategy to simulate multi tenancy

Thanks for the quick reply Banji. Dumb question. If it’s not true multi-tenancy, then are you still operating on a single tenant set-up? Or does the data filtering allow you to have multiple clinics / hospitals sharing a single instance?

Hello Kevin,

No question is dumb lol. We are all learning.

Yes, more like a single db setup which datafilter allows us to have multiple clinics/ hospitals. The data is segregated from each clinic. Other use cases are also available with the datafilter module. A truly incredible work.

Regards

thank you!