Postgres behavior and limits
A Postgres database is standard PostgreSQL on a private network, with automated backups on the clouds. Its guarantees and limits hold on every platform; sizing and the changes an existing database accepts differ per cloud.
Guarantees
Standard PostgreSQL. Every platform runs PostgreSQL over the standard wire protocol, with transactions, the full SQL language, and your own driver or ORM. Alien creates the database and resolves how to connect. It doesn't wrap or restrict SQL.
Private network only. On AWS, GCP, and Azure the database has no public IP, and there is no option to expose it. Only workloads in the same deployment can reach port 5432.
Local listens on localhost only. On Kubernetes and Machines the customer provides the database and controls its networking.
Extensions. On the clouds and Local, vector (pgvector), pg_trgm, uuid-ossp, and pgcrypto are available through CREATE EXTENSION.
- Each cloud ships its own pgvector build, so the minor version follows the provider.
- Local installs pgvector 0.8.1, built and hosted by Alien.
- On Kubernetes, extensions depend on the database the customer provides.
Automated backups on the clouds. AWS and Azure keep automated backups for 7 days. GCP enables automated backups and point-in-time recovery with Cloud SQL's default retention. Local has no backups.
Limits
| Limit | Value | Notes |
|---|---|---|
| Engine version | 15, 16, 17 | Default 17. See Changing a database. |
| Storage | Default 20Gi, grow-only | Shrinking is rejected. Azure raises anything below 32 GiB to 32 GiB. On Azure, use one of its fixed sizes (32, 64, 128 GiB, and so on); Alien passes the size through unchanged. |
| Largest size | GCP 16 vCPU / 60 GiB, Azure 8 vCPU / 32 GiB, AWS 256 ACU | On GCP and Azure, larger requests fail instead of being capped. On AWS, the maximum is capped at 256 ACU. |
| Backup retention | 7 days on AWS and Azure | Cloud SQL default on GCP. None on Local. |
| Resource ID | Used as the cluster, instance, or server name | Keep it short and lowercase. |
Sizing on each cloud
cpu and memory are sizing hints. Each cloud applies them differently.
AWS
Aurora Serverless v2 bills and scales in Aurora Capacity Units (ACUs).
- Minimum: 0 ACU, so the cluster pauses when idle.
- Maximum: derived from
memoryat 1 ACU per 2 GiB, rounded up to the next 0.5 ACU and kept between 1 and 256 ACU. Anything up to2Gigives 1 ACU. - Without
memory: the maximum is 2 ACU. cpuisn't used.
GCP
Cloud SQL Enterprise edition. Alien picks the smallest custom tier that fits both cpu and memory:
| Tier | vCPU | Memory |
|---|---|---|
db-custom-1-3840 (default) | 1 | 3.75 GiB |
db-custom-2-7680 | 2 | 7.5 GiB |
db-custom-4-15360 | 4 | 15 GiB |
db-custom-8-30720 | 8 | 30 GiB |
db-custom-16-61440 | 16 | 60 GiB |
Azure
Flexible Server. Alien picks the smallest SKU that fits both cpu and memory:
| SKU | Tier | vCPU | Memory |
|---|---|---|---|
Standard_B1ms (default) | Burstable | 1 | 2 GiB |
Standard_B2s | Burstable | 2 | 4 GiB |
Standard_D4ds_v5 | General Purpose | 4 | 16 GiB |
Standard_D8ds_v5 | General Purpose | 8 | 32 GiB |
High availability
| Platform | What .highAvailability() does |
|---|---|
| AWS | Nothing. The Aurora cluster has one writer instance either way. |
| GCP | Regional availability: a standby in another zone with automatic failover. |
| Azure | Zone-redundant high availability: a standby server in another zone. |
Changing a database
| Change | What happens |
|---|---|
cpu or memory | Resized in place. AWS changes the ACU ceiling, GCP changes the Cloud SQL tier, and Azure changes the SKU. Data is kept. GCP and Azure restart the server briefly. |
storage up | Grown in place. |
storage down | Rejected. |
version down | Rejected. |
version up | Rejected by the controller on AWS, GCP, and Local. A major upgrade is hard to reverse, and Alien doesn't take a backup first. To move versions, create a new Postgres resource and migrate the data. |
encryptionKey | Can't change after the database exists. |
On Local, cpu and memory have no effect.
Lifecycle
Frozen or live. When frozen, the setup template (CloudFormation or Terraform) creates the database during initial setup, and Alien imports and monitors it. When live, Alien creates, updates, and deletes it.
Deletion removes the data. Deleting the resource deletes the database with no final snapshot, on every cloud and in every setup template. Export the data first if you need it.
Passwords. On the clouds, Alien generates the administrator password and stores it in the cloud's secret store: Secrets Manager, Secret Manager, or Key Vault. The binding never contains the password, only where to read it.
Customer-managed keys. On AWS, .encryptionKey(key) encrypts storage, snapshots, and Performance Insights data with the customer's Key.
If the customer revokes the key, Aurora stops serving the database. Alien marks the key unavailable and doesn't replace the database. When access comes back, postgres/key-recovery lets Alien restart the cluster.
Platform notes
AWS
Aurora Serverless v2 pauses when idle, and you pay for storage only while paused. The first connection after a pause waits about 15 seconds while it resumes, longer after long idle periods.
Use a connect timeout of at least 30 seconds, retry connects, and keep health checks off the database so it can pause.
The cluster sits in a DB subnet group in the deployment's network, with its own security group that allows port 5432 only from the stack.
GCP
Cloud SQL instances are always on: there's no scale-to-zero. Workloads reach the instance through a Private Service Connect endpoint in the deployment's network.
Clients dial the endpoint's IP, which isn't in Cloud SQL's certificate, so the binding uses verify-ca instead of verify-full.
Azure
Flexible Server instances are always on. Workloads reach the server through a private endpoint in the deployment's network, resolved through the privatelink.postgres.database.azure.com private DNS zone. Alien allow-lists the four extensions above with the azure.extensions server parameter.
Kubernetes and Machines
Alien doesn't create Postgres on Kubernetes or Machines. The customer provides a database, and Alien passes it to your workloads as an external binding with service: "external".
On Machines the resource must be "frozen". Networking, extensions, and backups depend on that database.
Local
A native PostgreSQL process from embedded binaries, no Docker needed.
- The data directory persists across restarts.
- Alien restarts the process if it exits, and restarts recorded databases when the CLI starts.