Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Node.js 在阿里巴巴的这些年
Search
fengmk2
August 11, 2017
Technology
2
1.7k
Node.js 在阿里巴巴的这些年
Modern Web 2017 in TaiPei
fengmk2
August 11, 2017
Tweet
Share
Other Decks in Technology
See All in Technology
LLM翻訳ツールの開発と海外のお客様対応等への社内導入事例
gree_tech
PRO
0
440
ヘブンバーンズレッドのレンダリングパイプライン刷新
gree_tech
PRO
0
450
役割は変わっても、変わらないもの 〜スクラムマスターからEMへの転身で学んだ信頼構築の本質〜 / How to build trust
shinop
0
160
実践アプリケーション設計 ①データモデルとドメインモデル
recruitengineers
PRO
5
1.4k
【Grafana Meetup Japan #6】Grafanaをリバプロ配下で動かすときにやること ~ Grafana Liveってなんだ ~
yoshitake945
0
220
「魔法少女まどか☆マギカ Magia Exedra」の必殺技演出を徹底解剖! -キャラクターの魅力を最大限にファンに届けるためのこだわり-
gree_tech
PRO
0
450
Bye-Bye Query Spaghetti: Write Queries You'll Actually Understand Using Pipelined SQL Syntax
tobiaslampertlotum
0
120
250905 大吉祥寺.pm 2025 前夜祭 「プログラミングに出会って20年、『今』が1番楽しい」
msykd
PRO
1
240
AWSで推進するデータマネジメント
kawanago
0
880
クラウドセキュリティを支える技術と運用の最前線 / Cutting-edge Technologies and Operations Supporting Cloud Security
yuj1osm
2
260
「魔法少女まどか☆マギカ Magia Exedra」のグローバル展開を支える、開発チームと翻訳チームの「意識しない協創」を実現するローカライズシステム
gree_tech
PRO
0
440
事業価値と Engineering
recruitengineers
PRO
8
5.4k
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
It's Worth the Effort
3n
187
28k
Thoughts on Productivity
jonyablonski
69
4.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Agile that works and the tools we love
rasmusluckow
330
21k
Why Our Code Smells
bkeepers
PRO
339
57k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Transcript
Node.js 在阿⾥里里巴巴的這些年年
真名:袁鋒,在阿⾥里里巴巴我叫「蘇千」。 ⽬目前就職于螞蟻⾦金金服,從事 Node.js 相關研發⼯工作。 2010年年開始接觸 Node.js CNode 社區創始成員 參參與舉辦過滬JS、京JS、杭JS GitHub:
@fengmk2 我是誰?
0 初⾒見見 Node.js
Node’s goal is to provide an easy way to build
scalable network programs @ryandahl http://t.cn/R95TZdJ
Node’s goal is to provide an EASY way to build
scalable network programs
經典的 Hello World
單線程 ⾮非阻塞 I/O 事件驅動 Node.js 的特性
⾮非常適合 IO 密集型 應⽤用場景
第⼀一個對外 Node.js 應⽤用
1「⽣生存」
⼈人才市場上招聘不不到 Node.js ⼯工程師 怎麼辦?
2011年年 Node.js 這個技術 還是太新鮮了了!
從現有技術⼈人才轉化 Python、Ruby、 PHP、Java、.Net …
主動創造 招聘環境 招聘機會 為未來來儲備⼈人才
CNode 技術社群 ⼩小型分享 NodeParty 沪JS、京JS、杭JS
http://www.ituring.com.cn/article/744
2011年年4⽉月16⽇日,第⼀一屆 NodeParty
None
2017年年的今天,Node.js 職位如⾬雨後春筍
2 發展
阻礙 Node.js 發展的 技術瓶頸 在哪裡?
None
融⼊入阿⾥里里的 Java ⽣生態 Node.js 中間件
HSF,Notify,Diamond,EagleEye, ConfigServer,VipServer,MetaQ,Tair 等等都有對應的 Node.js 中間件實現 圖來來⾃自 http://jm.taobao.org/about/
Node.js 與 Java 如何「通信」?
Java Hessian Serialization
Object Serialization Stream Protocol
Object Serialization Stream Protocol
hessian.js java.io 分別實現這兩種 序列列化協議
跨語⾔言通信 建議直接使⽤用 Protocol Buffers
None
否則 你需要閱讀 ⾮非常多 Java 源代碼
技術瓶頸 解決了了 越來來越多 node app express、koa 抉擇
https://github.com/cnpm/cnpmjs.org/blob/master/servers/registry.js#L18
統⼀一的 約定⼀一致的 基礎 Web 應⽤用框架 egg
egg 應⽤用⽬目錄錄約定 ⾃自動加載 避免 `app.use(xxx)` 適應⼈人員交替
+-----------------------------------+--------+ | app1, app2, app3 | | +-----------------------------------+ | |
chair | begg | @ali/nut | ... | | +-----------------------------------+ plugin | | @ali/egg | | +-----------------------------------+ | | Egg.js | | +-----------------------------------+--------| | egg-core | +--------------------------------------------| | Koa | +--------------------------------------------+ 基於 egg 的框架、應⽤用、插件之間的關係
來來⾃自 egg 團隊對外分享的「美圖」 Koa Egg 基於上層框架開發框的應⽤用 社區⽣生態 團隊架構師 ⼀一線開發者 Node.js
Plugin 插件⽣生態 適合特定團隊業務場景的上層框架 Framework 螞蟻 Chair UC Nut aliyun-egg … Specification ⼀一套規範和約定 Tool ⼯工具鏈
Why koa?
簡單、簡單、簡單 再⾒見見 callback hell 適應趨勢 async/await
None
None
Why not express?
中間件模型 koa ⽐比 express 簡單、直觀
None
Compress 中間件源代碼對⽐比 koa 72⾏行行 express 277⾏行行 4X
我就是喜歡 express 你有什什麼建議?
同樣建議基於統⼀一規範和約定來來做事情 Express Your Egg 基於上層框架開發框的應⽤用 社區⽣生態 團隊架構師 ⼀一線開發者 Node.js Plugin
插件⽣生態 適合特定團隊業務場景的上層框架 Framework F1 F2 F3 … Specification ⼀一套規範和約定 Tool ⼯工具鏈
越來來越多 私有的 npm 模組, 該如何管理理?
None
tnpm 阿⾥里里巴巴⾃自研的 私有 npm registry
100% npm 接⼝口兼容 10000+私有模組 適配現有企業⽤用⼾戶體系
tnpm => cnpm
None
解決中國開發者 使⽤用 npm ⻱龜速問題
中國 npm 鏡像 cnpmjs.org 實時同步的網絡部署⽅方案 npmjs.com 訂閱實時更更新 觸發同步任務 定時同步輔助 拉取更更新數數據
None
alinode
None
解決 CPU 性能問題 解決內存洩漏漏問題
⼀一鍵在線 CPU Profile 分析
快速定位內存洩漏漏,提供可視化排查⼯工具
Node.js Contributors => CTC
3 更更多的應⽤用場景
統⼀一渲染服務
None
BFF,Backend for Frontend
4 未來來之路路
ServerLess: Function Compute (Lambda)
https://yq.aliyun.com/articles/79648
https://yq.aliyun.com/articles/79648
Node.js 驅動 ffmpeg 去處理理視頻 https://nodejs.org/en/blog/uncategorized/an-easy-way-to-build-scalable-network-programs/
Node.js 驅動 f(x) 去完成⼀一件事情
None