Projects & Case Studies 重点项目总结
Selected Engineering Work 代表性工程实践
Architecture, trade-offs, and lessons from building platform capabilities across thousands of Go production services. Longer deep-dive write-ups for individual projects will be linked here as they are published.
围绕数千个 Go 生产服务的平台建设、全站效率优化与 AI 原生转型的架构取舍、方法论与复盘。后续每个专题的详细技术长文都将陆续链接到这里。
2025–2026
Fleet-Wide Go CPU Efficiency Program Go 全站 CPU 效率专项
Targeted 1,000+ Go services using 100 or more cores, delivering every optimisation lever through GAS platform upgrades with minimal or zero business-team effort.
聚焦 CPU ≥100 核的 1,000+ 个 Go 服务,所有优化杠杆均通过 GAS 升级落地,建立起从热点分析、验证、灰度到收益测量的端到端闭环。
- Platform-led PGO (≈60K cores): Self-service onboarding reached only ≈10 services in two months; re-architected into automated profile collection, build-time injection, and canary rollout across ≈800 services with a ≈4.8% median gain and zero PGO incidents.
- Runtime-controlled GC & Sonic JSON (≈57K cores): Identified hotspots by aggregating peak profiles across the top 100 services; validated via dry runs, 50/50 instance splits before full-link load tests, peak-sale grouped benefit measurement, and seconds-level rollback across 200+ services.
- Lessons from Combined Deployment (≈3K cores, stopped mid-2025): Even with automated cascaded deployment and isolated logs/metrics, co-locating upstream and downstream services in one process erases microservice isolation—coupling release cycles, turning dependency panics into caller outages, and complicating container troubleshooting permissions.
- 平台主导的 PGO(约 6 万核):自助接入两个月仅约 10 个服务;重构为自动 profile 采集聚合、编译期自动植入与 canary 灰度收益测量,业务团队零参与下覆盖约 800 个服务,收益率中位数约 4.8%,无相关事故。
- 运行期动态控制的 GC 与 Sonic JSON(约 5.7 万核):通过前 100 高消耗服务的峰值 profile 聚合定位热点,依托 dry run、全链路压测前 50/50 实例分组封板、大促峰值分组核算收益与秒级回滚,覆盖 200+ 服务且无线上事故。
- 合并编译的架构教训(约 0.3 万核,2025 年中停止推广):即便具备自动级联发布与日志/指标隔离,同一进程仍抹掉了微服务的隔离边界——发布周期耦合、被依赖方 panic 拖垮调用方、排障权限边界混乱;真正能规模化的杠杆都由平台统一开关与度量。
2023–2024
GAS: Go Application Server & Transparent Upgrades GAS:Go 应用服务器与透明升级平台
Built from scratch to decouple business iteration from infrastructure iteration, powering 90%+ of Go CPU in Shopee Marketplace and ≈60% Shopee-wide.
从零设计并建设,将业务迭代与基础架构迭代解耦,现覆盖 Shopee Marketplace 业务部门 90%+ Go CPU 及全 Shopee 约 60% Go CPU。
- SPI/SP layering & build-time composition: Business code depends only on stable Service Provider Interfaces (SPIs); swappable Service Providers (SPs) and the unified IoC server engine are composed at build time via code generation and go.mod rewriting (chosen after prototyping Go plugins and hitting runtime version panics).
- Proactive transparent upgrades: Platform maintainers rebuild services at the same commit on a new engine version and release via multi-stage automated canary analysis, upgrading 83–87% of targeted services each quarter of 2025 with no business-code edits.
- SSA migration verification: Used SSA-based static call-stack analysis to uncover services that appeared migrated yet still imported open-source libraries directly, ensuring real upgrade reach across 1,700+ Marketplace services.
- SPI/SP 分层与构建期拼装:业务代码只依赖稳定的 SPI 接口,底层可替换的 SP 实现与统一 server/IoC engine 在构建期通过代码生成和改写 go.mod 拼装(原型验证 Go plugin 存在版本不一致导致的 runtime panic 后舍弃)。
- 自动 canary 驱动的透明升级:平台维护者基于同一 commit 使用新版 engine 重新构建,经多阶段自动 canary 分析决定 promote 或回滚;2025 年每季度主动升级覆盖 83%–87% 目标服务,跨团队变更从数月缩短至两周内。
- 基于 SSA 的迁移验证:通过 SSA 静态代码 call-stack 分析识别“表面迁移但仍直接调用开源库”的服务,推动 1,700+ Marketplace 服务完成实质迁移。
2026
Org-Level Agent Memory & AI-Native Engineering 组织级 Agent 记忆与 AI 原生工程
An enterprise experience layer organised along the team hierarchy for non-coding operational context, paired with a team-wide shift to Claude-first workflows.
面向部署、排障与平台操作等长尾场景的组织级共享经验层,同步推进团队整体转向 Claude-first 的 AI 原生工程工作流。
- Why org-level memory: Dropped building another agent framework once the paradigm converged on general coding agents plus Skills; focused on the long-tail operational context scattered across people’s heads and stale docs that Skills cannot capture.
- Human judgment + AI execution: Validated with a mem0 proof of concept and built by two engineers with AI coding agents writing all production code while humans own architecture, evaluation design, and accept-or-reject judgment.
- Team-wide AI workflows: Shared BE harness, Claude-rebuilt GAS Q&A bot (weekly escalations ≈11 → ≈4), and human-gated AI upgrade pipelines handling NamingSDK traffic switch and library upgrades across hundreds of services.
- 为什么做组织级记忆:在范式收敛至通用编码 Agent 加 Skills 后主动放弃自研 Agent 框架,转而解决部署、排障与平台操作中散落在个人经验与过期文档里的长尾上下文问题。
- 人类判断 + AI 编码执行:用 mem0 验证 PoC 后由两名工程师建设;代码由 AI 编码 Agent 编写,想法、架构、评测设计与取舍由人把关;公司内部最大的两个 Agent 平台均已选择接入共建。
- Claude-first 工程实践:建设共享 BE harness、用 Claude 重建 GAS 问答机器人(每周人工工单约 11 降至约 4),以及关键步骤人工把关的 AI 驱动升级流程,承接数百个服务的 NamingSDK 切换与库升级。
2019–2022
Distributed Tracing, spkit & API-Layer Migration 分布式追踪协议、spkit 与 API 层迁移
Foundational platform building blocks created while leading BFF and Dev Platform across Shopee Marketplace’s Python-to-Go transition.
在负责 BFF 与 Dev Platform 团队期间,围绕 Shopee Marketplace 从 Python 单体向 Go 微服务演进打造的底层平台设施。
- API-layer migration: Used goreplay read-only traffic capture and noise-filtered response diffing for functional regression, paired with dynamic nginx Lua routing rules for gradual cut-over from Python to Go.
- Distributed tracing protocol & SDK (3,000+ services): Designed a 32-byte span context reusing the existing request-ID field with zero wire-protocol disruption; wrapped jaeger-tracer into an HTTP/UDP composite tracer to avoid silent UDP packet drops on full debug-trace spans; became the carrier for full-link load tests and PFB.
- spkit & PFB 2.0: Built the default Marketplace Go service scaffold (600+ services, 400+ engineers by 2022) supporting HTTP, Spex, gRPC, and Kafka, and drove Marketplace adoption of per-feature test environments across 800+ services in 11 teams.
- API 层迁移:基于 goreplay 录制回放线上只读流量并过滤噪音字段做 response diff 回归,配合 nginx Lua 动态规则实现 Python 到 Go 的渐进灰度切流。
- 分布式追踪协议与 SDK(3,000+ 服务):32 字节 span context 复用现有 request-ID 字段,不破坏线协议与调用习惯;封装 jaeger-tracer 实现 debug-trace 走 HTTP、普通 span 走 UDP 的组合上报,解决大包静默丢弃问题;后续成为全链路压测与 PFB 的公司级承载层。
- spkit 与 PFB 2.0:打造支持 HTTP、Spex、gRPC 与 Kafka 的 Go 服务脚手架(2022 年覆盖 600+ 服务、400+ 工程师),并推动 11 个团队 800+ 服务落地按特性分支测试环境 PFB 2.0。