Multi Tenant JPA Example
Quick Start
- Spin up MySQL
- Start Spring Boot Application
- Create a fresh database for the
foo
tenant
$ http POST :8080/admin/tenants/foo
- Create a fresh database for the
bar
tenant
$ http POST :8080/admin/tenants/bar
- Retrieve the list of people persisted in each tenant's database
$ http GET :8080/api/people X-TENANT-ID:foo
$ http GET :8080/api/people X-TENANT-ID:foo
- Create different people in each tenant's database
$ http POST :8080/api/people firstName=Jane lastName=Doe X-TENANT-ID:foo
$ http POST :8080/api/people firstName=John lastName=Smith X-TENANT-ID:bar