OceanBase Learning Notes (Part 1): Getting It Running in Docker
Our production stack runs on Kubernetes + OceanBase. Slightly embarrassing to admit, but I had never really worked with a distributed database before — my mental model was still “one MySQL / Oracle instance on one box.” With the team moving onto OB, I couldn’t stay the person who only knows SELECT, so I started digging in. I happened to have a Windows 11 machine with Docker Desktop already installed, so I followed the official quick start, got the community edition running locally, and took notes as I went.
This is the first note in a learning-notes series, not an authoritative tutorial. A fair bit of it is me recording where I was wrong — “I assumed X, then found out Y” — so I don’t repeat it. Corrections are very welcome.
1. First: what exactly is OB?
My first instinct was to file it under “a MySQL cluster with extra steps.” It really isn’t.
OceanBase is a natively distributed database, not “a single-node database with a middleware bolted on top.” The basics:
- Shared-Nothing architecture: every server is a peer, there are no special hardware requirements, and high availability comes from keeping multiple replicas of the data.
- Each server runs a single process called observer, which does both storage and compute; data files and redo logs sit on local disk.
- It is compatible with both MySQL and Oracle. You can connect with a regular MySQL client / driver, or with OB’s own
obclient. - The storage engine underneath is an LSM-Tree (MemTable plus layered SSTables), not the B+ tree world I was used to — you feel the difference later in compression ratio and write throughput.
One sentence to hold onto: distribution is built into the kernel, not outsourced to middleware.
Here’s the diagram that gave me my first working mental model — a cluster is made of several Zones, each Zone holds peer OBServers, and one piece of data has a replica in several Zones:

Multiple Zones, multiple replicas; one observer process per server; RootService rides on one of them.
2. The terms that kept tripping me up
These words came up over and over in the docs, and I had to look each one up before anything made sense.
Zone (availability zone)
A logical concept meaning “a group of nodes in the cluster with similar hardware availability.” If the whole cluster sits in one data center, a Zone might be one rack or one switch; if it spans data centers, a Zone usually corresponds to one data center. The rule that matters: within a single Zone there is only one replica of a given piece of data — the multiple replicas live in different Zones, kept consistent by a consensus protocol. So the number of Zones directly decides how many failures you can tolerate.
OBServer
Simply the observer process running on each server — the database instance. Nothing fancy: one node, one process.
RootService
This one surprised me. There is a “master control” service in the cluster handling resource management, disaster recovery, load balancing and schema management — but it is not a separate management node. It rides on one of the OBServers, and if that machine dies the others elect a new one (also via Paxos-style election). I had assumed there would be a dedicated manager box. There isn’t.
Log stream + Paxos
This is the heart of OB’s consistency. The redo log of each partition (Tablet) flows into a log stream, and the log stream has replicas across Zones. One of them is the leader; only the leader accepts writes. A write only counts as committed once a majority of replicas has persisted the redo log. The leader holds a lease — if it stops renewing, the followers elect a new leader.
I wrestled with this for a while: why not just use primary-standby replication? The answer I landed on: majority commit means “lose a minority of nodes and the service is unaffected.” That is what lets a distributed database talk about high availability at all. (Part 3 goes deeper, including the lease and what GTS actually does.)
Tenant
OB is multi-tenant: one cluster can host many tenants, and to the user each tenant looks like a standalone database instance, with CPU, memory and IO isolated from its neighbours. A tenant also picks a compatibility mode (MySQL or Oracle). This model is very different from “one instance, one database,” and I kept confusing the three layers — cluster, tenant, database — for a while.
Tablet
The smallest unit of storage: one table, or one partition of a partitioned table, maps to a Tablet. It is the unit that gets distributed, balanced and replicated.
3. Hands-on: running it in Docker Desktop
Theory was making my head spin, so I got my hands dirty. I ran the official community image in Docker Desktop on Windows 11, with MINI_MODE to keep the resource footprint as small as possible. The official prerequisite is a machine with at least 2 cores and 8GB of available resources; with mini mode the observer itself actually sits much lower than that (the common figure in the community is roughly 2–4GB), so an ordinary dev machine can handle it.
Starting it is one command:
docker run --name obstandalone -e MINI_MODE='true' -p 2881:2881 -p 2882:2882 -d oceanbase/oceanbase-ce
A few notes so you don’t get stuck where I did:
2881is the SQL port (MySQL protocol),2882is the internal RPC port — map both.MINI_MODE='true'is for local experimentation only; don’t run production this way.- The image is
oceanbase/oceanbase-ce, the community edition, free.
Once it’s up, don’t connect immediately — the first boot has to initialise, which takes a few minutes. Watch the log and wait for boot success!:
docker logs -f obstandalone
There are two ways to connect. One is to use the bundled obclient inside the container:
docker exec -it obstandalone obclient -h127.0.0.1 -P2881 -uroot@sys -A
Since the port is published, you can also connect from your Windows host with any MySQL client to 127.0.0.1:2881, user root@sys, no password by default.
First thing to look at once you’re in — which tenants exist:
SHOW TENANTS;
-- or for more detail, query this system view
SELECT TENANT_NAME, TENANT_TYPE, STATUS FROM oceanbase.DBA_OB_TENANTS;
There is always a sys tenant; it’s the system tenant that manages the cluster. For real business data you create a separate user tenant (MySQL or Oracle mode). That involves resource pools and Units, which I hadn’t fully sorted out yet — I left it for its own post.
4. First impressions & the gotchas I hit
- Booting is genuinely slow. Two or three minutes is normal. If the log looks frozen it hasn’t died — wait for
boot success!. - It wants memory. Even with MINI_MODE, starve it and the observer either fails to start or keeps restarting. Give your local machine some headroom.
- Keep the ports straight. Apps connect to
2881(MySQL protocol);2882is internal. Don’t mix them up. - You land in the
systenant, and root has no password. Butsysis not where your business data goes — the proper move is to create a dedicated tenant. - The biggest mental jolt: there is no such thing as “single node” here. Even one container is “a cluster with one node,” and the logic underneath is fully distributed. My old reflex of “this database is down, so we’re down” has to become “a Zone is down, the Paxos majority is still there, the service keeps going.”
5. Wrap-up & what’s next
- OceanBase is a natively distributed database: Shared-Nothing, single observer process, MySQL / Oracle compatible, LSM-Tree storage.
- The key to understanding it is chewing through Zone / OBServer / RootService / log stream (Paxos) / tenant / Tablet — especially multi-tenancy and Paxos majority, which are the parts least like a standalone database.
- Locally, Docker + MINI_MODE gets you running in a couple of commands, but be ready for a slow boot and a real memory appetite.
For our K8s + OB setup, getting Zones, tenants and Paxos straight is what keeps me from going blank when I’m actually operating it. Next up: I create a real MySQL tenant, put some data in it, try a distributed query, and look at how OBProxy routes SQL.
References:






