Skip to content

Instantly share code, notes, and snippets.

@ruiqiliu
Last active September 18, 2019 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruiqiliu/ec243227e4837c497678930ea37b4153 to your computer and use it in GitHub Desktop.
Save ruiqiliu/ec243227e4837c497678930ea37b4153 to your computer and use it in GitHub Desktop.
ArchSummit2019学习笔记

Apple Siri@Spark

  • Spark、Hadoop社区PMC、Committers
  • ML code is small in real-world ML systems
    • ETL、Monitoring、AnalysisTools、Data Verification
  • Unified Pipeline、thousands of nodes in HDFS
  • Applying UDF after repartition
  • 使用spark-4502来避免全表加载
  • spark-25363优化列属性剪裁
  • 通过优化:快了21倍,数据少加载8倍

百分点技术转型之路

  • SAAS服务和企业交付异同: • 如何梳理客户需求并传达给产品? • 怎么应对需求变化? • 如何统一代码、文档等规范?怎么才能不延期? • 如何协作好大家的工作? • 如何照顾好大家的情绪?
  • 业务现状:
    • 人员:150 到 800
    • 交付项目:10 到 100
    • 做好ToB业务需要全新思维
  • 技术建设
  • 组织建设
    • 三大业务线
    • 算法、应用、前端、运维、测试组
    • 组织培训

模型设计

  • 设计资产表:关键资产的详细信息
    • 原子性、没有函数依赖、传递依赖
    • 适度冗余来加快搜索,减少关联查询
  • 设计过程表:记录过程的关键新建

实战演练

账单生成与统计

  • 话单收集
  • 账期管理
  • 计费

模型设计

MeasureFile 1:N Measure 1:N MeasureItem

Pretreatment 1:N Measure

Offering 1:N Edition 1:1 PricingPlan Offering 1:N Feature 1:1 PricingPlan 1:N PricingStrategy 1:N PricingMeasure

Service 1:1 ServicePrice 1:N BillSummary 1:N BillDetail

QQ 核心业务

个人:user(uid, user_info, …)

好友:user_friends(uid, friend_id, …)

加入的群:user_groups(uid, group_id, …)

群:group(gid, group_info, …)

群成员:group_members(gid, uid, …)

个人消息:msgs_user(msg_id, uid, …)

群消息:msgs_group(msg_id, gid, …)

  • 读写基本没有锁冲突

微博核心业务是feed流

  • 发消息:写操作
  • 收消息:读操作
  • 读扩散、写扩散原理
  • 一定概率的读写锁冲突

12306核心业务

  • 查票:读操作
  • 买票:写操作
  • 极大概率的锁冲突

扩展

高并发的扣款场景,可以使用CAS乐观锁,采用select&set方式进行扣款,既能够保证吞吐量,又能够保证一致性。

  • UPDATE t_yue SET money=$new_money,ver=$ver_new WHERE uid=$uid AND ver=$ver_old;
  • 使用ver记录版本号,防止ABA问题
  • 只有当同一个用户,同一秒钟,有大量扣减时,才有一定几率会冲撞,但也不会导致数据不一致
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment