On the GovStack branch (GovStack1 on Rails) there is an example of how we could implement multi-tenancy.
On the backend, this uses Rails sharding and each tenant has a separate database. The database config is in the database.yml file for each tenant. Migration and seed scripts run against all databases.
Explore whether there is any way to dynamically create a new tenant, or if there are other backend approaches, such as using the Apartment gem (new version supporting Rails 7 is here: )
RESEARCH RESULTS:
Use Rails-On-Service apartment gem, which works well with Rails 7 and allows dynamic creation of tenants. This approach will use a single PostgreSQL database, but separate schema per tenant.
On the GovStack branch (GovStack1 on Rails) there is an example of how we could implement multi-tenancy.
On the backend, this uses Rails sharding and each tenant has a separate database. The database config is in the database.yml file for each tenant. Migration and seed scripts run against all databases.
Explore whether there is any way to dynamically create a new tenant, or if there are other backend approaches, such as using the Apartment gem (new version supporting Rails 7 is here: )
RESEARCH RESULTS:
Use Rails-On-Service apartment gem, which works well with Rails 7 and allows dynamic creation of tenants. This approach will use a single PostgreSQL database, but separate schema per tenant.