The data link of OceanBase Database provides optimal data access from the client to the database. It shields users from the distributed nature of OceanBase Database while providing scalable, high-performance, and highly available services. The data link consists of two parts: database proxy and database drivers.
Database proxy
ODP (OceanBase Database Proxy, also known as obproxy) is a proxy service dedicated to OceanBase Database. OceanBase Database stores data in multiple replicas on OBServer nodes. ODP receives SQL requests from users, forwards the requests to the optimal OBServer node based on the distribution of the data involved in the requests, executes the requests on the OBServer node, and returns the execution results to users.
As a key component of OceanBase Database, ODP has the following features:
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 involved in each user request, the read/write split routing strategy configured by users, the optimal path for multi-region deployment of OceanBase Database, and the status and load of each OBServer node. ODP routes user requests to the optimal OBServer node, maximizing the overall high-performance operation of OceanBase Database.
Connection management
For the physical connections of a client, ODP maintains its connections to multiple OBServer nodes at the backend. It also adopts the incremental synchronization solution based on version numbers to maintain the session status of connections to each OBServer node. This ensures efficient client access to each OBServer node.
Proprietary protocol
By default, ODP and OBServer nodes use the proprietary protocol of OceanBase. For example, ODP performs a cyclic redundancy check (CRC) on messages to ensure the correctness of the connection to each OBServer node. ODP also enhances the transmission protocol to support Oracle-compatible data types and interaction models.
Easy O&M
ODP is stateless and supports unlimited horizontal scale-out. It allows you to access multiple OceanBase clusters at the same time. You can monitor the status of ODP in real time by using various internal commands, which greatly facilitates O&M operations.
For more information about ODP, see Database proxy.
Database drivers
Database drivers are provided by database vendors or vendors that are specialized in database driver development. Database drivers provide an interface for external applications to access databases. Currently, OceanBase Database provides the MySQL-compatible mode, which is compatible with MySQL, and the Oracle-compatible mode, which is compatible with Oracle. In MySQL-compatible mode, users can use official MySQL connectors to access OceanBase Database. In Oracle-compatible mode, users must use the proprietary database drivers of OceanBase Database. The database drivers of OceanBase Database support the MySQL and Oracle modes, and can automatically identify whether OceanBase Database is running in MySQL or Oracle-compatible mode.
Applicability
OceanBase Database Community Edition provides only the MySQL-compatible mode.
OceanBase Database supports database drivers for various languages, including:
OBCI
OceanBase Call Interface (OBCI) is compatible with Oracle Call Interface (OCI) and serves as a C driver that supports the Oracle-compatible mode.
For more information about OBCI, see OBCI.
OceanBase Connector/C
OceanBase Connector/C is compatible with ODBC and serves as a C driver that supports both the MySQL and Oracle modes.
For more information about OceanBase Connector/C, see OceanBase Connector/C.
OceanBase Connector/J
OceanBase Connector/J is compatible with JDBC and serves as a Java driver that supports both the MySQL and Oracle modes.
For more information about OceanBase Connector/J, see OceanBase Connector/J.
For more information about database drivers, see Database drivers.