I’m working in an existing environment that has a service instance per tenant and a database schema per tenant using Hibernate.
We started to build multi-tenant (micro-)services that connect to these schemas via Hibernate. This all works well when the schema of the tenant matches with the Hibernate entity classes of the services. However, it can happen that tenant schemas are ahead or behind the Hibernate class entities of different services, for example when doing canary or staged deployments. We are looking for options to evolve our services independently from each other.
Is there anything in Hibernate or other tools/libraries that can help with evolving entity class, for example, something like if an entity field doesn’t exist in a table default to a specific value?
Open to any suggestions for this as well.
- MySQL 5.6
- Hibernate 5.4
- Spring Boot 2.5