OceanBase

OceanBase is a distributed, scalable, shared-nothing relational DBMS developed by Alibaba. The goal of OceanBase is to serve for financial scenarios which is demanding on performance, cost, scalability and requires database with high availability and strong consistency. It is designed and optimized for diverse OLTP applications on relational structured data, though its shared-nothing structure also supports OLAP applications.

History

In 2010, OceanBase team leader Zhenkun Yang joined Alibaba. Because of the increasing concurrency in Alibaba's business and the shortened development cycle to build a database for new transaction, Yang found that original DBMS can't support for rapidly growing workloads in Alibaba. He decided to abandon the traditional DBMS framework and develop a novel DBMS from scratch. At the very beginning, he presented three kernel principles for their new products: (1) distributed (2) low cost (3) high reliability.
In 2013, Alipay decided to abandon Oracle. Since MySQL can't ensure strong consistency between active server and standby server, OceanBase got its first opportunity. From now on, OceanBase is not open sourced anymore.
From 2014 to 2016, this team spend three years developing OceanBase 1.0. It is the first and only commercial DBMS which supports distributed transactions.
From 2017, OceanBase started to serve for external customers.
In 2019, OceanBase beat Oracle and won the first place in TPC-C test.

System Architecture

Shared-Nothing

Views

Materialized Views

OceanBase supports materialized view well.
Their first business, Taobao Favorites, is done by leveraging materialized views.

Compression

Dictionary Encoding Delta Encoding Run-Length Encoding Prefix Compression

OceanBase uses column compression for SSTable in disk. It implements several encoding algorithm and it will automatically choose the most suitable one for every column. It costs only half as much space as MySQL does.

Query Interface

SQL

Stored Procedures

Not Supported

Storage Organization

Heaps

Storage Architecture

Disk-oriented

OceanBase divides its systems into regions, every region has multiple zones, every zone has multiple ObServers, every ObServer has multiple partitions. Several Zones would store the same data to provide backup. Typically, there are four merge algorithms to choose from:

Concurrency Control

Multi-version Concurrency Control (MVCC)

OceanBase adopts MVCC to do concurrency control. If the operation involves single partition or multiple partition on one ObServer, it will read the snapshot of that ObServer. If the operation involves partitions on multiple ObServer, it executes distributed snapshot read.

Checkpoints

Not Supported

Unlike traditional relational DBMS, OceanBase doesn't require and doesn't rely on checkpoint to ensure data consistency. There are two reasons for this:
(1) OceanBase is deployed across zones with multi-copy data.
(2) In actual production, OceanBase stores the modification of data in MemTable in memory and merges that to SSTable in disk once everyday.
There are multiple merge strategy choice, this will be covered in Storage Architecture part.

Data Model

Relational

OceanBase Logo
Website

https://oceanbase.alipay.com/

Source Code

https://github.com/alibaba/oceanbase

Tech Docs

https://oceanbase.alipay.com/docs

Developer

Alibaba

Country of Origin

CN

Start Year

2013

Project Type

Commercial

Written in

C++

Supported languages

C, C++, Java

Compatible With

MySQL

Operating Systems

Hosted, Linux

Licenses

GPL v2