Databases
Creating a database, what identifies it, renaming it, and what each page of the dashboard shows about it.
A database holds collections of documents. It belongs to one organization and runs on a cluster in one region. Your application reaches it directly at its cluster; the dashboard is where you create it, give it credentials and watch it.
Creating a database
On the organization's Databases page, choose Create database and give it:
- Name: 1 to 64 characters. A name is unique among the organization's databases; one that is already taken is refused.
- Region: where the database runs. It cannot be changed afterwards. See regions.
Any member of the organization can create a database. It gets the limits of the organization's plan: see limits. If the plan has a maximum number of databases and the organization has reached it, the request is refused.
Creating a database is asynchronous. The database appears at once in the provisioning state and becomes ready once its cluster has confirmed it holds the database with the configuration that was asked for. Database lifecycle describes every state.
From the management API, the same thing is POST /v1/databases: see databases in the API.
Identifiers
A database has three identifiers, shown under its Settings → Identifiers. They are different on purpose, so use the right one in the right place.
| Identifier | Looks like | Used for |
|---|---|---|
| Database ID (management API) | db_… | The databaseId in management API paths |
| Database ID (cluster) | Given by the cluster | Requests your application sends to the cluster; it is part of the database's addresses |
| Slug | production | The database's address in the dashboard |
The cluster's ID appears once the database is ready. See connecting an application.
Renaming a database
Change the name under the database's Settings → General. The slug follows the name, so the database's dashboard address changes. A link to an address it had before still opens it, under its address now, until another database of the organization takes that slug.
Nothing your application uses changes: the database's IDs, its keys and its addresses stay the same.
A database can be renamed in any state until its deletion's grace period is over, including while it is still being created or after its creation failed.
The database's pages
| Page | What it shows |
|---|---|
| Overview | State, recent activity and operations, connection details, region, plan and limits |
| Connect | A step-by-step guide: create a key, make a first request, issue document tokens |
| Monitoring | Usage over time, one chart per meter, and the database's operations |
| Collections | The database's collections and their schema versions, read from the cluster. Read-only |
| API | The database's HTTP API with its own addresses filled in |
| Branches | The database as main, and its branches |
| Backups | How the database's data is protected, and its backups |
| Keys | Database keys |
| Token Keys | Token keys |
| Operations | Every operation run on the database |
| Activity | The database's part of the audit log. Owners and admins only |
| Settings | Name, identifiers, region and plan, and the actions that suspend or delete it |
Collections are managed from your backend
The dashboard shows collections but does not change them. Collections, their schemas and their migrations are created with an admin database key, from your backend or a script. The API page shows the request with your database's address.
Suspending and deleting
Both are under Settings → Danger zone and in the menu on the Overview page.
- Suspend makes the database read-only: clients can still read documents, and every write is refused until you resume it.
- Delete blocks access first, then keeps the database for a grace period during which it can be restored.
See database lifecycle for what each one does and how to undo it.