Skip to content

bcssp10/multi-tenant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Hibernate Multi-tenant Demo

This sample project uses hibernate "SEPARATE DATABASE" multi-tenant strategy, and it also allows you to plugin new database (datasources) at runtime.

Useful resources 1 2 3 4

Running the demo

You need to add a table orders in database (PostgreSQL in this case but ofcourse you can choose anyone)

CREATE TABLE "orders" (
"id" int4 NOT NULL,
"date" date NOT NULL
);

Available URLs

curl -v POST -H "X-TenantID: DB1" "http://localhost:8080/orders"
curl -v POST -H "X-TenantID: DB2" "http://localhost:8080/orders"
curl -v POST -H "X-TenantID: DB3" "http://localhost:8080/orders"

About

Spring Boot + Spring JPA + Hibernate + Postgresql

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages