How Baidu Scaled Its Live Streaming SDK into a Flexible, Platform‑Ready Architecture
This article details Baidu Live's transformation from a monolithic Xcode project into a modular, EasyBox‑driven SDK with multi‑repo support, automated integration tools, and differentiated builds, highlighting the engineering challenges, step‑by‑step refactor, and measurable efficiency gains.
Background
Baidu Live was positioned as a live‑streaming SDK to empower internal Baidu apps. Rapid business growth and expanding codebase exposed two major issues: (1) engineering‑level problems such as low development efficiency, heavy business‑code coupling, and macro‑based host binding that hindered differentiated SDK output; (2) integration‑process problems including difficult customization, time‑consuming configuration debugging, and numerous protocols.
Engineering problems: native project structure reduced efficiency, tight coupling, and macro definitions made SDK differentiation hard.
Integration problems: customization difficulty, lengthy debugging, and many protocols.
The team iteratively refactored the architecture without affecting business iteration or scaling, aiming for a flexible, high‑performance platform‑level SDK.
Engineering Refactor
1. Project restructuring with EasyBox
The original engineering relied on nested Xcode projects, which caused many drawbacks. By adopting Baidu’s internally built EasyBox toolchain, the project was standardized into a template‑based structure. EasyBox introduced three layers:
Shell layer – the compilation environment for the Live SDK.
MixTure build layer – controls differentiated builds via EasyBox variants and link_dependency for free combination of SDK artifacts.
Business layer – core live streaming functionality.
Base library layer.
Host platform and third‑party dependency layer.
This restructuring clarified dependency relationships and prevented layer‑level dependency fragmentation.
2. Multi‑repo and component template split
The monorepo approach led to severe business coupling and lack of permission isolation. Transitioning to a multirepo model, supported by EasyBox, the team split the business repository into multiple component templates:
Extracted a Service layer from the Business layer to centralize common capabilities.
Separated core live container components to provide essential live‑room functionality.
Modularized live‑room features into a reusable component/plugin pool.
Divided Business layer components by template, assigning them to specific live‑room components or plugins.
3. Supporting SDK differentiation
Different hosts require highly customized SDKs. While EasyBox can handle variant‑based builds, it is insufficient for fine‑grained component customization. Live introduced a registration module for each component, dispatching events to a central Pyramid. By separating implementation ( impl) from interface, only required components are compiled, and cross‑component dependencies are prohibited, enabling true differentiated builds.
Integration Efficiency Optimizations
1. Automated integration platform
Because the SDK offers many optional features and numerous upstream/downstream dependencies, integrating a new host was costly. An automated visual packaging platform was built, allowing hosts to submit integration requests, select required features, and receive a built SDK artifact after approval.
2. Fast source debugging and mapping
Live’s codebase is massive; traditional EasyBox configuration required importing all repositories, leading to complex setup and compile issues. A custom source‑debugging plugin was created to configure live source debugging with a single click and to map small component binaries, simplifying troubleshooting.
3. Integration protocol optimization
Frequent SDK iterations expose many protocols, each adding integration cost. Live provides a set of binary components that implement common protocols, allowing hosts to include only the needed ones, thereby reducing integration effort.
Benefits
Using EasyBox and mgit reduced engineering complexity and development cost for live‑streaming teams.
The differentiated build design enables vertical product customization without intruding on core live logic, allowing flexible component trimming.
The automated integration platform dramatically lowers communication overhead and standardizes SDK adoption.
The EasyBox source‑debugging plugin speeds up host debugging.
Conclusion
Building on the EasyBox toolchain and addressing Baidu Live’s specific requirements, the engineering transformation—from project restructuring to integration automation—has fundamentally improved development efficiency and accelerated product delivery.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
