🚀 DevOps Certified Professional
📅 Starting: 1st of Every Month 🤝 +91 8409492687 | 🤝 +1 (469) 756-6329 🔍 Contact@DevOpsSchool.com

OceanBase: The Distributed Database Powering the Future of Enterprise Applications

DevOps

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

What is OceanBase?

OceanBase is a distributed relational database system designed to deliver high performance, high availability, and horizontal scalability for critical enterprise applications.
Developed originally by Ant Group (an affiliate of Alibaba Group), OceanBase is engineered to meet the extreme demands of financial institutions, e-commerce platforms, and large-scale Internet applications.

OceanBase blends the benefits of traditional RDBMS (supporting SQL, ACID transactions) with the strengths of cloud-native distributed architecture (elastic scalability, fault tolerance).
It supports standard SQL, high transaction throughput, strong data consistency, and flexible scaling — all while minimizing operational costs compared to traditional databases like Oracle or PostgreSQL.

OceanBase today powers some of the world’s largest banking systems, online payment systems, and financial service providers — and it’s increasingly available as both on-premises and cloud-native offerings.


What are the Major Use Cases of OceanBase?

OceanBase is adopted across industries that demand ultra-high performance, reliability, and cost-effectiveness. Major use cases include:

  • Financial Services and Banking:
    • Core banking systems
    • Payment transaction systems
    • Loan management and credit risk evaluation platforms
  • E-commerce Platforms:
    • Shopping cart systems
    • Inventory and logistics databases
    • Real-time order processing
  • Telecommunications:
    • Customer information management
    • Billing systems
    • Subscription services
  • Cloud Service Providers:
    • Database-as-a-Service (DBaaS) offerings
    • Multi-tenant database platforms
  • Insurance and Healthcare:
    • Policy management
    • Claims processing
    • Patient data systems
  • Large-scale SaaS Applications:
    • CRM systems
    • Enterprise Resource Planning (ERP) backends
    • High-concurrency applications needing ACID compliance
  • Gaming and Social Media:
    • User account management
    • In-game transaction systems
    • Messaging and social feed databases

OceanBase offers a serious alternative to Oracle, MySQL, and PostgreSQL for organizations seeking scalability without compromising transactional integrity.


How OceanBase Works Along with Architecture

OceanBase is built with a shared-nothing distributed architecture, meaning every node operates independently with its own resources (CPU, storage, memory), eliminating single points of failure and bottlenecks.


Core Components:

  • OBServer (Database Node):
    The fundamental running unit responsible for storing data, processing queries, and transactions.
  • OBProxy (Connection Proxy):
    A lightweight stateless proxy that routes database traffic to the appropriate OBServer nodes, handling load balancing and failover.
  • RootService (Cluster Manager):
    Manages metadata, resource allocation, tenant management, and scaling decisions.
  • Partitioning & Replication:
    Data is partitioned horizontally across nodes (sharding), and each partition is replicated multiple times for high availability (using multi-replica Paxos-based consensus).
  • Tenant-Based Model:
    OceanBase supports multi-tenancy, allowing multiple logical databases (tenants) to run on the same physical cluster with resource isolation.
  • Strong Consistency and Elastic Scalability:
    Transactions across partitions are supported with a Two-Phase Commit (2PC) protocol ensuring ACID guarantees while scaling out horizontally as demand grows.

Simplified Architecture Diagram:

Client Apps
    ↓
OBProxy Layer (Load Balancer)
    ↓
OceanBase Cluster
    ↳ OBServer (Data Nodes) [Partitions, Replicas]
    ↳ RootService (Cluster Management)
Storage Layer (Local or Cloud)

What is the Basic Workflow of OceanBase?

Here’s the basic operation flow for OceanBase:

  1. Client Connection:
    Applications connect via OBProxy or directly to OBServer nodes.
  2. Request Routing:
    OBProxy routes the request to the appropriate server node based on partitioning metadata.
  3. Query Processing:
    OBServer processes SQL queries, retrieves or updates partitioned data, handles transaction management, and ensures consistency.
  4. Transaction Commitment:
    Multi-partition transactions are managed using Two-Phase Commit (2PC) to maintain ACID compliance.
  5. Replication Management:
    Data is written to multiple replicas (leader-follower model) to ensure redundancy and high availability.
  6. Failure Handling:
    In case of node failure, replica nodes automatically elect a new leader without service interruption.
  7. Scaling Operations:
    New OBServer nodes can be added dynamically for scaling out; partitions are rebalanced automatically across the new nodes.

Step-by-Step Getting Started Guide for OceanBase

Want to dive into OceanBase? Here’s a simple starting guide:


Step 1: Install Prerequisites

  • Prepare Linux servers (or VMs or containers).
  • Minimum hardware: 4 CPUs, 8 GB RAM, 100 GB storage.
  • Required software:
    • CentOS 7+ or Ubuntu 18.04+
    • GCC, Make, CMake, Java (for management tools)

Step 2: Download OceanBase

You can download OceanBase Community Edition:

git clone https://github.com/oceanbase/oceanbase.git
cd oceanbase

Or use the OceanBase official installation packages.


Step 3: Install OceanBase CE (Community Edition)

Use obdeploy (OceanBase deployment tool) for simplified installation:

git clone https://github.com/oceanbase/obdeploy.git
cd obdeploy
./bootstrap.sh

Create a cluster configuration file (mini-local.yaml template is available) and deploy:

obd cluster deploy my_ob_cluster -c mini-local.yaml

Start the cluster:

obd cluster start my_ob_cluster

Step 4: Connect to OceanBase Cluster

Install MySQL client or use obclient (OceanBase client):

obclient -h127.0.0.1 -uroot@sys#obcluster -P2881 -p

You will now be connected to the OceanBase cluster and can run SQL commands!


Step 5: Create Tenant and Database

Create a tenant:

CREATE TENANT IF NOT EXISTS mytenant;

Switch to tenant:

ALTER SYSTEM SET current_tenant = mytenant;

Create a database and start building your applications:

CREATE DATABASE mydb;
USE mydb;
CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(100));
Subscribe
Notify of
guest


This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x