Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you create a separate db + multi schema variation? #3

Open
tosehee opened this issue May 18, 2021 · 3 comments
Open

Can you create a separate db + multi schema variation? #3

tosehee opened this issue May 18, 2021 · 3 comments

Comments

@tosehee
Copy link

tosehee commented May 18, 2021

Can you create a separate db + multi schema variation?

For example, one tenant might use the db by itself, but smaller tenants may reside in the same db, but in its own schema.

@tosehee
Copy link
Author

tosehee commented May 19, 2021

I'd assume this is very similar to the database branch. But must create the map of Tenant ID to DataSource, and call the "setCatalog" on the Connection before it's returned.

Other than, do you see any other things that need to be incorporated?

@tosehee
Copy link
Author

tosehee commented Jun 2, 2021

ping

@beskow
Copy link

beskow commented Nov 16, 2022

You're right, the two patterns can be combined just like you describe. In https://callistaenterprise.se/blogg/teknik/2022/03/26/multi-tenancy-with-spring-boot-part7/ I describe a similar, hybrid pattern (combining the database-per-tenant with shared-database to achieve sharding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants