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.

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.