AWS: Credits and reservations

KiviDB Cloud is prepaid. Your organization holds one credit balance, and every database is charged against it by the hour: compute while it runs, storage…

KiviDB Cloud is prepaid. Your organization holds one credit balance, and every database is charged against it by the hour: compute while it runs, storage while its data exists. Add credits under Billing.

What a new database needs

Credits are shared by all your databases, so a new one has to fit on top of the ones already running. Creating a database needs a balance of at least a month of everything that will be running: the databases you have now (including any still being created) plus the new one. The checkout page shows this sum.

The same rule applies when you:

  • start a stopped database;
  • resize a database, or add replicas.

A change that lowers or keeps your monthly total is always allowed, so you can shrink a database even when credits are short.

Without this rule, a balance meant for one database for a month could start four of them, and all four would stop together a week later.

When credits run out

When the balance reaches zero, every paid database is stopped and locked. A locked database starts again once you add at least a day of its usage. Databases in KiviDB's cloud are kept for 7 days and then deleted; databases in your own cloud account are only stopped, never deleted. The organization's owners are emailed when databases are stopped, two days before deletion, and when a database is deleted.

Reservations

A reservation sets part of your balance aside for one database.

  • That database's own charges are paid from its reservation first.
  • Every other database sees only the unreserved balance: it cannot be created, started or grown with credit reserved for someone else.
  • If the unreserved balance runs out while reserved credit is left, the databases without a reservation are stopped and locked, and the reserved ones keep running. The owners are emailed. When the whole balance reaches zero, everything stops as described above.

Charges are counted every hour, so a database without a reservation can spend up to an hour of credit that was reserved for another before it is stopped.

Reserving

  • When you create a database: at checkout, choose Reserve 1 month or Reserve 3 months. That many months of the new database's price are set aside as it is created.
  • For a database you already have: Billing → Credit reservations → Reserve for a database, then choose how many months of its price.

Reserving needs that much unreserved credit. It is refused if it would leave your other running databases, the ones without a reservation, less than a day of credit, because they would be stopped at the next hourly charge.

Managing reservations

Under Billing → Credit reservations:

  • Add a month tops up an active reservation.
  • Deactivate stops protecting the database; what is left returns to the unreserved balance.
  • Activate protects it again, if the unreserved balance can cover what the reservation still holds.
  • Delete removes an inactive reservation.

Deleting a database deactivates its reservation automatically. The record stays, marked as belonging to a deleted database, until you delete it.

The organization's owners and admins can see and change reservations. Admins see only the reservations under Billing; invoices, payments and the credit ledger stay visible to owners alone.

API

Method and path
GET /credits/reservationsbalance, reserved, unreserved, and each reservation
POST /credits/reservations{"instance_id": "…", "months": 1} or {"instance_id": "…", "amount_cents": 5000}
POST /credits/reservations/{id}/add{"months": 1} or {"amount_cents": …}
POST /credits/reservations/{id}/deactivate
POST /credits/reservations/{id}/activate
DELETE /credits/reservations/{id}inactive reservations only
GET /credits/committeda month of everything running or being created, and the balance

When creating a database through the API, pass "reserve_months": 1 (up to 12) to reserve with it.