Evolution of Baidu Visual Search Architecture: Stack Upgrade, Full‑Link Refactoring, and Stability Enhancements
Baidu Visual Search upgraded its PHP/HHVM stack to Golang, introduced a Backend‑For‑Frontend layer, refactored presentation and system modules with the GDP framework and ExGraph, and built comprehensive monitoring and self‑healing tools, delivering a modular, scalable, and stable AI‑driven search platform.
This article presents an in‑depth discussion of how Baidu Visual Search has strengthened its competitiveness and adaptability through continuous technical innovation and architectural upgrades, supporting healthy and efficient business iteration.
Background : Visual Search, based on image recognition and deep learning, differs from traditional text search by accepting user‑uploaded images and returning related results. Rapid product iteration and scaling have created new technical challenges that require ongoing innovation.
Key Challenges include:
Technology stack update: The existing presentation layer built with PHP and HHVM faces maintenance and concurrency limitations, prompting a migration to a next‑generation framework and language.
Architecture capability upgrade: Growing business demands have led to large monolithic modules and complex interactions, necessitating a systematic refactor.
Stability assurance: Upgrading the stack and architecture requires parallel improvements in testing pipelines, monitoring, and incident‑handling tools.
Solution Overview :
Overall Design : Introduce a Visual BFF (Backend‑For‑Frontend) for unified multi‑device routing, migrate the stack from PHP+HHVM to Golang, and rewrite the presentation module using Baidu’s internal GDP framework and ExGraph graph engine.
Detailed Design :
2.1 Access Module Construction : The Visual BFF handles service initialization, multi‑device adaptation, dynamic routing, and result output, decoupling front‑end concerns from business logic.
2.2 Presentation Module Refactor : Using Golang and the GDP framework, the module is split into independent components, organized into logical layers, and transformed into a graph‑based workflow with ExGraph. Public operators (e.g., image upload, caching, risk control, retrieval, rendering) are encapsulated for reuse, and strategy groups manage personalization.
2.3 System Layer Refactor : Redefine module responsibilities, unify data protocols, and consolidate retrieval interfaces to reduce coupling, improve parallelism, and simplify debugging.
2.4 Stability Construction :
Fault perception: Deploy Prometheus‑based monitoring via the GDP framework, defining baseline, framework, business, downstream, and end‑to‑end metrics.
Fault handling: Implement ALM‑driven automatic instance migration and elastic scaling for self‑healing.
Root‑cause analysis: Use Go’s pprof and a custom Keeper collector to capture performance snapshots on alerts.
Supporting platforms: Provide a simulation/debug platform, trace platform, and rapid environment provisioning tools.
Conclusion : By updating the technology stack, enhancing architectural capabilities, and establishing comprehensive stability infrastructure, Baidu Visual Search achieves a more modular, scalable, and maintainable system. The presented practices aim to guide similar large‑scale, AI‑driven services facing rapid growth and evolving model requirements.
Baidu Geek Talk
Follow us to discover more Baidu tech insights.
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.