Technical research on multi-tenant approach

Description

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.

Activity

Unresolved

Details

Assignee

Reporter

Priority

Created September 14, 2023 at 7:14 PM
Updated April 30, 2024 at 5:53 PM