Brewless Brewless Docs

Running your application

Database costs

How to see whether a managed or a serverless database is cheaper for an environment, and where the estimate comes from.

On this page

Scaleway has two kinds of PostgreSQL database, and they are priced in opposite ways:

Kind What you pay for
Managed Database The node, all month, whether it is used or not
Serverless SQL Database Compute only while the database is awake, at a higher price per hour, plus storage

Which one is cheaper depends on one thing: how much of the month the database is awake. A database that sleeps most of the day is cheaper as serverless. One that is awake most of the time is cheaper as a managed node.

The advice in the console

For every database of an environment, the console shows what it costs as it is and what the other kind would cost, and tells you which is cheaper and by how much. It also shows the share of the month above which the managed node wins.

The amounts are estimates from Scaleway's list prices, before tax. The console shows the date the prices were read. Your bill can differ.

Note

Brewless only advises. It never moves a database from one kind to the other.

How the awake time is known

For a serverless database, Brewless measures it. Scaleway reports, minute by minute, how many vCPUs it gives the database, and nothing for a minute in which it is scaled to zero. Brewless counts that once an hour, as on the Databases page, and the advice takes the last 30 days of it. How much of that time only bots and scanners kept it awake is estimated under avoidable wake-ups.

Until such hours are recorded, or for a database without them, Brewless estimates it from what can wake the database:

  • every minute in which a container of the environment had an instance, whether that is the web container or a worker — and, for a database shared by several environments, a container of any of them;
  • plus the five minutes after it, because a serverless database falls asleep five minutes after its last query.

The estimate is counted once an hour from the same figures as serverless usage. Neither way asks anything of your application or your database. The console shows the share and the hours, and says whether they were measured or estimated.

Next to the name of the database the console shows what it is, as Scaleway reported it when the database was taken over: the engine of a managed database (such as PostgreSQL-16) and its node type, or the version of a serverless one.

You can move the share in the console to see what a change would do, for example if you plan to run the scheduler less often.

Warning

A scheduler or a queue worker that runs every minute keeps a serverless database awake all month, also when there are no visitors. For such an environment a managed node is almost always the cheaper one.

The size in the advice is read live. How it grew, hour by hour, for a managed database as well as a serverless one, is on the Databases page. That page also warns when a serverless database never sleeps: one that was up 90% or more of the last 24 hours, with what it costs a month at that pace and what the smallest managed node would cost.

When serverless pays off

Serverless SQL suits an environment that stands still most of the day and has nothing that runs every minute: a staging environment, a demo, an internal tool that is used a few hours a day.

A boost

A boost raises a Serverless SQL Database's bounds for a while, and Scaleway bills at least the minimum for as long as the database holds it. Before you send a boost, the console, the command line and the Capacity API give two amounts for the whole time it holds capacity, warming up and cooling down included:

  • at least: its minimum all that time;
  • at most: its maximum all that time.

Where the normal bounds are higher than the boost's, the normal bounds count. A boost of 4 to 15 vCPU for two hours, with 15 minutes to warm up and 30 to cool down, holds 165 minutes: at the list price of a vCPU hour that is between € 1.51 and € 5.67, before tax. What it really costs depends on the load, and is billed by Scaleway per second.

After a boost, the console shows the vCPU hours it really used and their cost, from the hours Brewless recorded of Scaleway's own figures; an hour the boost only partly covered counts for that part.

A minimum that keeps the database awake

A normal minimum of 0 lets a Serverless SQL Database sleep. A minimum of 1 vCPU or more keeps it awake all the time, and Scaleway bills that minimum for every hour: at the list price about € 100 a month per vCPU, before tax and storage. The console and brewless plan say so when you set it.