---
title: "Service Architecture"
description: "What a Managed PostgreSQL service is made of: nodes, exposed components, the admin role, default databases and the IP filter in front of them."
url: https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/service-architecture/
product: "PostgreSQL"
section: product
last_updated: 2026-11-10
---
> For AI agents: the documentation index is at https://community.exoscale.com/llms.txt. Every page is available as markdown at `<page URL>index.md` or with `Accept: text/markdown`.

# Service Architecture

This page describes what an Exoscale Managed PostgreSQL service is made of: its nodes, the endpoints it exposes, the role and databases it starts with, and the IP filter that decides who can reach it.

## Nodes

A service runs on one, two or three nodes, set by the plan: one for `hobbyist-*` and `startup-*`
plans, two for `business-*`, three for `premium-*`. The extra nodes are standbys, see
[High availability](https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/high-availability/index.md).

Read the plan, node count, CPU, memory and disk of a service:

```bash
exo api get-dbaas-service-pg SERVICE_NAME -z ZONE \
  -q '{plan: plan, nodes: "node-count", cpu: "node-cpu-count", ram: "node-memory", disk: "disk-size"}'
```

Parameters:

- `SERVICE_NAME`: name of the service, for example `my-postgresql`.
- `ZONE`: zone of the service, for example `ch-gva-2`.

Memory and disk are in bytes. All the nodes of a service run in the zone it was created in. A copy
of the data in another zone is a separate service: a
[read replica](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/use-read-replicas/index.md) or a
[fork](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/fork-a-service/index.md).

## The `pg` and `pgbouncer` Components

Every service exposes two endpoints, called components, on the same hostname with two ports:

- `pg`: the PostgreSQL server. This is the endpoint in the service URI.
- `pgbouncer`: the [PgBouncer](https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/connection-pooling/index.md)
  connection pooler, running next to PostgreSQL.

List them:

```bash
exo api get-dbaas-service-pg SERVICE_NAME -z ZONE -q 'components'
```

Each entry has a `component`, a `host`, a `port`, a `route` and a `usage` (`primary` or `replica`).

Read the ports from this command or from the service URI rather than copying them from an example:
they are assigned by the platform.

On the `pg` port, the database name in the connection string is a database. On the `pgbouncer`
port, it is the name of a [connection pool](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/manage-connection-pools/index.md).

## TLS Is Required

The service URI carries `sslmode=require`, and a connection with `sslmode=disable` is refused.
`require` encrypts the connection but does not check the server's identity. To check it, download
the CA certificate and use `sslmode=verify-full`:

```bash
exo dbaas ca-certificate -z ZONE > exoscale-dbaas-ca.pem
```

Then add `sslmode=verify-full&sslrootcert=exoscale-dbaas-ca.pem` to the connection URI. See
[Connect with psql](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/connect-with-psql/index.md).

## The `avnadmin` Role

A new service has one administrator role for you, `avnadmin`. It owns `defaultdb` and is the user
of the service URI. `avnadmin` is **not a PostgreSQL superuser**:

```sql
SELECT rolname, rolsuper, rolcreaterole, rolcreatedb, rolreplication, rolbypassrls
FROM pg_roles
WHERE rolname = current_user;
```

```text
 rolname  | rolsuper | rolcreaterole | rolcreatedb | rolreplication | rolbypassrls
----------+----------+---------------+-------------+----------------+--------------
 avnadmin | f        | t             | t           | t              | t
```

`avnadmin` can create databases, roles and objects, grant privileges, bypass row-level security
and open replication connections. It is a member of `pg_read_all_stats` and `pg_signal_backend`,
so it can read the statistics of every session and cancel or terminate them. It is not a member of
`pg_monitor`.

What `avnadmin` cannot do, and what to use instead:

| Refused | Use instead |
| --- | --- |
| `ALTER SYSTEM` | Service settings, see [Configure PostgreSQL settings](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/configure-settings/index.md) |
| `COPY ... TO PROGRAM` / `FROM PROGRAM`, `pg_read_file()` | Client-side `\copy` |
| `CREATE TABLESPACE` (only `pg_default` and `pg_global` exist) | The service disk |
| Some extensions | See [Manage extensions](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/manage-extensions/index.md) |

The roles whose names start with `_aiven` or `_avnadmin`, and `postgres`, belong to the platform.

## Databases That Already Exist

| Database | Owner | Purpose |
| --- | --- | --- |
| `defaultdb` | `avnadmin` | Yours. Encoding `UTF8`, collation `en_US.UTF-8`. |
| `_aiven` | `postgres` | Internal to the platform. |

> [!CAUTION]
> Do not write to, rename or drop `_aiven`. The platform uses it to run the service.

In `defaultdb`, the `public` schema is owned by `pg_database_owner` and only `plpgsql` is
installed. The other extensions are created on demand. Create one database per application rather
than sharing `defaultdb`:

```bash
exo dbaas database create SERVICE_NAME DATABASE_NAME -z ZONE
```

Parameters:

- `DATABASE_NAME`: the name of the database to create.

## The IP Filter

The service has a public endpoint, and the IP filter is the list of CIDR blocks allowed to
connect to it. It applies to both the `pg` and the `pgbouncer` ports. A connection from an address
outside the list times out.

```bash
exo dbaas update SERVICE_NAME -z ZONE -f --pg-ip-filter 203.0.113.0/24,198.51.100.7/32
```

> [!WARNING]
> The list you set replaces the previous one. Always pass every block you want to keep.

An empty filter blocks every connection. That is the state of a fork or a read replica created
without an IP filter. See
[Restrict connections](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/restrict-connections/index.md).

## Related Pages

- [High availability](https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/high-availability/index.md)
- [Connection pooling](https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/connection-pooling/index.md)
- [Extensions](https://community.exoscale.com/product/dbaas/service-specific/postgresql/overview/extensions/index.md)
- [Connect with psql](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/connect-with-psql/index.md)
- [Restrict connections](https://community.exoscale.com/product/dbaas/service-specific/postgresql/how-to/restrict-connections/index.md)

