Zhihu's Large-Scale OceanBase Adoption and Joint Ecosystem Building
Author: Dai Xiaolei, database lead at Zhihu
1. The Evolution of Zhihu’s Data Architecture
As a Chinese-language internet Q&A community, Zhihu has complex and varied business scenarios and enormous data storage and processing needs. Its database architecture has evolved from a single database to a coexistence of multiple databases.
Initially, it relied mainly on traditional SQL databases (such as MySQL), but as the business scaled up, SQL databases gradually revealed performance bottlenecks under high-concurrency, high-volume scenarios. To meet the needs of different business scenarios, Zhihu gradually introduced multiple database types, including NoSQL databases (such as Redis and MongoDB) and graph databases. Redis is used for caching and fast reads, MongoDB for handling unstructured data, and graph databases for handling complex relational data such as user relationships and content recommendations.

Zhihu wanted to bring in a distributed database to solve the isolation problem between MySQL instances on bare-metal servers and to reduce storage costs. Based on its business needs, it settled on five criteria for selecting a distributed database:
- Business scenarios — These determine the database’s use cases and requirements.
- Database features — ACID, high availability, scalability, multi-tenancy, a cloud-native operator, and so on.
- Operational capability — DBAs need to fully master the techniques for using the database.
- Ecosystem completeness — Surrounding tools such as data migration tools, monitoring and alerting, and backup and recovery.
- Security — Attack resistance, controllability, and open-source code.
2. The Journey of Deploying OceanBase in Zhihu’s Core Scenarios
In the early stage of database selection, two of OceanBase’s capabilities stood out: multi-tenancy and data compression.
Zhihu’s existing MySQL architecture was self-built on cloud vendors’ bare-metal servers, with hundreds of high-spec servers hosting thousands of MySQL instances. Due to a lack of data isolation, the MySQL instances were uneven in size, and resource contention was a clear problem. OceanBase’s multi-tenancy feature effectively addresses the need for resource isolation and reasonable allocation, while its data compression capability is very strong.
(1) Preliminary Research
Before the official go-live, we focused on testing key areas such as compatibility, data migration, and partition table design.
- Compatibility and usage limits — Through functional validation and performance stress testing, we learned about usage limits such as table-length restrictions.
- Partition table design for large tables — A single table was nearly 3 TB, requiring well-designed partitioning rules and partition keys.
- Effective tenant division — Ensuring that resources such as disk, memory, and CPU are fully utilized.

(2) Application Scenarios
After download-based validation, reading the official documentation, conducting thorough research, and joining the community—and after confirming MySQL compatibility and that the product was stable and reliable—we gradually began validating it in non-core business lines first, then core business lines. We migrated large MySQL tables to OceanBase via OMS and observed the performance of incremental data synchronization. Compared with MySQL, OceanBase delivered at least a 30% improvement in read/write performance and at least 2x data compression.

Today, OceanBase has been successfully deployed across multiple business lines at Zhihu, including Zhida (an AI RAG service), security, and education. It has broken through the scaling and storage bottlenecks caused by large MySQL instances, solved the data isolation problem, and delivered cost savings of more than 40%. Zhihu’s OceanBase footprint has reached 7 clusters, containing 33 tenants across 91 high-spec servers.
(3) Plans to Introduce OBKV
We recently plan to apply OBKV to business scenarios as a replacement for Redis. OBKV-Redis is a persistent cache database developed in-house by OceanBase that is fully compatible with the Redis protocol. We imported 900 billion records from our in-house KV database into OBKV-Redis for large-scale stress testing, of which the string-type data reached 210 billion records.

We recommend that, when using OBKV-Redis, you focus on string-type usage; for other data types, conduct thorough testing based on your business needs.
(4) The OceanBase Ecosystem Toolchain
We make full use of the ecosystem tools, including the migration tool OMS, the management and control cloud platform OCP, ob-operator, and OceanBase Dashboard.

OMS supports a variety of database products and real-time synchronization of incremental MySQL changes. In a data migration stress test, it took just one day to migrate all 33.7 billion records to OceanBase, with a peak QPS of 700,000–800,000. So far, we have completed 35 migration tasks involving 54 data sources.

OCP is a powerful graphical operations and management platform that delivers full-lifecycle management.

ob-operator is essentially a Kubernetes-based version of OCP, used to quickly deploy and manage OceanBase clusters, and it provides the GUI-based operations tool OceanBase Dashboard.

3. Joint Building of the Technical Community
In 2023, we co-hosted an “Inside Zhihu” enterprise visit with the OceanBase community, with nearly a hundred attendees on site. We joined the OceanBase community’s cloud-native SIG to explore, together with other members, the application of technologies such as cloud-native, operators, and Kubernetes in OceanBase.
4. Summary & Outlook
By rolling out OceanBase across multiple core business systems, we completed an upgrade and transformation of our technology stack. OceanBase’s multi-tenancy and resource isolation capabilities effectively addressed our resource management pain points; its high compression capability helped reduce storage costs; and OMS, OCP, ob-operator, and others enabled efficient operations.
Looking ahead, we hope to further explore the deep integration of OceanBase with AI and roll out more vectorization scenarios; enrich OCP’s intelligent inspection capabilities and officially promote ob-operator and OceanBase Dashboard; and continue to deepen our cooperation with the OceanBase community to jointly advance OceanBase technology.