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 well.
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 perfectly by leveraging materialized views.
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.
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:
Unlike tradition 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, so it can suffer from ObSingle server shut down without checkpoint. (2) In actual production, OceanBase stores the modification of data in `MemTable` in memory and merges that to `SSTable` in disk once everyday. This read-write isolation mechanism doesn't require frequent checkpoint. There are multiple merge strategy choice, this will be covered in Storage Architecture part.
OceanBase uses column compression for `SSTable` in disk. It implements diverse encoding algorithm and it will automatically choose the most suitable one for every column. It costs only half as much space as MySQL does.
C, C++, Java