Database proxy (read/write splitting)

更新时间:
复制 MD 格式

This topic describes the database proxy service for MyBase MySQL.

The database proxy for MyBase MySQL provides advanced features such as automatic read/write splitting, transaction splitting, and connection pools. The database proxy is a network proxy service that resides between the database and the application. It proxies all requests from the application to the database. This service is highly available, high-performance, easy to maintain, and simple to use.

Scenarios

  • A high number of requests within transactions causes a high load on the primary instance.

  • A high number of connections causes a high load on the primary instance.

  • Services that mainly use short-lived connections.

  • Read-only services and services that require isolation.

Introduction to proxy endpoints

A proxy endpoint is the core of the database proxy. It is a custom endpoint feature developed by Alibaba Cloud. A MyBase MySQL instance supports up to seven proxy endpoints. You can modify the read/write properties of each proxy endpoint to meet different business needs and increase flexibility.

You can set the read/write properties for each proxy endpoint separately.

  • Read/Write: Supports read/write splitting to linearly scale your services.

    In this mode, a proxy endpoint must connect to at least one primary instance and one read-only instance. All write requests are sent to the primary instance.

  • Read-only: Supports read-only services, such as reporting.

    In this mode, a proxy endpoint must connect to at least one read-only instance. The primary instance is not used for routing. When the read/write property of a proxy endpoint is set to Read-only, MyBase sends connections to the configured read-only instances in a round-robin manner. Each client connection is mapped to a single connection on one read-only instance. The total number of available service connections is the sum of connections on all read-only instances.

Note

When the read/write property of a proxy endpoint for a MyBase MySQL instance is set to Read/Write, the endpoint supports read/write splitting features such as transaction splitting and connection pools.

Usage

For more information, see Enable and configure the database proxy service.