Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified _assets/documents/cloud-gov-cost-estimator.xlsx
Binary file not shown.
30 changes: 26 additions & 4 deletions content/docs/services/relational-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,37 @@ If your application uses relational databases for storage, you can use the AWS R
| --------------------------- | ---------------------------------------------------------------------------- | -------------------------- |
| `micro-psql` | Single-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 1 GiB memory | 15.x\* |
| `micro-psql-redundant` | Multi-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 1 GiB memory | 15.x\* |
| `micro-psql-replica` | Multi-AZ RDS instance of PostgreSQL with read replica, minimum 1 core, minimum 1 GiB memory | 15.x\* |
| `small-psql` | Single-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 2 GiB memor | 15.x\* |
| `small-psql-redundant` | Multi-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 2 GiB memory | 15.x\* |
| `small-psql-replica` | Multi-AZ RDS instance of PostgreSQL with read replica, minimum 1 core, minimum 2 GiB memory | 15.x\* |
| `medium-psql` | Single-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 4 GiB memory | 15.x\* |
| `medium-psql-redundant` | Multi-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 4 GiB memory | 15.x\* |
| `medium-psql-replica` | Multi-AZ RDS instance of PostgreSQL with read replica, minimum 1 core, minimum 4 GiB memory | 15.x\* |
| `medium-gp-psql` | Single-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 8 GiB memory | 15.x\* |
| `medium-gp-psql-redundant` | Multi-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 8 GiB memory | 15.x\* |
| `medium-gp-psql-replica` | Multi-AZ RDS instance of PostgreSQL with read replica, minimum 1 core, minimum 8 GiB memory | 15.x\* |
| `large-gp-psql` | Single-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 8 GiB memory | 15.x\* |
| `large-gp-psql-redundant` | Multi-AZ RDS instance of PostgreSQL, minimum 1 core, minimum 8 GiB memory | 15.x\* |
| `large-gp-psql-replica` | Multi-AZ RDS instance of PostgreSQL with read replica, minimum 1 core, minimum 8 GiB memory | 15.x\* |
| `xlarge-gp-psql` | Single-AZ RDS instance of PostgreSQL, minimum 2 cores, minimum 16 GiB memory | 15.x\* |
| `xlarge-gp-psql-redundant` | Multi-AZ RDS instance of PostgreSQL, minimum 2 cores, minimum 16 GiB memory | 15.x\* |
| `xlarge-gp-psql-replica` | Multi-AZ RDS instance of PostgreSQL with read replica, minimum 2 cores, minimum 16 GiB memory | 15.x\* |
| `small-mysql` | Single-AZ RDS instance of MySQL, minimum 1 core, minimum 2 GiB memory | 8.x.x\* |
| `small-mysql-redundant` | Multi-AZ RDS instance of MySQL, minimum 1 core, minimum 2 GiB memory | 8.x.x\* |
| `small-mysql-replica` | Multi-AZ RDS instance of MySQL with read replica, minimum 1 core, minimum 2 GiB memory | 8.x.x\* |
| `medium-mysql` | Single-AZ RDS instance of MySQL, minimum 2 cores, minimum 4 GiB memory | 8.x.x\* |
| `medium-mysql-redundant` | Multi-AZ RDS instance of MySQL, minimum 2 cores, minimum 4 GiB memory | 8.x.x\* |
| `medium-mysql-replica` | Multi-AZ RDS instance of MySQL with read replica, minimum 2 cores, minimum 4 GiB memory | 8.x.x\* |
| `medium-gp-mysql` | Single-AZ RDS instance of MySQL, minimum 1 core, minimum 8 GiB memory | 8.x.x\* |
| `medium-gp-mysql-redundant` | Multi-AZ RDS instance of MySQL, minimum 1 core, minimum 8 GiB memory | 8.x.x\* |
| `medium-gp-mysql-replica` | Multi-AZ RDS instance of MySQL with read replica, minimum 1 core, minimum 8 GiB memory | 8.x.x\* |
| `large-gp-mysql` | Single-AZ RDS instance of MySQL, minimum 1 core, minimum 8 GiB memory | 8.x.x\* |
| `large-gp-mysql-redundant` | Multi-AZ RDS instance of MySQL, minimum 1 core, minimum 8 GiB memory | 8.x.x\* |
| `large-gp-mysql-replica` | Multi-AZ RDS instance of MySQL with read replica, minimum 1 core, minimum 8 GiB memory | 8.x.x\* |
| `xlarge-gp-mysql` | Single-AZ RDS instance of MySQL, minimum 2 cores, minimum 16 GiB memory | 8.x.x\* |
| `xlarge-gp-mysql-redundant` | Multi-AZ RDS instance of MySQL, minimum 2 cores, minimum 16 GiB memory | 8.x.x\* |
| `xlarge-gp-mysql-replica` | Multi-AZ RDS instance of MySQL with read replica, minimum 2 cores, minimum 16 GiB memory | 8.x.x\* |
| `medium-oracle-se2` | Single-AZ RDS instance of Oracle SE2, minimum 1 core, minimum 4 GiB memory | AWS RDS Latest Default |

