Backend Development 17 min read

Baidu Comment Middle Platform: Architecture Design and Implementation

Baidu's Comment Middle Platform evolved from a single service into a robust middleware that delivers stable, high‑performance comment functionality across more than twenty products, handling hundreds of millions of daily requests with 99.995% SLA through graph‑based scheduling, tiered caching, and scalable sorting mechanisms.

Baidu Geek Talk
Baidu Geek Talk
Baidu Geek Talk
Baidu Comment Middle Platform: Architecture Design and Implementation

This article introduces Baidu's Comment Middle Platform, which provides stable comment capabilities for Baidu's product ecosystem, handling hundreds of millions of daily requests. The platform has undergone significant architectural transformations from a single business service to a comprehensive middleware platform.

Background: Comments serve as an important way for users to express emotions, attitudes, and viewpoints. A well-designed comment system can enhance user engagement and product stickiness.

Service Design: The platform addresses three key challenges: 1) Business access - enabling quick integration through a unified gateway and service托管 platform; 2) Capability output - abstracting interface capabilities while maintaining generalization; 3) System performance - ensuring 99.99% SLA with isolated logical domains, cache penetration protection, and capacity redundancy.

Technical Solutions:

1. Performance Optimization (4.1): Using a graph engine scheduling model to manage service dependencies. The approach involves: defining atomic service nodes, generating directed acyclic graphs (DAG) for dependency relationships, and implementing automated parallel execution through topological sorting. This transformed the system into one with focused interfaces, clear code boundaries, and flexible data packaging.

2. Comment Sorting (4.2): Building a high-performance sorting system with offline coarse ranking and online fine ranking. The offline service uses a fan-out model in Golang to process comment behavior queues, while the sorting formula is configured for quick A/B testing. The ranking index uses Redis zset data structures to maintain sorted comment lists.

3. Stability Assurance (4.3): Implementing multi-level caching (LRU local cache + Redis), hot spot automatic discovery systems that monitor comment behaviors and trigger pre-building mechanisms, and comprehensive disaster recovery including passive/active degradation, dependency management, and chaos engineering.

Results: The platform now serves 20+ Baidu products with peak QPS exceeding 40w+ and daily PV reaching hundreds of millions, maintaining 99.995% SLA stability.

backend architecturecachingdisaster recoverydistributed systemcomment systemGraph SchedulingBaiduService Optimization
Baidu Geek Talk
Written by

Baidu Geek Talk

Follow us to discover more Baidu tech insights.

0 followers
Reader feedback

How this landed with the community

login 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.