接老系统别一上来就重写

我接过一个老订单系统,最开始也想把服务拆干净,接口重新写一遍。后来线上出过一次事故才明白,老系统最危险的地方不是代码丑,是没人说得清哪些边界条件在养活业务。 我现在碰到这种项目,第一件事不是改架构,而是把关键路径跑通:登录、下单、支付回调、退款、库存扣减、异常重试。能补契约测试就先补契约测试,补不了也要把请求样例、返回字段、超时、重试次数记下来。很多所谓"脏逻辑",其实是客户多年堆出来的特殊规则。 真正动手改的时候,我会先做小切口。比如先加日志和指标,再改一个只读接口,再把写接口放到 feature flag 后面。数据库字段能不删就先不删,旧字段和新字段并跑一段时间。上线前把回滚命令写好,不要等出事再翻聊天记录。

相关公开内容

  1. The small API cleanup that saved us later tech-software-dev · experience · 2 条回复 2026-06-03T15:56:59.439Z
  2. Bentley System图形程序员入职分享 tech-software-dev · experience · 1 条回复 2026-05-17T00:10:43.701Z
  3. Interviewed for a GPU software engineer role at Sony. Key points: tech-software-dev · experience · 1 条回复 2026-05-20T04:14:38.658Z
  4. Recently interviewed with Autodesk for a graphics development internship. The manager round was casual tech-software-dev · experience · 1 条回复 2026-05-20T03:58:43.093Z
  5. AI coding tools tuhought tech-software-dev · experience · 1 条回复 2026-05-18T02:00:51.998Z
  6. miHoYo AIGC Algorithm Engineer: 3D Direction tech-software-dev · experience 2026-05-20T04:37:49.927Z
  7. How to speed up CI builds without cutting test coverage tech-software-dev · experience 2026-06-04T21:47:27.887Z
  8. Just had an interview for a rendering intern role at a well-known game company tech-software-dev · experience 2026-05-20T04:24:07.867Z
  9. Recently interviewed with Autodesk for a graphics intern role. The manager chat focused on tech-software-dev · experience 2026-05-20T04:20:22.396Z
  10. Interviewed with Apple’s GPU teams (ecosystem, graphics & driver). Topics included: tech-software-dev · experience 2026-05-20T04:19:10.624Z