How Zhihu Scaled Its Data Architecture with OceanBase: A Multi‑Database Journey
Zhihu’s evolving data architecture transitioned from a single MySQL setup to a heterogeneous ecosystem of SQL, NoSQL, and graph databases, ultimately adopting OceanBase for its multi‑tenant, high‑compression capabilities, supported by tools like OMS, OCP, and ob‑operator to achieve cost savings, performance gains, and robust operations.
1. Zhihu Data Architecture Evolution
Zhihu, a major Chinese Q&A community, initially relied on traditional SQL databases such as MySQL. As traffic grew, performance bottlenecks emerged, prompting the introduction of multiple database types: SQL (MySQL/TiDB/OceanBase/PolarDB), NoSQL (Redis, MongoDB), and graph databases for caching, unstructured data, and relationship handling.
The team also sought a distributed database to isolate MySQL instances on bare‑metal servers and reduce storage costs, defining five selection criteria: business scenario, database features, operational capability, ecosystem completeness, and security.
2. OceanBase in Zhihu Core Scenarios
OceanBase was chosen for its strong multi‑tenant and data‑compression abilities. Zhihu’s original MySQL architecture used hundreds of high‑spec servers hosting thousands of MySQL instances, leading to resource imbalance and isolation problems. OceanBase’s tenant isolation and compression solved these issues, improving resource utilization and cutting storage costs.
(1) Preliminary Research – Compatibility tests, data migration, and partitioned table design were evaluated.
(2) Large‑Table Partition Design – MySQL tables up to 3 TB required careful partitioning when migrated to OceanBase, involving DBA and business teams to choose appropriate partition keys and strategies.
(3) Effective Tenant Division – Balancing storage‑heavy and compute‑heavy tenants to maximize CPU, memory, and disk usage.
(4) Application Scenarios – Performance tests showed OceanBase delivering at least 30 % higher read/write throughput and 2× better compression than MySQL.
OceanBase now powers Zhihu’s direct answer (AI RAG) service, security, education, and other lines, eliminating MySQL scaling limits, achieving over 40 % cost reduction, and operating 7 clusters, 33 tenants, and 91 high‑spec servers.
3. OBKV‑Redis Introduction
Zhihu plans to replace Redis with OBKV‑Redis, a fully compatible, persistent cache built on OceanBase. Large‑scale stress tests imported billions of key‑value, sorted‑set, and hash records, confirming suitability for massive KV workloads.
4. OceanBase Ecosystem Toolchain
Key tools enable seamless adoption:
OMS – Data migration and sync tool supporting multi‑source ingestion, real‑time change capture, and high‑throughput imports (up to 800 k QPS).
OCP – Graphical operation platform for full lifecycle management of OceanBase clusters, including tenant ops, monitoring, and resource allocation.
ob‑operator – Kubernetes‑native operator that automates deployment, scaling, and management of OceanBase clusters, integrating with OceanBase Dashboard for visual control.
5. Community Collaboration
Zhihu actively contributes to the OceanBase community, co‑hosting events, joining the Cloud Native SIG, and sharing operational experiences to foster ecosystem growth.
6. Summary & Outlook
Adopting OceanBase transformed Zhihu’s technology stack, delivering multi‑tenant isolation, high compression, and efficient migration, while OBKV‑Redis broadened storage capabilities. Future plans include deeper AI integration, intelligent OCP inspections, and continued community engagement to advance distributed database technology.
Xiaolei Talks DB
Sharing daily database operations insights, from distributed databases to cloud migration. Author: Dai Xiaolei, with 10+ years of DB ops and development experience. Your support is appreciated.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.