OceanBase Database Proxy (ODP, also known as OBProxy) is a proxy server dedicated for OceanBase Database. OceanBase Database stores replicas of user data on multiple OBServer nodes. When ODP receives an SQL statement from a user, ODP forwards the statement to the optimal OBServer node and returns the execution result to the user.
Introduction to ODP
OceanBase Database is a distributed database. This makes it different from standalone databases. In OceanBase Database, tables and table partitions may be stored on different servers. To read data from or write data to a table, the system must first locate the leader and follower replicas of the table or partition that contains the data, and then execute the SQL statement. This is almost impossible to implement at the application level. ODP is a reverse proxy designed for OceanBase Database. Its core function is to route data access requests from the client to the right OBServer node and return the response from the OBServer node to the client.
The user sends a request from a client to a load balancing agent, which forwards the request to a stateless ODP. Then, ODP forwards the request to the optimal OBServer node in the OceanBase cluster.
Note
The load balancing agent can be a popular service such as SLB or F5.
ODP is a reverse proxy that forwards requests and is not responsible for sharding. It does not generate or schedule execution plans as an SQL engine does.
Each OBServer node comprises an SQL engine and a storage engine. These engines parse SQL statements to generate and execute physical execution plans for these statements. The Paxos protocol is used among distributed OBServer nodes to ensure high availability. In this architecture design, ODP provides only routing and disaster recovery capabilities. All database features are provided by OBServer nodes. This division of responsibilities is clear and simple. It increases the performance of each component and helps OceanBase Database perform almost as well as a standalone database.
ODP can correctly forward a request to a leader. You can also configure ODP to support write/read splitting or read data first from a follower. In addition, when an OBServer node is down, being upgraded, or undergoing a major compaction, ODP uses its blocklist mechanism to forward requests to a functioning OBServer node.
ODP management
The following table describes the operations that you can perform on ODP via OceanBase Cloud Platform (OCP).
| Operation | Description |
|---|---|
| Create an ODP cluster | You can perform this operation to create an ODP cluster. |
| Manage ODP parameters | You can perform this operation to manage the parameters of an ODP cluster. |
| Delete an ODP cluster | You can perform this operation to delete an ODP cluster. |
| Upgrade all ODPs in an ODP cluster | You can perform this operation to upgrade all ODPs in an ODP cluster. |
| Restart all ODPs | You can perform this operation to restart all OBProxies in an ODP cluster. |
| Manage OceanBase clusters connected to an ODP | You can connect an OceanBase cluster to an ODP or delete a connected OceanBase cluster in the OCP console. |
| Monitor ODP cluster performance | The OCP console allows you to view the performance monitoring data of an ODP cluster, including service monitoring information and system monitoring information. |
| Add an ODP | You can perform this operation to add an ODP to an ODP cluster. |
| Start an ODP | You can perform this operation to start an ODP. |
| Refresh ODP configurations | You can perform this operation to refresh the configurations of an ODP. |
| Stop an ODP | You can perform this operation to stop an ODP. |
| Delete an ODP | You can perform this operation to delete an ODP from the cluster. |
| Restart an ODP | You can perform this operation to restart an ODP in the cluster. |
| Upgrade an ODP | You can perform this operation to upgrade an ODP in the cluster. |