OceanBase Database Proxy (ODP) is a dedicated proxy server for OceanBase Database. OceanBase Database stores replicas of user data on multiple OBServers. When ODP receives an SQL statement from a user, ODP forwards the statement to an OBServer and returns the execution result to the user.
Why is ODP required?
Although ODP adds a hop to the database access link, ODP serves as a proxy server that provides various features and benefits. The following figure shows a sample deployment architecture where ODP is used.

As shown in the preceding figure, the application is a business application and is allocated with three OBProxies, which are named after the obproxy process of ODP. In actual deployment, a load balancer such as F5 is deployed between the OBProxies and the application to distribute requests to multiple OBProxies, to which OBServers are connected. Six OBServers are deployed in the sample deployment architecture.
The reasons why ODP is required are as follows:
Connection management: The OBServer cluster contains a large number of OBServers, with a high probability of OBServer or software problems or connection status changes under maintenance. If one of the preceding exceptions occurs when a client is directly connected to an OBServer, the connection will be closed. ODP masks the complexity of distributed OBServers. If a client is connected to ODP, ODP can ensure the stability of the connection and manage the status of OBServers in complex business scenarios.
Data routing: ODP can obtain the information about data distribution on OBServers and forwards SQL statements of users to the OBServer where the required data is located. This improves execution efficiency. As shown in the preceding figure, the data of the t1, t2, and t3 tables is in P1, P2, and P3, respectively. ODP can forward the SQL statement "insert into t1" to the OBServer that contains the P1 leader in Zone 2 and the SQL statement "update t2" to the OBServer that contains the P2 leader in Zone 1.
Based on ODP, a distributed database can be used in a similar manner as a standalone database.
Benefits
ODP is a key component of OceanBase Database and provides the following benefits:
High-performance forwarding
ODP is fully compatible with the MySQL protocol and supports the proprietary protocol of OceanBase. It adopts the multi-threaded asynchronous framework and transparent streaming forwarding to ensure high-performance data forwarding. In addition, it consumes minimal cluster resources.
Optimal routing
ODP fully considers the location of replicas that are included in each user request, read/write split routing strategy configured by each user, optimal procedure for multi-region deployment of OceanBase Database, and the status and load of each OBServer. ODP routes user requests to an OBServer and ensures the performance of OceanBase Database operations.
Connection management
For the physical connections of a client, ODP maintains its connections to multiple OBServers at the backend. It also adopts the incremental data synchronization solution based on version numbers to maintain the session status of each OBServer connection. This ensures efficient client access to each OBServer.
Proprietary protocol
ODP and OBServers use the proprietary protocol of OceanBase Database by default. For example, ODP performs cyclic redundancy checks (CRCs) on messages to ensure the correctness of OBServer connections. ODP also enhances the transmission protocol to support the Oracle-compatible data types and interaction models.
Security and reliability
ODP supports data access by using SSL and is compatible with the MySQL protocol to meet the security requirements of users.
Easy O&M
ODP is stateless and supports unlimited horizontal scale-out. ODP allows users to access multiple OceanBase clusters at the same time. Users can monitor the status of OceanBase Database in real time by using various internal commands. This allows users to perform routine O&M in an efficient manner.
License
ODP Community Edition is fully open sourced under Mulan Public License, Version 2 (Mulan PubL v2). Users can copy and use the source code free of charge. Users must follow the requirements outlined in the license when they modify or distribute the source code.