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.
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.
OceanBase supports materialized view well.
Their first business, Taobao Favorites, is done by leveraging materialized views.
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.
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:
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.
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.