Skip to content

Commit ddf1b0a

Browse files
committed
Upsun Flex: Mariadb replication
1 parent 9eb771b commit ddf1b0a

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

sites/upsun/src/add-services/mysql/_index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Their infrastructure setup is nearly identical, though they differ in some featu
1111
See the [MariaDB documentation](https://mariadb.org/documentation/)
1212
or the Oracle [MySQL Server documentation](https://dev.mysql.com/doc/refman/en/) for more information.
1313

14+
{{% note theme="info" title="MariaDB note" %}}
15+
The [example](#mariadb-example) provided later in this topic is specific to using only a **primary** MariaDB database. For details about using read-only replicas to improve performance of read-heavy applications, see the [MariaDB read-only replication](/add-services/mysql/mysql-readonly-replication.md) topic.
16+
{{% /note %}}
17+
18+
1419
## Supported versions
1520

1621
You can select the major and minor version.
@@ -307,6 +312,10 @@ With the above definition, the application container now has [access to the serv
307312

308313
### MariaDB example
309314

315+
{{% note theme="info" %}}
316+
Use the steps and sample code below if your application will connect to a **primary** MariaDB database. For details about using read-only replicas to improve performance of read-heavy applications, see the [MariaDB read-only replication](/add-services/mysql/mysql-readonly-replication.md) topic.
317+
{{% /note %}}
318+
310319
{{< codetabs >}}
311320

312321
+++

sites/upsun/src/add-services/mysql/mysql-readonly-replication.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
---
2-
title: "MariaDB/MySQL read-only replication"
3-
sidebarTitle: "Read-only replication"
4-
description: Configure and access read-only MariaDB/MySQL replicas to ease the load on a primary database.
2+
title: "MariaDB read-only replication"
3+
sidebarTitle: "MariaDB read-only replication"
4+
description: Configure and access read-only MariaDB replicas to ease the load on a primary database.
55
---
66

7-
You can improve the performance of read-heavy applications by defining read-only replicas of your MariaDB/MySQL database and then connecting your applications to those replicas.
7+
You can improve the performance of read-heavy applications by defining read-only replicas of your MariaDB database and then connecting your applications to those replicas.
88

99
Examples of read-heavy applications include:
1010
- Listing pages or dashboards
1111
- Reporting or analytics jobs
1212
- Background jobs that frequently query data
1313

14+
{{< note theme="info" title="Note" >}}
15+
- **Replication is asynchronous**: Delays of a few milliseconds might occur between writes on the primary database and reads on the replica database.
16+
- **Replicas are read-only**: This restriction ensures data consistency and integrity. Attempts to modify data will result in an SQL error.
17+
{{< /note >}}
18+
19+
### Read-only vs. external replicas
20+
Read-only replicas are used primarily to improve application performance by distributing database read requests from read-heavy applications.
21+
1422
Other common use cases for read-only replicas include:
1523
- Cross-region backup: Replicating data to different geographical regions
1624
- Data warehousing: Extracting data from production to analytics projects
1725

18-
**Note:** Read-only replicas are used primarily to improve application performance by distributing database read requests from read-heavy applications.
19-
20-
[External replicas](/add-services/mysql/mysql-replication.md) have different use cases, including disaster recovery.
26+
[External replicas](/add-services/mysql/mysql-replication.md) reside on remote servers and have different use cases, including disaster recovery.
2127

2228
### Replica scope and sharing services {#replica-scope-sharing-services}
23-
MariaDB/MySQL services (which provide access to databases and replicas) defined in a project can be accessed by the applications in that project only.
29+
MariaDB services (which provide access to databases and replicas) defined in a project cannot be accessed by or shared with applications in other projects.
2430

2531
{{< note theme="info" title="Important" >}}
2632
- **Replication is asynchronous**: Delays of a few milliseconds might occur between writes on the primary database and reads on the replica database.
@@ -32,7 +38,7 @@ MariaDB/MySQL services (which provide access to databases and replicas) defined
3238
The following code fragment defines two MariaDB services: a primary and a replica. You can use this fragment as a template by copying it into your `services.yaml` or `application.yaml` file.
3339

3440
Be sure to:
35-
- Replace `<VERSION>` with the [supported MariaDB/MySQL version](/add-services/mysql/_index.md#supported-versions) that you need. Use the same version number for the primary and replica services.
41+
- Replace `<VERSION>` with the [supported MariaDB version](/add-services/mysql/_index.md#supported-versions) that you need. Use the same version number for the primary and replica services.
3642
- **Important:** Use `replicator` as the endpoint name when you define the replica service. This is a special endpoint name that the replica service uses to connect to the database.
3743

3844
```yaml {configFile="services"}

sites/upsun/src/add-services/mysql/mysql-replication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: "MariaDB/MySQL External Replication"
3-
sidebarTitle: "MariaDB/MySQL Replication"
2+
title: "MariaDB/MySQL external replication"
3+
sidebarTitle: "External replication"
44
description: In rare cases, it may be useful to maintain a replica instance of your MySQL/MariaDB database outside of {{% vendor/name %}} on a remote server.
55
---
66

0 commit comments

Comments
 (0)