News for hackers. Stuff that matters.
Re:Ask HN: How come there is no example code for B2B-SaaS apps? by hackerm0nkey on Sunday May 03, 2020 @07:22AM (#23058344)
On more than one occasion I've started with a simple table for all tenants (where tenant = x) because we didn't know at the time if we will have many.

Then progressively when we understood how the service will be used, refactored to keep separate tenant's data separate.

Ended up with each tenant in a given schema, we were using Java and relied on Hibernate (ORM) to help connecting to the correct DB (it does support multi-tenancy) as well as on a DB migration tool (Liquibase) so any changes we made to the schema get replicated over all tenants.

There are no comments on this comment yet.