Replicate db settings between tenants

I created a dev database from a productions and none of indexes or collections carried over. What’s the point of nested db if it’s created with blank configuration.

Child databases can be used for whatever you want. A typical use case is to provide per-tenant document storage, so that personal settings are stored in different databases.

Fauna never automatically populates a child database: different use cases depend on a “clean slate”.

If you need to use a distinct database for CI/CD testing, you should create the appropriate tooling to setup the required schema, such as creating documents, indexes, functions, keys, tokens, credentials, access providers, etc., as needed. That might be done by using one of the drivers to execute queries, or fauna-shell's eval command to process files containing FQL queries.

We are working on a capability to copy a database, but it will be some time before we’re ready to announce what that capability looks like.

Could you write the fql script that scans and copies over gql schema, index and collections that could be used in CI? I’m fairly certain when it will come down to I will forget to do it manually without ci.

When I read the multitenant in marketing I very much assumed replicated settings feature, for saas website.

I’m using cloudflare workers which only has fetch api, so I’m using third party lib, but I’ll just hope it’s a alright.

Child databases have a couple restrictions that you need to be aware of:

  1. You need to be using the secret for an admin key in order to create a child database.

  2. In order to write to the child database, you need to use a key specifically for that child database, or a "scoped" key. In either scenario, that means using the new secret in a separate client connection.

A program written Node.js can accommodate those restrictions easily.

If you can point me to where our marketing materials say, or infer, that databases are replicated, I’ll make sure that those statements get clarified/updated.

The current release of the JavaScript driver works fine in Cloudflare Workers (based on community reports).

We are also working on a backup-and-restore feature. One component of that feature is that it will allow you to bootstrap new databases from a saved snapshot. You could conceivably save a snapshot of a template database and use that to seed tenant databases.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.