Migrating from HBase to OceanBase: The Ultimate Solution for Real-Time Data Writes with Flink
Are you frustrated by HBase’s high operations costs?
Are you looking for the best target storage solution for real-time data streams?
Flink + OceanBase OBKV-HBase may be the answer you’ve been waiting for!
Why Should You Care About This Solution?
Scenario 1: The “Last Mile” of HBase Migration
If your team is considering migrating from HBase to OceanBase but worries: how can the existing Flink real-time data streams migrate seamlessly? How can HBase API compatibility be guaranteed? Can throughput, latency, and stability after migration meet production requirements?
This solution is made exactly for you! OceanBase OBKV-HBase is fully compatible with the HBase API and, paired with the Flink connector, lets you migrate smoothly.
Scenario 2: “Data Ingestion” in Real-Time Data Warehouse Construction
If you’re building a real-time data warehouse and need to write the real-time data streams from Kafka into wide-table storage, support high-concurrency writes while meeting near-real-time query and analysis needs, and guarantee data consistency and reliability.
The Flink + OceanBase combination can perfectly solve your pain points! Flink handles stream processing, and OceanBase handles online storage and querying.
Scenario 3: Data Storage in AI/LLM Applications
In the AI era, OceanBase’s HBase mode naturally supports flexible table structures, and paired with Flink’s real-time processing capabilities, you can easily build the data foundation for AI applications.
Core Advantages: Why Choose OceanBase OBKV-HBase?
🚀 HBase API Compatibility
For developers familiar with HBase, the migration cost is nearly zero! Just modify the connection configuration to switch over seamlessly.
⚡ High-Performance Real-Time Writes
Supports buffered batch writes: high-throughput data import for batch scenarios, and millisecond-level latency for real-time scenarios.
🔄 Unified Stream-Batch Processing
Supports both Flink’s streaming writes and batch writes—one system meets multiple needs.
🛡️ Enterprise-Grade Reliability
A robust fault-tolerance mechanism, OceanBase’s native high availability, and support for multi-replica high availability and strong consistency.
Quick Start
OBKV-HBase is OceanBase’s wide-table database compatible with the HBase interface. The Flink OBKV HBase connector (flink-connector-obkv-hbase) is implemented on obkv-hbase-client-java and supports writing data in real time to OceanBase’s HBase-mode tables via Flink SQL.
Step 1: Create an HBase Table
In OceanBase, HBase tables are mapped via a naming convention: each column family corresponds to one physical table, in the format hbase_table_name$family_name.
1 | CREATE TABLE `user_info$basic` ( |
Steps 2-4: Start Flink → Create the Mapping Table
1 | CREATE TABLE user_info_sink ( |
Steps 5-6: Write Test Data and Verify
1 | INSERT INTO user_info_sink VALUES |
Configuration Parameters
Required Parameters
- connector: fixed value obkv-hbase
- username: format user@tenant#cluster
- password: user password
- schema-name: database name
- table-name: HBase table name
Connection Modes
Config URL mode (direct connection): requires url, sys.username, sys.password
ODP mode (proxy): set odp-mode=true, odp-ip, odp-port
Performance Tuning
- sync-write: whether to write synchronously (default false, buffer recommended)
- buffer-flush.buffer-size: buffer size (default 1000 rows)
- buffer-flush.interval: flush interval (default 1s)
- max-retries: maximum number of retries (default 3)
Usage Example
Real-Time Writes from Kafka
1 | CREATE TABLE kafka_source ( |
Best Practices
Performance Optimization
- High-throughput batch: buffer-size=5000, interval=5s
- Low-latency real-time: buffer-size=500, interval=500ms
- Ultra-low latency: sync-write=true
Troubleshooting
- Connection failure: check the network, verify the username and password, confirm the ODP configuration
- Write failure: check the Flink logs, verify the table structure, confirm permissions
- Slow performance: increase the buffer, raise parallelism, check cluster load
Reference Information
- OceanBase official documentation: https://www.oceanbase.com/docs
- Flink official documentation: https://nightlies.apache.org/flink/flink-docs-stable/
- GitHub: https://github.com/oceanbase/flink-connector-oceanbase
- obkv-hbase-client-java: https://github.com/oceanbase/obkv-hbase-client-java
Thanks to Sun Chaoyang and Zhao Mingyuan from the ecosystem team for their professional guidance.