美图 龙佳文 Serverless 中的 Node,js 实践

CodeWarrior

2019/07/08 发布于 编程 分类

GIAC2019 

文字内容
1. Serverless 中的 Node.js 实践
3. 2017
4. Node.js Node.js API
5. Node.js Node.js • • •
6. Node.js Node.js
7. Node.js A B JavaScript Node.js
8. Node.js A NODE.JS B NODE.JS BFF Node.js BFF
9. Serverless C Serverless Node.js + Node.js =
10. Serverless
11. Serverless serverless
12. Serverless const http = require('http') // Create an HTTP server const server = http.createServer((req, res) => { // do something res.writeHead(200, { 'Content-Type': 'text/plain' }) res.end('okay') }) // server is running server.listen(8080) • • module.exports.main = (event, context) => { // do something return { headers: { 'Content-Type': 'text/plain' }, body: 'okay' } } serverless HTTP • •
13. Serverless Serverless • • • •
14. Serverless Serverless • • • serverless • • • redis •
15. Serverless WG Serverless Event Source Event Function Instance https://github.com/cncf/wg-serverless
16. Serverless WG Serverless
17. Serverless WG Serverless https://github.com/cncf/wg-serverless
18. Serverless WG ‣ • ‣ • ‣ ‣ • • •
19. Node.js
20. Node.js
21. D • • • • / C • / • C • • C • • • • • • • • • •
22. Serverless 改造成本 迁移风险
25. 01 02 03 Serverless Serverless
27. Serverless + Node.js Node.js Serverless
28. Serverless + Node.js Node.js 01 02 03
29. Serverless + Node.js • •
30. Serverless + Node.js • • 419 M 24 M 94%
31. Serverless + Node.js •Serverless •Node.js •Node.js + Serverless = Serverless
32. Serverless + Node.js https://www.teepublic.com
33. •Serverless + Node.js = •Serverless + Node.js =
34. Q&A
35. longjiawen@meituan.com “ ”