diff --git a/about/pricing.mdx b/about/pricing.mdx index 1432434c81..76a001bbd9 100644 --- a/about/pricing.mdx +++ b/about/pricing.mdx @@ -33,7 +33,7 @@ Monthly Machine prices assume 30 days of continuous runtime. Machines are billed | SSL certificates | \$0.10/month per single hostname; \$1/month per wildcard | First 10 single-hostname certificates are free | | Outbound data to the internet | \$0.02/GB in North America and Europe
\$0.04/GB in Asia Pacific, Oceania, and South America
\$0.12/GB in Africa and India | Inbound data is free | | Private network data between regions | \$0.006/GB in North America and Europe
\$0.015/GB in Asia Pacific, Oceania, and South America
\$0.050/GB in Africa and India | Data transfer within a region is free. Different rates apply to some older organizations; see [data transfer pricing](#data-transfer-pricing) | -| Managed Postgres | \$38/month (Basic) to \$1,922/month (Performance) | Storage is \$0.28/GB/month based on usage. See [Managed Postgres pricing](/postgres#pricing) | +| Managed Postgres | \$4/month (Developer) to \$1,922/month (Performance) | The Developer plan includes storage. On other plans, storage is \$0.28/GB/month based on usage. See [Managed Postgres pricing](/postgres#pricing) | | Support | \$29/month Standard; \$199/month Premium; Enterprise starts at \$2,500/month | Optional. Community support is free | | Extensions such as Tigris and Upstash | Provider's list price | Pricing is set by the extension provider and charges appear on your Fly.io invoice | | App builders and registry image storage | No charge | Building images with Depot or Fly builders, and storing images in the Fly.io registry, are currently free. See [App builders](#app-builders) | diff --git a/about/support.mdx b/about/support.mdx index a6d0ca3fcc..487dc2097c 100644 --- a/about/support.mdx +++ b/about/support.mdx @@ -48,7 +48,7 @@ You can find your support address is in the [Fly.io dashboard](https://fly.io/da ### Support Portal -**Who can use this:** Organizations who have purchased a Standard, Premium, or Enterprise Support package or organizations with legacy Launch or Scale plans. Organizations with a Managed Postgres (MPG) database cluster also have access to our Support Portal for issues related to MPG. +**Who can use this:** Organizations who have purchased a Standard, Premium, or Enterprise Support package or organizations with legacy Launch or Scale plans. Organizations with a Managed Postgres (MPG) database cluster on any plan except [Developer](/postgres/developer-plan) also have access to our Support Portal for issues related to MPG. **Use this for:** Technical support for issues or questions specific to you. diff --git a/docs.json b/docs.json index 7712827329..d039e42248 100644 --- a/docs.json +++ b/docs.json @@ -630,6 +630,7 @@ "group": "Getting Started", "pages": [ "postgres/create-and-connect", + "postgres/developer-plan", "postgres/client-configuration", "postgres/cluster-configuration" ] diff --git a/postgres/client-configuration.mdx b/postgres/client-configuration.mdx index 48ffb548ac..f7dca8ac2e 100644 --- a/postgres/client-configuration.mdx +++ b/postgres/client-configuration.mdx @@ -15,6 +15,8 @@ After [creating your MPG cluster](/postgres/create-and-connect) and attaching yo - **Pooled URL** (default): `postgresql://fly-user:YOUR_PASSWORD@pgbouncer.YOUR_CLUSTER.flympg.net/fly-db` — routes through PgBouncer. Use this for your application. - **Direct URL**: `postgresql://fly-user:YOUR_PASSWORD@direct.YOUR_CLUSTER.flympg.net/fly-db` — bypasses PgBouncer. Use this for migrations, advisory locks, or `LISTEN/NOTIFY`. +On the [Developer plan](/postgres/developer-plan), there's no PgBouncer. Use the direct URL, which `fly mpg attach` sets for you. + SSL is enabled by default on all MPG connections. You do not need to set `sslmode` in your connection string. **2. Set connection lifetime and idle timeout in your code.** These are settings you configure in your application's database client or connection pool library — not on the database or cluster side. Not all client libraries support these settings directly — see the [language-specific examples](#language-specific-configuration) below. @@ -54,7 +56,7 @@ The fix is straightforward: configure your connection pool to **proactively recy ## PgBouncer mode and your client -All MPG clusters include PgBouncer for connection pooling. The pool mode you choose on the cluster side affects what your client can do. See [Cluster Configuration](/postgres/cluster-configuration) for how to change modes. +All MPG clusters except those on the [Developer plan](/postgres/developer-plan) include PgBouncer for connection pooling. The pool mode you choose on the cluster side affects what your client can do. See [Cluster Configuration](/postgres/cluster-configuration) for how to change modes. **Session mode** (default): A PgBouncer connection is held for the entire client session. Full PostgreSQL feature compatibility — prepared statements, advisory locks, `LISTEN/NOTIFY`, and multi-statement transactions all work normally. Lower connection reuse. @@ -257,6 +259,8 @@ Each MPG plan has a fixed number of PgBouncer connection slots shared across all | Scale | 1000 | 300 | 50 | | Performance | 1000 | 300 | 50 | +The Developer plan has no PgBouncer. It allows up to 20 connections straight to Postgres, shared by all your clients. + **Max client connections** is the total number of client connections PgBouncer will accept. **Max database connections** is the number of actual connections PgBouncer opens to PostgreSQL. The reserve pool handles bursts above the normal pool size. ### Common connection limit errors diff --git a/postgres/cluster-configuration.mdx b/postgres/cluster-configuration.mdx index d4b3b1c7f7..ba2468f04d 100644 --- a/postgres/cluster-configuration.mdx +++ b/postgres/cluster-configuration.mdx @@ -8,7 +8,7 @@ source_url: https://fly.io/docs/mpg/cluster-configuration/ ## Connection Pooling -All Managed Postgres clusters come with PGBouncer for connection pooling, which helps manage database connections efficiently. You can configure how PGBouncer assigns connections to clients by changing the pool mode. +All Managed Postgres clusters except those on the [Developer plan](/postgres/developer-plan) come with PGBouncer for connection pooling, which helps manage database connections efficiently. You can configure how PGBouncer assigns connections to clients by changing the pool mode. For configuring your application's connection pool settings (lifetime, idle timeout, pool size, and language-specific examples), see [Connect Your Client](/postgres/client-configuration). @@ -48,7 +48,7 @@ To change the pool mode for your cluster: ## Changing your MPG Plan -Your Managed Postgres Plan determines the amount of resources your cluster has. All plans include a primary and replica, pg bouncers, and backups. You can change your cluster's plan at any time and the machines in the cluster will be updated to their new resources. +Your Managed Postgres Plan determines the amount of resources your cluster has. All plans include a primary and replica, and backups. All plans except Developer include PgBouncer. You can change your cluster's plan at any time and the machines in the cluster will be updated to their new resources. In order to change your plan: diff --git a/postgres/create-and-connect.mdx b/postgres/create-and-connect.mdx index 4dd19937e4..3a32831b43 100644 --- a/postgres/create-and-connect.mdx +++ b/postgres/create-and-connect.mdx @@ -15,12 +15,13 @@ You'll be prompted to set your clusters: - Cluster name (must be unique within your organization) - Region (see [available MPG regions](/reference/regions)) - A plan with predefined hardware resources: + - [Developer](/postgres/developer-plan): 1 shared vCPU, 256MB RAM - Basic: 2 shared vCPUs, 1GB RAM - Starter: 2 shared vCPUs, 2GB RAM - Launch: 2 Performance vCPUs, 8GB RAM - Scale: 4 Performance vCPUs, 32GB RAM - Performance: 8 Performance vCPUs, 64GB RAM -- Initial storage size: Up to 500 GB at creation +- Initial storage size: Up to 500 GB at creation. Developer plan clusters start at 1GB and can grow to 5GB - Optional PostGIS support. Other extensions, including pgvector, are enabled after creation from the [Extensions page](/postgres/extensions)
@@ -38,21 +39,31 @@ You can also create an MPG cluster using the flyctl command line tool. To begin, ```bash fly mpg create ``` - Follow the prompts to configure your cluster name, plan, and region. By default your cluster will be created with a 10GB initial volume, which grows automatically with your data; you can start larger using the `--volume-size` flag: + Follow the prompts to configure your cluster name, plan, and region. By default your cluster will be created with a 10GB initial volume (1GB on the Developer plan), which grows automatically with your data; you can start larger using the `--volume-size` flag: ```bash cmd fly mpg create [flags] ``` ```out out - -n, --name string The name of your Postgres cluster - -o, --org string The target Fly.io organization - --plan string The plan to use for the Postgres cluster (basic, launch, scale) - -r, --region string The target region - --volume-size int Initial volume size in GB (default 10) + --enable-postgis-support Enable PostGIS for the Postgres cluster + -n, --name string The name of your Postgres cluster + -o, --org string The target Fly.io organization + --pg-major-version int The major version of Postgres to use for + the Postgres cluster. Supported versions + are 16, 17 and 18. (default 17) + --plan string The plan to use for the Postgres + cluster: Dev-256, Basic, Starter, + Launch, Scale, Performance + -r, --region string The target region (see 'flyctl platform + regions') + --volume-size int Initial volume size in GB. Defaults to + the plan's size. ``` +To create a Developer plan cluster, use `--plan dev-256`. + After all options are set the cluster will begin initializing. Once that's complete, you can now connect to your cluster. ## Attach an application to your Managed Postgres Database @@ -76,7 +87,7 @@ fly mpg attach -a ``` This will also trigger a restart of the selected app in order to add the secret. You can find the cluster ID in your MPG dashboard or by using the `fly mpg list` command. -Both of the attachment options will use the pooled connection URL, which uses PGBouncer to help manage database connections efficiently. This is recommended for most apps. +Both of the attachment options will use the pooled connection URL, which uses PGBouncer to help manage database connections efficiently. This is recommended for most apps. On the [Developer plan](/postgres/developer-plan), which has no PgBouncer, they use the direct URL instead. ### Manually connect an application using a connection string diff --git a/postgres/developer-plan.mdx b/postgres/developer-plan.mdx new file mode 100644 index 0000000000..b8b16c873d --- /dev/null +++ b/postgres/developer-plan.mdx @@ -0,0 +1,115 @@ +--- +title: Managed Postgres Developer plan +sidebarTitle: Developer plan +description: "Run a small, highly available Managed Postgres cluster for $4 a month on the Developer plan: what it includes, its limits, auto-pause, and how to upgrade." +--- + +**The Developer plan is Managed Postgres for side projects, prototypes and small apps. You get a highly available, two-node Postgres cluster with daily backups for \$4 a month.** + +## What the Developer plan includes + +- **High availability:** a primary and a replica, each on a `shared-cpu-1x` Machine with 256MB of memory, with automatic failover. +- **Daily backups:** one full backup a day, kept for 1 day. See [Backups](#backups). +- **Storage:** 1GB to start, growing automatically up to 5GB. +- **Up to 20 connections**, straight to Postgres. +- **Auto-pause:** the cluster pauses when nothing is connected and wakes on the next connection. See [Auto-pause](#auto-pause). +- Everything else in [Managed Postgres](/postgres): encryption, [extensions](/postgres/extensions), [metrics](/postgres/metrics), and access from your organization's [private network](/networking/private-networking). + +## Pricing + +The Developer plan costs **\$4 for 30 days**, including storage, billed by the second like every Managed Postgres plan. You're billed while the cluster exists, including the time it's paused, so a cluster you delete partway through the month costs less. + +The Developer plan is included in the [Free plan](/about/free-plan). A Free plan organization can have one Developer plan cluster, and its cost counts toward the \$5 of monthly usage. + +## How it differs from other plans + +The Developer plan is smaller and simpler than the other [Managed Postgres plans](/postgres#pricing): + +| | Developer | Basic and up | +| --- | --- | --- | +| Memory per node | 256MB | 1GB and up | +| Connection pooling (PgBouncer) | No. Clients connect to Postgres directly | Yes | +| Connections | Up to 20 | Depends on plan | +| Storage | Up to 5GB | Up to 1TB | +| Storage cost | Included in the \$4 | \$0.28/GB a month | +| Backups | One full backup a day, kept for 1 day | Kept for 10 days | +| Restore | From a backup only | From a backup or a point in time | +| Maintenance | Any time | In a [weekly window](/postgres/maintenance-windows) you choose | +| Auto-pause | Yes | No | +| Support | No direct support contact. We still respond to alerts on your cluster | Direct support from Fly.io | + +## Backups + +We take one full backup of your cluster a day, and keep it for 1 day. That gives you about a day to restore from if something goes wrong, so keep your own copy of anything you can't lose, for example with `pg_dump`. + +You can restore from a backup, but not to a point in time. On-demand backups are full backups only. `fly mpg backup create --type incr` returns an error on the Developer plan. + +## Maintenance + +Developer plan clusters don't have a maintenance window. We can run maintenance at any time. We work to avoid downtime, but your app may see short interruptions, so make sure it reconnects when a connection drops. + +## Auto-pause + +A Developer plan cluster pauses after 15 minutes with no client connections. While it's paused, the dashboard shows that it wakes on the next connection. + +When a client connects, the cluster wakes. This usually takes about 15 seconds, and can take up to 25. The connection waits for the cluster to wake, so set your client's connection timeout to at least 30 seconds. + +## Storage limit + +Your cluster starts with 1GB of storage and grows automatically, 1GB at a time, up to 5GB. + +The 5GB holds your data and Postgres's write-ahead log (WAL), so your data runs out of room before it reaches 5GB. + +When your cluster gets close to 5GB, we email you. Upgrade to Basic or a larger plan before it fills up. A full disk takes your database down: when Postgres can't write its WAL, it crashes and restarts. + +## Create a Developer plan cluster + +In the dashboard, create a Managed Postgres cluster as usual and choose the **Developer** plan. See [Create and connect to a cluster](/postgres/create-and-connect). + +With flyctl: + +```bash +fly mpg create --plan dev-256 +``` + +You need flyctl v0.5.15 or later. Run `fly version upgrade` if your flyctl doesn't list the Developer plan. + +Your cluster gets a 1GB volume by default. + +## Connect to your cluster + +Attach your app to the cluster: + +```bash +fly mpg attach -a +``` + +This sets a `DATABASE_URL` secret on your app. On the Developer plan, it's the cluster's direct URL, which connects straight to Postgres. If your app already has a `DATABASE_URL` secret, choose another name with `--variable-name`. See [`fly mpg attach`](/flyctl/cmd/fly_mpg_attach). + +You don't need PgBouncer settings, such as disabling prepared statements for transaction mode. Keep your app's connection pool small, since all your clients share the 20 connections. + +The direct URL keeps working if you upgrade to a larger plan. To use PgBouncer after an upgrade, attach again to get the pooled URL: + +```bash +fly secrets unset DATABASE_URL -a +fly mpg attach -a +``` + +The pooled URL uses PgBouncer in transaction mode. If your app uses prepared statements, `SET`, advisory locks or `LISTEN/NOTIFY`, keep the direct URL, or change the pool mode to session first. See [Connection pooling](/postgres/cluster-configuration#connection-pooling). + +See [Connect your client](/postgres/client-configuration). + +## Upgrade to a larger plan + +You can move a Developer plan cluster to Basic or a larger plan at any time from the dashboard. Your disk grows to the new plan's default size, 10GB on Basic. Your app keeps using the direct URL. See [Connect to your cluster](#connect-to-your-cluster). You can't move a cluster from another plan to the Developer plan. + +On the [Free plan](/about/free-plan), upgrade your organization to Pay As You Go before you move the cluster to a larger plan. + +See [Changing your MPG plan](/postgres/cluster-configuration#changing-your-mpg-plan). + +## Related reading + +- [Managed Postgres overview](/postgres) +- [Create and connect to a cluster](/postgres/create-and-connect) +- [Connect your client](/postgres/client-configuration) +- [Fly.io Resource Pricing](/about/pricing) diff --git a/postgres/index.mdx b/postgres/index.mdx index bc2fabe7a5..938b434193 100644 --- a/postgres/index.mdx +++ b/postgres/index.mdx @@ -14,7 +14,7 @@ Fly.io's Managed Postgres is our fully-managed database service that handles all - High availability with automatic failover - Performance monitoring and metrics - Resource scaling (CPU, RAM, storage) -- 24/7 support and incident response +- 24/7 incident response, and support on every plan except [Developer](/postgres/developer-plan) - Automatic encryption of data at rest and in transit ### What's included {#whats-included} @@ -24,7 +24,7 @@ You'll be able to access: - A highly-available Postgres cluster within your Fly.io organization's [private network](/networking/private-networking) - Multiple databases and schemas on that cluster - Programmatic access via the [Managed Postgres API](/machines/api), part of the Fly Machines API -- Fly.io Support Portal to log tickets and get help +- Fly.io Support Portal to log tickets and get help, on every plan except Developer - [Supported Postgres extensions](/postgres/extensions) for your cluster's Postgres version - The third party `pgvector` extension for vector similarity search - The third party `PostGIS` extension for adding geospatial data support, if enabled when provisioning your database @@ -47,8 +47,8 @@ We'll be rolling out more regions as soon as we can. Choose a region close to yo Managed Postgres storage features: -- Maximum storage limit: 1 TB -- Initial storage size: Up to 500 GB at creation +- Maximum storage limit: 1 TB (5GB on the [Developer plan](/postgres/developer-plan)) +- Initial storage size: Up to 500 GB at creation (1GB on the Developer plan) - Storage is replicated across all nodes in your cluster - Storage growth is monitored and managed automatically @@ -59,19 +59,20 @@ The price of running Fly.io Managed Postgres depends on: - Your selected Managed Postgres Plan - The storage your databases use -Your MPG plan determines the CPU and Memory configuration for your cluster. All plans include high availability, backups, and connection pooling. +Your MPG plan determines the CPU and Memory configuration for your cluster. All plans include high availability and backups. All plans except Developer include connection pooling. The current monthly plan pricing is: | Plan | CPU | Memory | Monthly Price | | --- | --- | --- | --- | +| [Developer](/postgres/developer-plan) | Shared-1x | 256MB | \$4.00 | | Basic | Shared-2x | 1GB | \$38.00 | | Starter | Shared-2x | 2GB | \$72.00| | Launch | Performance-2x| 8GB | \$282.00 | | Scale | Performance-4x | 32GB | \$962.00 | | Performance | Performance-8x | 64GB | \$1,922.00 | -Database storage is billed on usage, at **\$0.28 per GB for a 30-day month**. For example, if your databases use 10GB of storage, your monthly storage cost will be \$2.80. Usage is metered hourly, so a cluster that grows mid-month is charged for the larger size only from the hour it grows. Older v1 clusters, which have no **v2** badge next to the cluster name in the dashboard, are still billed on their provisioned storage rather than on usage. Their provisioned size is metered on the same hourly schedule, so resizing a v1 volume is prorated the same way. +The [Developer plan](/postgres/developer-plan) includes its storage in the \$4 price. On all other plans, database storage is billed on usage, at **\$0.28 per GB for a 30-day month**. For example, if your databases use 10GB of storage, your monthly storage cost will be \$2.80. Usage is metered hourly, so a cluster that grows mid-month is charged for the larger size only from the hour it grows. Older v1 clusters, which have no **v2** badge next to the cluster name in the dashboard, are still billed on their provisioned storage rather than on usage. Their provisioned size is metered on the same hourly schedule, so resizing a v1 volume is prorated the same way. Clusters created or deleted mid-month will have their pricing prorated accordingly. diff --git a/postgres/maintenance-windows.mdx b/postgres/maintenance-windows.mdx index 7b957d7c6f..04a043f318 100644 --- a/postgres/maintenance-windows.mdx +++ b/postgres/maintenance-windows.mdx @@ -7,13 +7,13 @@ description: Choose when Fly.io runs routine maintenance on your Managed Postgre ## What's a maintenance window? -Every Managed Postgres cluster has one maintenance window each week. The window has a day, a start time and a length. Routine maintenance that we schedule for your cluster only starts inside this window. That includes updating Postgres and the software that runs alongside it, and applying configuration changes. +Every Managed Postgres cluster, except those on the [Developer plan](/postgres/developer-plan#maintenance), has one maintenance window each week. The window has a day, a start time and a length. Routine maintenance that we schedule for your cluster only starts inside this window. That includes updating Postgres and the software that runs alongside it, and applying configuration changes. Pick a time when a short interruption won't bother anyone. Some things don't wait for the window. See [What can happen outside the window](#what-can-happen-outside-the-window). ## The default window -New clusters start with this window: +New clusters, except Developer plan clusters, start with this window: - **Day:** Sunday - **Start:** 1:00 AM @@ -67,6 +67,8 @@ To see the current window, run: fly mpg maintenance-window show ``` +On a [Developer plan](/postgres/developer-plan#maintenance) cluster, it reports that maintenance can run at any time, since Developer clusters don't have a window. + To change it, pass any of `--day`, `--start-hour` and `--duration`: ```bash @@ -85,7 +87,7 @@ Either way, the new window takes effect right away. That includes maintenance th | Start time | Any whole hour, 12:00 AM to 11:00 PM | | Duration | 3 to 8 hours, in whole hours | -**Note**: You can't set the window when you create a cluster. New clusters always start with the default window, and you can change it after the cluster is created. +**Note**: You can't set the window when you create a cluster. New clusters, except Developer plan clusters, always start with the default window, and you can change it after the cluster is created. ## What happens during maintenance