java - Multi tenancy confusion -


i have configured multi tenancy hibernate using multitenantconnectionprovider , currenttenantidentifierresolver. have written filter intercepts url , decided tenant.

i have several questions/confusions.

  1. this design means every url has carry tenant id it(may in form of domain/subdomain), right ? if doesn't carry it? how handle such corner cases?

  2. is approach proper one? thought storing tenant id in user session thought not idea. (in past have faced issues while storing in session , has limitations scenarios).

    i confused between these 2 approaches, there third approach please suggest. have opted schema strategy of hibernate multi tenancy.

the best way implement multi-tenancy design have tenant_id in every transaction table , 1 master table store tenant information.

with every request need send tenant_id. if have default tenant requirement if no tenant_id comes data should inserted can implement behavior. can't insert 1 tenant data in tenant, tenant_id mandatory , proper validation should there tenant_id.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -