Plans and limits
The limits a database has, where they come from, where to read them and what happens when one is reached.
Every database has a plan, and the plan sets the database's limits. This page explains what is limited and how to read a database's own figures. It does not list numbers: a database's limits are shown on its Overview and returned by the management API, and those are the ones that apply to it.
Where limits come from
An organization has a plan, and a new database takes that plan's limits when it is created. A database's plan and limits are part of what the management API returns for it.
A database restored from a backup gets the limits of the plan of the database it was restored from.
What a database is limited in
Only what the engine itself enforces is a limit, so each limit below is applied by the database's cluster, not estimated by the dashboard.
| Dashboard | API field | What it limits |
|---|---|---|
| Sessions | limits.connections | Sessions open at the same time |
| Storage | limits.retained | Bytes stored, history included |
| Writes | limits.append | Bytes written per second |
| Transfer | limits.transfer | Bytes received and sent per second |
| Presence | limits.presence | Presence deliveries per second |
| Webhook endpoints | limits.maxEndpoints | Webhook endpoints of the database |
| Triggers per collection | limits.maxTriggers | Triggers of each collection |
Webhook deliveries (each attempt, pings and gap notices) count in a database's transfer usage but never draw on its transfer limit, so they neither slow nor refuse its clients; their own pace is bounded by the engine.
maxEndpoints and maxTriggers are applied by a database's cluster once it runs a release with webhooks; until then it makes no endpoints or triggers. A database made before plans named them, or while its cluster ran an earlier release, has its plan's applied within minutes of its cluster gaining webhooks (a database made before plans named them shows neither in limits until then).
One more limit is the same for every database, whatever its plan:
| Dashboard | Value | What it limits |
|---|---|---|
| Largest document | 16 MiB | The size of one document's state |
The number of documents is not limited.
Reading a database's limits
On the database's Overview, under Limits. From the management API:
curl "$MIMIC_MANAGEMENT_API/v1/databases/$DATABASE_ID" \
-H "Authorization: Bearer $MIMIC_API_KEY"{
"id": "db_…",
"plan": "<plan-id>",
"limits": {
"connections": 0,
"retained": 0,
"append": 0,
"transfer": 0,
"presence": 0
}
}The response is shortened and its numbers are placeholders. retained, append and transfer are in bytes.
What happens at a limit
Limits are applied where the database runs. The control plane sets a database's limits in its cluster and confirms that the cluster holds them before the database is ready; it is the cluster that enforces them. The control plane does not count requests, does not refuse any, and deletes nothing when a limit is reached.
The advisor warns when a database uses 80% of its storage limit, and marks it critical at 95%.
Databases per organization
A plan can also limit how many databases an organization has. When the organization is at that number, creating another database, or restoring a backup into a new one, is refused with a message that names the limit.
Every database of the organization counts, including one whose creation failed and one that is deleted and waiting out its grace period. A database that has been removed from its cluster and is only held in backups does not.
GET /v1/usage returns the plan's limit as plan.maxDatabases; null means the plan has none.
Branches per database
Branches do not count toward that number. A plan limits how many each database has instead; when a database is at it, creating another branch of it is refused with a message that names the limit. Branches count as databases do: one being deleted counts until it is removed from its cluster.
GET /v1/usage returns it as plan.maxBranches; null means the plan has none.
Included usage
Besides limits, a plan can include an amount of each usage meter per month, and is marked as hard-capped or not. Both are reported on the organization's Usage page and by GET /v1/usage: see usage. They are figures to read: the limits above are what a database's cluster enforces.
Changing limits
Limits are not edited per database: they follow from the plan. There is no setting in the dashboard and no endpoint in the management API that changes one.