GithubHelp home page GithubHelp logo

dunghc / jhipster-multi-tenancy-poc2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hcouplet/jhipster-multi-tenancy-poc2

0.0 0.0 0.0 404 KB

jhipster multi tenancy with schema selection (share db connections) on mariadb

Dockerfile 0.05% Java 50.78% HTML 17.70% TypeScript 27.20% CSS 1.34% JavaScript 2.93%

jhipster-multi-tenancy-poc2's Introduction

Multi tenant jhipster using mysql poc

This is a poc showing with a jhipser base how to have a multi-tenant applicaiton. This is working with a limitted connection pool.

It have been inspired from https://github.com/upway/jhipster-multi-tenancy-poc. I made a fresh new jhipser and adapted the code. The main issue in the original code was (I think) using the sql "USE ...;" instead of using the setCatalog() function as documented at https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html

I think, when using the 'USE ..' sql, the second time it gets called, it doesn't swicht schema. With the setCatalog(), as implemented here, it's fully working.

Jwt token include the tenant ID and once a user is logged in, if a db connection is needed, it will get one in from the pool and set the schema.

So this is different to have a pool dedicated for each tenant that is not scalable.

The main advantage of this is that in case of multi tenant, you don't have to code any more the tenantId in each table. You can keep existing application. If a tenant needs to rollback his db, you can easily get the nightly backup. In case of db error/corruption, this will probalby limitted to one tenant.

jhipster

This application was generated using JHipster 4.10.0, you can find documentation and help at http://www.jhipster.tech/documentation-archive/v4.10.0.

jhipster-multi-tenancy-poc2's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.