Solutions
A separate database for each tenant
When customers must not share tables, give each tenant its own Relyt One project. Every project is a separate PostgreSQL database with its own storage, compute and credentials, and your backend creates it with one API call.
How it works
01
Create a project when a tenant signs up
Your backend calls the Open API with an API key, a region and a password for the tenant's database owner role. The project starts with a main branch and a primary compute.
curl -X POST "https://relyt.one/api/v1/projects" \ -H "Authorization: Bearer $RELYT_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"name\":\"tenant-$TENANT_ID\",\"orgId\":\"$ORG_ID\",\"region\":\"$REGION_ID\",\"password\":\"$TENANT_DB_PASSWORD\"}"02
Save the tenant's connection details
List the project's computes until the status is READY, then store the host with the tenant record. Run your schema migrations and connect with any standard PostgreSQL driver.
curl "https://relyt.one/api/v1/projects/$PROJECT_ID/computes" \ -H "Authorization: Bearer $RELYT_API_KEY"03
Delete the project when a tenant leaves
Deleting the project deletes its computes and marks the project and its branches deleted.
curl -X DELETE "https://relyt.one/api/v1/projects/$PROJECT_ID" \ -H "Authorization: Bearer $RELYT_API_KEY"
What you get today
Nothing shared between tenants
Each tenant has its own database, roles, password and connection string. A long query, a lock or a bad migration in one tenant's database stays in that database.
Compute that follows each tenant
Every project runs on its own compute, sized in CUs (1 CU = 1 vCPU + 4 GB RAM). When a tenant goes quiet, its compute can suspend and resume on the next connection.
Branch one tenant
Every tenant project supports branches, so you can try a migration on a copy-on-write fork of one tenant's data before you run it for real.
Automated end to end
Create, inspect and delete projects with the REST Open API. Repeating a create request while the first one is still running returns 202 instead of a second project.
Good to know
- The Free plan includes up to 5 projects, so one project per tenant fits a small number of tenants today. Creating more projects than your plan allows returns 403.
- Relyt One does not route requests to tenants for you: your app keeps the mapping from each tenant to its connection details.
Other solutions
Try it on the Free plan.
Sign in with GitHub or Google, create a project and an API key, and run the calls above. No credit card required.