Databases 27 min read

Database Automation Platform at Meituan: Architecture, Practices, and Lessons

Meituan’s Database Automation Platform evolved from a simple Django‑based 1.0 system into a modular 2.0 architecture using CMDB, RabbitMQ, and Celery, standardizing metadata, providing self‑service APIs, and automating tasks such as cluster provisioning, online schema changes, and high‑availability failover, now handling hundreds of daily operations for over a thousand developers while planning further component‑library refactoring.

Meituan Technology Team
Meituan Technology Team
Meituan Technology Team
Database Automation Platform at Meituan: Architecture, Practices, and Lessons

This article summarizes the 10th Meituan-Dianping Tech Salon, focusing on the design and practice of database automation and operation platforms.

Before automation, DBAs faced many repetitive manual tasks: provisioning new clusters, handling traffic spikes, SQL review, upgrades, backups, account management, DNS and IP maintenance, and incident handling. These pain points limited scalability and DBA growth.

The first version (1.0) of the platform introduced a simple Django‑MVC front‑end, a task table for user requests, and a background worker that pulled tasks, executed scripts, and wrote logs back. It supported online DDL, account requests, and slow‑query monitoring, serving about 600 users with 1,840 daily orders.

Feedback from 1.0 highlighted three major issues: heavy dependency on frameworks, lack of API integration, and limited concurrency. Consequently, version 2.0 was built with three principles – standardization, self‑service, and automation – and adopted a modular architecture using CMDB, RabbitMQ, and Celery.

Key components of 2.0 include:

CMDB for standardized metadata.

API layer that unifies front‑end and script interactions.

Task management powered by RabbitMQ and Celery, enabling dynamic process forking and high concurrency.

Three practical cases were demonstrated:

Cluster provisioning: A four‑layer architecture (business → virtual IP → middleware (Atlas) → MySQL master‑slave) is built via a guided UI, with selectable packages, VM/IP allocation, and automatic JSON generation for API submission.

Online schema change: The platform performs syntax and semantic checks (using test databases or sqlparser), leverages pt-online-schema-change for non‑blocking DDL, and provides RD with detailed error messages and a “continue with DBA approval” option.

High‑availability (MHA) solution: Automated failover monitors master health via sentinel nodes, triggers MHA for master‑slave switch, updates CMDB, notifies middleware, and restores service within ~10 seconds.

After deployment, the system processes over 300 RD operations per day, serving more than 1,400 developers, with metrics tracked for user count, task success rate, and feature coverage.

Future plans aim to refactor the architecture into core function and component libraries (e.g., DNS, Atlas, monitoring) to simplify API logic, improve CMDB governance, and enable broader participation from DBAs and developers.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

high availabilitytask schedulingDevOpsmysqlCMDBdatabase automation
Meituan Technology Team
Written by

Meituan Technology Team

Over 10,000 engineers powering China’s leading lifestyle services e‑commerce platform. Supporting hundreds of millions of consumers, millions of merchants across 2,000+ industries. This is the public channel for the tech teams behind Meituan, Dianping, Meituan Waimai, Meituan Select, and related services.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.