_\*Note: The actual database engine version used is the latest minor/patch version offered by AWS RDS for this major version_
Expand Down Expand Up @@ -77,6 +88,8 @@ Once you have chosen a plan size, you should consider whether you need to run yo

For databases used for development or staging environments, redundancy may not be as critical. **But for databases used in production applications, you should always use a `*-redundant` database plan.**

If you need or want [a read replica for your database](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html), use one of the `*-replica` database plans. The `*-replica` database plans also include redundancy of your database in multiple availability zones.

## Create an instance

To create a service instance run the following command:
Expand Down Expand Up @@ -227,7 +240,11 @@ There are a couple of caveats regarding this command with the `-p` flag:
- You can only update using plans with the same database engine as your existing service instance. This means that if your original service instance was using a PostgreSQL plan (e.g., `micro-psql`), you can only update to one of the other `psql`-based plans.
- You can **only** switch service plans with this command; you cannot do things like upgrade your database version.

You can update to larger or smaller plans depending on your specific needs, and you can switch between redundant and non-redundant plans.
By specifying the `-p` flag to `cf update-service`, you can:

- update to larger or smaller plans depending on your specific needs
- switch between redundant and non-redundant plans
- switch from a plan without a read replica to one with a read replica

**NOTE: All updates are applied immediately. Performing an update in place like this will result in a brief period of downtime (seconds to minutes) while the service instance restarts as a part of the update.**

