OceanBase Database distributes data across multiple OBServer nodes in its distributed architecture. OceanBase Database Proxy (ODP), also known as OBProxy, is provided, so that applications can access the distributed architecture of OceanBase Database the same way they access a standalone database. ODP is a reverse proxy service designed for SQL statement routing and disaster recovery in OceanBase Database.
As a core component of a data link, ODP can be deployed in multiple modes.
Deployed with an OBServer node: An ODP and an OBServer node are deployed on the same server. They contend for resources in the case of high traffic, causing difficulties in troubleshooting. This deployment mode is usually used in private cloud scenarios.
Independent deployment: ODP is deployed as a cluster independent of OBServer nodes. This deployment mode is usually used in public cloud scenarios.
Deployed on a client: ODP runs in a container beside the container of the AppServer. ODP and AppServer run in the same pod and can be separately upgraded, published, and maintained. This deployment mode has high requirements for the control skills and is rarely used in practice.
In the first two deployment modes, the AppServer accesses ODP through a load balancer. The load balancer controls high availability and load balancing for ODP. For example, an F5 load balancer distributes requests to multiple ODP instances.
ODP can be provided as instances or SDKs. ODP SDKs are integrated into business code as libraries. Compared with the instance mode, ODP SDKs shorten the access link by one hop and achieve higher performance, and simplify the troubleshooting process. However, their integration causes mutual interference. The upgrade and maintenance of ODP SDKs also affect the business.
After ODP is introduced, a data link in OceanBase Database is as follows: AppServer <-> ODP <-> OBServer nodes. The AppServer accesses ODP by using a database driver to send requests. In the distributed architecture of OceanBase Database, user data is distributed on multiple OBServer nodes through multiple log streams and multiple replicas. ODP forwards requests to the most appropriate OBServer nodes for execution and returns the execution results. Each OBServer node can also provide routing and forwarding capabilities. If an OBServer node cannot execute a received request, it forwards the request to the correct one. This scenario involves remote execution and results in a longer request response time (RT).
As a reverse proxy layer of OceanBase Database, ODP provides routing and disaster recovery from the client to the database, so that applications are unaware of the distributed architecture of the database. An OBServer node has a complete set of SQL engine, storage engine, and distributed transaction engine. It is responsible for parsing SQL statements to generate and execute physical execution plans, and committing transactions based on the Paxos protocol. OBServer nodes provide database services that feature high performance, high availability, and high scalability. ODP is loosely coupled to an OBServer node to tolerate incorrect routing in case that the routing information on ODP is not updated in a timely manner. In this case, the OBServer node forwards the request again. When the OBServer node returns the results, it notifies ODP to update the routing information.
In the data link, the AppServer sends user requests to ODP, and ODP forwards the requests to active OBServer nodes. The execution results are returned to the AppServer through a reverse path. Different components in the data link contribute to high availability in different ways.
References
For more information about data links, see Overview.