Is Federated Multi-database setup with single sign-in supported?

Hi Guys,

We’ve been evaluating Frappe and really love the framework. We have however hit a wall in trying to figure out on our own and by referencing the documentation if it can support our need (Federated multidatabase setup for different apps with single signin).

We want to build a multiservice platform that has complementary services that ERPNext comes with. Of which we’ll be happy to merge with the core framework once we’re done for others to enjoy. Two use cases we’re thinking of is adding callcenter capabilities and bulk sms.

For scalability purposes, we would like to have the ability to configure the new apps (bulk sms and call center) to use different databases. The multi-tenancy concept in Frappe is that a new site comes with a new login and user management.

If I use an analogy:

In frappe, an app is code and logic, which needs to be installed on a site. A site is a database. It’s like a tent (app) and land (site). You build a tent then look for land to set it up.

What we would like is to have one tent (or group of related tents) covering several pieces of land (multiple sites/databases).

This way, we can have one login then install multiple apps - bulk sms, call center etc. We would like new apps are to have the option of being configured to different databases other than the one erpnext is running on for better scalability - bulk sms especially can hog the ERPNext instance if the customer decides to dispatch millions of messages at a go or if we get an influx of calls.

It this possible on Frappe?

Your guidance will be greatly appreciated.

Are you saying anything related to multitenancy? If yes, then its there.

Source: frappe_docker/multi-bench.md at develop · frappe/frappe_docker · GitHub

Plus if you need SSO, you need to setup either:

  • Social Login
  • Or configure LDAP manually inside ERP
1 Like

Hi @Rahul_Singh_Yadav thanks for your response.

Yes, we want multitenancy but not in the default way that Frappe handles. Our application will host multiple companies on same instance. Good thing is Frappe can handle multi company setup via permission manager. But we also need federated db setup for one instance.

TLDR Version
Basically, in site config, how can we specify the db that each app should use?

We want multiple apps on same bench on one site config but the apps should be able to access different databases.

Hope I’m clear now.

Thanks a lot in advance.

This is a larger scale project. If you have budgets, folks at Frappe might be interested to take it up. DM me if you are interested.

2 Likes

This is already possible if multiple apps are not expected to be frappe apps using frappe orm.

Frappe has built-in OAuth 2 provider. Use it as the central authorization server.

All your users are registered on this central Frappe/ERPNext server.

You can even login with social login keys (google, github, facebook, etc) on this central authorization server.

Add as many OAuth Client(s) as needed on this auth server, e.g bulk sms, call center, etc.

Each client is separate app with stack of its own.

I tried to make frappe app like this Custom apps for cloud users [extend ERPNext with microservices] (experimental and deprecated)

Later for a use case I used MongoDB as database and NodeJS as runtime. (active in production).

example: User visits app url (bulk-sms.example.com), gets redirected to central auth server (erp.example.com) for login, there user can login or choose to social login, after successful login user gets redirected back to the OAuth client app (bulk-sms.example.com).

4 Likes

Thanks @rmehta. Let me first tryout the solution @revant_one proposed.

Thanks @revant_one. This definitely looks like it. We’ll explore this model. Thanks a lot.