Expand Down Expand Up @@ -334,15 +351,20 @@ Lastly, you need to restage your application so that it uses the updated credent
cf restage <application-name> --strategy rolling
```

### Bind to an application
## Bind to an application

To use the service instance from your application, bind the service instance to the application. For an overview of this process and how to retrieve the credentials for the service instance from environment variables, see [Bind a Service Instance](https://docs.cloudfoundry.org/devguide/services/managing-services.html#bind) and the linked details at [Delivering Service Credentials to an Application](https://docs.cloudfoundry.org/devguide/services/application-binding.html).

In short, `cf bind-service` will provide a `DATABASE_URL` environment variable for your app, which is then picked up by the `restage`.

The contents of the `DATABASE_URL` environment variable contain the credentials to access your database. Treat the contents of this and all other environment variables as sensitive.
The contents of the `DATABASE_URL` environment variable contain the credentials to access your database. Treat the contents of `DATABASE_URL` and all other environment variables as sensitive.

If you are using a service plan that includes a read replica, then the bound credentials for the database with a read replica will include:

- `replica_uri`: a full URI for connecting to your read replica database.
- `replica_host`: the host for connecting to your read replica database. The `replica_host` can be used in combination with the other properties (`username`, `password`, `db_name`, `port`) to connect to the read replica database.

Please note: If you are binding a service instance to a new space, please review and adjust your space egress setting. By default, all newly made spaces have their space egress set to closed which means any requests to the open internet or our brokered services will be blocked. For an overview of space egress settings, see [Space Egress](https://cloud.gov/docs/management/space-egress/).
**Please note:** If you are binding a service instance to a new space, please review and adjust your space egress setting. **By default, all newly made spaces have their space egress set to closed which means*any requests to the open internet or our brokered services will be blocked**. For an overview of space egress settings, see [Space Egress](https://cloud.gov/docs/management/space-egress/).

## Backups and Recovery

Expand Down
64 changes: 64 additions & 0 deletions content/news/articles/2025-07-03-rds-read-replicas-available.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
layout: layouts/post
tags: news
title: Read replicas now available for RDS databases
date: 2025-07-03
excerpt: "Add a read replica for your RDS databases to handle read-only workloads"
---

The Cloud.gov team is excited to announce support for adding read replicas to your databases.

A read replica is a [read-only copy of your database which automatically replicates the data in your primary database](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html). You can offload read-heavy tasks to a read replica while your primary database handles writes. Isolating read operations to the replica reduces the load and lock contention on your primary database.

Use cases for a read replica include:

- Generating reports from your data
- Serving data for API requests
- Performing analytics queries

## How to create a read replica service

To create a new database service with a read replica:

```shell
cf create-service aws-rds micro-psql-replica <your-service-name>
```

To update an existing database to a read replica plan:

```shell
cf update-service <your-service-name> -p micro-psql-replica
```

See the [database service documentation]({{ site.baseurl }}/docs/services/relational-database) for more information on how to create or update database services.

Read replicas are supported for all `aws-rds` plans. To add a read replica to an existing instance, use the replica plan corresponding to its current plan. For example, an instance using the `medium-gp-psql` plan should update to `medium-gp-psql-replica`.

To see the list available of replica plans (which all end in `-replica`):

```shell
cf marketplace -e aws-rds
```

While your database service is being created or updated to add a read replica, running `cf service <your-service-name>` should report on the status of the create or update operation:

```shell
...
Showing status of last operation:
status: create in progress
message: Waiting for database to be available. Current status: in progress (attempt 6 of 60)
started: 2025-07-01T18:28:22Z
updated: 2025-07-01T18:28:22Z
```

## Using your read replica

Once you have created or updated a service with a read replica, you need to bind that service to an application to get the credentials to access it.

[See the database service documentation for general guidance on how to bind database services to an application]({{ site.baseurl }}/docs/services/relational-database#bind-to-an-application).

In particular, note the extra `replica_uri` and `replica_host` values that are available for any database service with a read replica.

If you updated an existing database service from a non-replica plan to a replica plan, then you will need to un-bind and re-bind that service to include the credentials for accessing the read replica. As always, when binding or re-binding a service to an application, you should then restage the application.

Using these credentials in your application code or other tools, you should be able to connect to your read replica database and use it. **Remember that read replica databases are read-only, so you cannot write to them**.
2 changes: 1 addition & 1 deletion content/pricing/index.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ redirect_from:
<a href="https://airtable.com/appbHJFEYs3H7fmA8/shrNrGC5KQnLgJqWc">Contact us</a> to learn more about available discounted enterprise pricing as well as pricing for brokered services.
</p>
<p>You can use our <a
href="/assets/documents/cloud-gov-cost-estimator.xlsx">Cloud.gov Cost Estimator.xlsx</a> (v1.5 published July 2, 2025) spreadsheet to estimate your system costs.
href="/assets/documents/cloud-gov-cost-estimator.xlsx">Cloud.gov Cost Estimator.xlsx</a> (v1.6 published July 3, 2025) spreadsheet to estimate your system costs.
</p>
</div>
</div>
Expand Down
Loading