SlideShare a Scribd company logo
1 of 21
Download to read offline
⼩小成本的架构演进
在战⽕火中建造城市
滴滴快的⾸首席架构师—李令辉
Always in the war
• 创业三年每天都在打仗。
• 增⻓长完全不线性。
• 营销完全随机。
架构改造为那般?
• 1. 业务量持续增⼤大
• 2. 业务越来越复杂
• 3. 开发团队越来越⼤大,需要解耦来降低成本提⾼高
⽣生产⼒力。
• 4. 避免修复⼀一个bug引⼊入更多bug。
Principle
• Everything is about cost.
• Keep it simple and stupid.
New Challenge
• high available.
• high consistency.
• peak value.
2014
• 0 level service 1 meet problem.
• we have 2 payment services.
Solutions?
• we launch 2 different crazy plans.
• 1. re-write the first in 1 week.
• 2. re-invent and re-create A new payment
service cluster.
Problem1
• 1. 没有单元测试,没有任何⾃自动化测试。
• 2. 性能太差,单机450qps,这是计算器?
• 3. 旧代码,没⼈人维护。
• 4. 依赖于我们不熟悉的⽼老派技术,apache,
php,yii,以及⼀一些不常⽤用的⽇日志收集和上线规
范。
• 5. 依赖于⼀一个公司外的存储,难以维护和控制。
plan for problem 1
• re-design the service, re-implement it in golang.
• deadline is 1 week.
• resource is 3 engineers.
details
• document the detail.
• write a simple framework to support.
• then implement some specific module.
• write some unit test cases.
• write some test script.
deploy to online server?
• during 2 weeks….
• 6 steps deployment…
• To compatible with old implementation.
then…
• run over a month, then hang up 10 min.
• add async to avoid hanging.(we call that
grading
Finally
• QPS -> 9000
• deploy -> 1 binary + 1 conf file
• available -> 100%
• 99.9% query do not need storage any more.
• log collection through network.
Problem 2
• 1. 多套⽀支付代码
• 2. 和业务耦合度太⾼高
• 3. ⽀支付对⼀一致性要求远远⾼高于普通逻辑,要求完全不
⼀一样。
• 4. 扩展性很差,接⼊入新的内部系统或者其他外部系统
⾮非常困难。
• 5. 已有的系统依赖于单库事务,当订单量持续增加拆
库拆表就会破坏事务,⼀一致性就没有了。
Solution: Phoenix
• 1. 抛开业务涉及api,集中精⼒力设计⼀一套⽀支付原语。
• 2. 尝试⽤用原语去解决可能的最复杂的业务场景。
• 3. SOA化,让业务⼯工程师不需要⾯面对存储,缓存,等
等。只需要⾯面对我们的⽀支付原语。
• 4. 去事务,⽤用2-phase commit来保证⼀一致性。
• 5. 最后⽤用对账来保证最终⼀一致性。
• 6. full unit test coverage.
Roadmap
• choose protocol: thrift
• choose programming language: Java
• Design the Architecture.
Architecture
Result
• Phoenix support 顺⻛风⻋车,企业⽤用⻋车,出租⻋车,专
⻋车。
• Phoenix上线后⽆无事故,⽆无错账。
• Phoenix接⼊入新⽀支付渠道只需要不到⼀一周。
• Phoenix通过单元测试,隔离部署来保证上线⽆无压
⼒力。
架构师是干什么的?
• 1. Decide the way.
• 2. Make things simpler.
• 3. Manage the complication.
• 4. Handle the hardcore problem.
滴滴打⻋车诚聘技术⾼高⼿手
• We are hiring!
• contact me: l@diditaxi.com.cn
Thank you
• Q & A

More Related Content

Viewers also liked (7)

Student support officer performance appraisal
Student support officer performance appraisalStudent support officer performance appraisal
Student support officer performance appraisal
 
Supplier development engineer performance appraisal
Supplier development engineer performance appraisalSupplier development engineer performance appraisal
Supplier development engineer performance appraisal
 
Stare obarvene fotografie
Stare obarvene fotografieStare obarvene fotografie
Stare obarvene fotografie
 
Alcachofa
AlcachofaAlcachofa
Alcachofa
 
Rick's assignment software utilities
Rick's assignment software utilitiesRick's assignment software utilities
Rick's assignment software utilities
 
美团CRM-线下决定利器
美团CRM-线下决定利器美团CRM-线下决定利器
美团CRM-线下决定利器
 
Por una educación consciente, 2009, Tenerife (Islas Canarias)
Por una educación consciente, 2009, Tenerife (Islas Canarias)Por una educación consciente, 2009, Tenerife (Islas Canarias)
Por una educación consciente, 2009, Tenerife (Islas Canarias)
 

Similar to 小成本折腾架构演进

愛報告 分享茶會 簡報大綱-20111212上鼎
愛報告 分享茶會 簡報大綱-20111212上鼎愛報告 分享茶會 簡報大綱-20111212上鼎
愛報告 分享茶會 簡報大綱-20111212上鼎
DesBear Li
 
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
Wen-Tien Chang
 
Scrum gathering 2014sharing v4
Scrum gathering 2014sharing v4Scrum gathering 2014sharing v4
Scrum gathering 2014sharing v4
Jen-Chieh Ko
 
2012 China 软件测试大会
2012 China 软件测试大会2012 China 软件测试大会
2012 China 软件测试大会
mayun1688
 

Similar to 小成本折腾架构演进 (11)

愛報告 分享茶會 簡報大綱-20111212上鼎
愛報告 分享茶會 簡報大綱-20111212上鼎愛報告 分享茶會 簡報大綱-20111212上鼎
愛報告 分享茶會 簡報大綱-20111212上鼎
 
持续集成中的反模式
持续集成中的反模式持续集成中的反模式
持续集成中的反模式
 
请给我结果.S01 e01.小清新式的项目管理
请给我结果.S01 e01.小清新式的项目管理请给我结果.S01 e01.小清新式的项目管理
请给我结果.S01 e01.小清新式的项目管理
 
要质量还是要速度
要质量还是要速度要质量还是要速度
要质量还是要速度
 
Lean startup 精益创业 新创企业的成长思维
Lean startup 精益创业 新创企业的成长思维Lean startup 精益创业 新创企业的成长思维
Lean startup 精益创业 新创企业的成长思维
 
世间安得双全法 我的非典型敏捷之路
世间安得双全法   我的非典型敏捷之路世间安得双全法   我的非典型敏捷之路
世间安得双全法 我的非典型敏捷之路
 
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
 
Scrum gathering 2014sharing v4
Scrum gathering 2014sharing v4Scrum gathering 2014sharing v4
Scrum gathering 2014sharing v4
 
2019/7/27 先別開 Branch 了,你聽過 Feature Toggle 嗎?
2019/7/27 先別開 Branch 了,你聽過 Feature Toggle 嗎?2019/7/27 先別開 Branch 了,你聽過 Feature Toggle 嗎?
2019/7/27 先別開 Branch 了,你聽過 Feature Toggle 嗎?
 
2012 China 软件测试大会
2012 China 软件测试大会2012 China 软件测试大会
2012 China 软件测试大会
 
持續交付高品質程式碼 公開版
持續交付高品質程式碼 公開版持續交付高品質程式碼 公開版
持續交付高品質程式碼 公開版
 

小成本折腾架构演进

  • 2. Always in the war • 创业三年每天都在打仗。 • 增⻓长完全不线性。 • 营销完全随机。
  • 3. 架构改造为那般? • 1. 业务量持续增⼤大 • 2. 业务越来越复杂 • 3. 开发团队越来越⼤大,需要解耦来降低成本提⾼高 ⽣生产⼒力。 • 4. 避免修复⼀一个bug引⼊入更多bug。
  • 4. Principle • Everything is about cost. • Keep it simple and stupid.
  • 5. New Challenge • high available. • high consistency. • peak value.
  • 6. 2014 • 0 level service 1 meet problem. • we have 2 payment services.
  • 7. Solutions? • we launch 2 different crazy plans. • 1. re-write the first in 1 week. • 2. re-invent and re-create A new payment service cluster.
  • 8. Problem1 • 1. 没有单元测试,没有任何⾃自动化测试。 • 2. 性能太差,单机450qps,这是计算器? • 3. 旧代码,没⼈人维护。 • 4. 依赖于我们不熟悉的⽼老派技术,apache, php,yii,以及⼀一些不常⽤用的⽇日志收集和上线规 范。 • 5. 依赖于⼀一个公司外的存储,难以维护和控制。
  • 9. plan for problem 1 • re-design the service, re-implement it in golang. • deadline is 1 week. • resource is 3 engineers.
  • 10. details • document the detail. • write a simple framework to support. • then implement some specific module. • write some unit test cases. • write some test script.
  • 11. deploy to online server? • during 2 weeks…. • 6 steps deployment… • To compatible with old implementation.
  • 12. then… • run over a month, then hang up 10 min. • add async to avoid hanging.(we call that grading
  • 13. Finally • QPS -> 9000 • deploy -> 1 binary + 1 conf file • available -> 100% • 99.9% query do not need storage any more. • log collection through network.
  • 14. Problem 2 • 1. 多套⽀支付代码 • 2. 和业务耦合度太⾼高 • 3. ⽀支付对⼀一致性要求远远⾼高于普通逻辑,要求完全不 ⼀一样。 • 4. 扩展性很差,接⼊入新的内部系统或者其他外部系统 ⾮非常困难。 • 5. 已有的系统依赖于单库事务,当订单量持续增加拆 库拆表就会破坏事务,⼀一致性就没有了。
  • 15. Solution: Phoenix • 1. 抛开业务涉及api,集中精⼒力设计⼀一套⽀支付原语。 • 2. 尝试⽤用原语去解决可能的最复杂的业务场景。 • 3. SOA化,让业务⼯工程师不需要⾯面对存储,缓存,等 等。只需要⾯面对我们的⽀支付原语。 • 4. 去事务,⽤用2-phase commit来保证⼀一致性。 • 5. 最后⽤用对账来保证最终⼀一致性。 • 6. full unit test coverage.
  • 16. Roadmap • choose protocol: thrift • choose programming language: Java • Design the Architecture.
  • 18. Result • Phoenix support 顺⻛风⻋车,企业⽤用⻋车,出租⻋车,专 ⻋车。 • Phoenix上线后⽆无事故,⽆无错账。 • Phoenix接⼊入新⽀支付渠道只需要不到⼀一周。 • Phoenix通过单元测试,隔离部署来保证上线⽆无压 ⼒力。
  • 19. 架构师是干什么的? • 1. Decide the way. • 2. Make things simpler. • 3. Manage the complication. • 4. Handle the hardcore problem.
  • 20. 滴滴打⻋车诚聘技术⾼高⼿手 • We are hiring! • contact me: l@diditaxi.com.cn