注冊(cè) | 登錄讀書(shū)好,好讀書(shū),讀好書(shū)!
讀書(shū)網(wǎng)-DuShu.com
當(dāng)前位置: 首頁(yè)出版圖書(shū)科學(xué)技術(shù)計(jì)算機(jī)/網(wǎng)絡(luò)網(wǎng)絡(luò)與數(shù)據(jù)通信Serverless架構(gòu):無(wú)服務(wù)器應(yīng)用與AWS Lambda

Serverless架構(gòu):無(wú)服務(wù)器應(yīng)用與AWS Lambda

Serverless架構(gòu):無(wú)服務(wù)器應(yīng)用與AWS Lambda

定 價(jià):¥108.00

作 者: [英] Peter Sbarski·(彼得-薩巴斯基),[澳] Sam Kroonenburg(薩姆-克魯內(nèi)伯格) 著,覃宇 譯
出版社: 電子工業(yè)出版社
叢編項(xiàng):
標(biāo) 簽: 暫缺

購(gòu)買這本書(shū)可以去


ISBN: 9787121342684 出版時(shí)間: 2018-08-01 包裝: 平裝
開(kāi)本: 16開(kāi) 頁(yè)數(shù): 384 字?jǐn)?shù):  

內(nèi)容簡(jiǎn)介

  無(wú)服務(wù)器是軟件架構(gòu)世界中的熱門新話題,它充分利用大量的云平臺(tái)服務(wù),讓開(kāi)發(fā)者只需關(guān)注核心業(yè)務(wù)邏輯的實(shí)現(xiàn)。同時(shí),它按需分配和使用資源的運(yùn)行方式,在降低基礎(chǔ)設(shè)施成本的同時(shí)還能獲得強(qiáng)大的彈性。本書(shū)的作者 Peter Sbarski 是完全擁抱無(wú)服務(wù)器架構(gòu)的早期開(kāi)發(fā)者之一,他將自己在應(yīng)用無(wú)服務(wù)器架構(gòu)中獲得的寶貴經(jīng)驗(yàn)總結(jié)成本書(shū),呈現(xiàn)給廣大的讀者。更難能可貴的是,全書(shū)貫穿了 AWS Lambda 實(shí)例和大量相關(guān)的練習(xí)。讀者一邊閱讀,一邊動(dòng)手完成練習(xí),就可以循序漸進(jìn)地掌握無(wú)服務(wù)器架構(gòu)的核心技術(shù)。無(wú)論你是軟件開(kāi)發(fā)新手,還是架構(gòu)師老兵,本書(shū)都是不可多得的了解無(wú)服務(wù)器架構(gòu)的**讀物。

作者簡(jiǎn)介

  Peter Sbarski 是 A Cloud Guru 的工程副總裁,也是 Serverlessconf 的組織者,Serverlessconf 是全球 個(gè)專門針對(duì)無(wú)服務(wù)器架構(gòu)和技術(shù)的會(huì)議。他喜歡舉辦面對(duì)面的工作坊,時(shí)常撰寫(xiě)一些關(guān)于無(wú)服務(wù)器架構(gòu)的博客。Peter 擁有豐富的 IT工作經(jīng)驗(yàn),領(lǐng)導(dǎo)過(guò)專注于 Web 和 AWS 云技術(shù)的?型企業(yè)解決?案團(tuán)隊(duì)。他的專?包括后端架構(gòu)、微服務(wù)和系統(tǒng)編排。 Peter 擁有澳大利亞莫納什?學(xué)計(jì)算機(jī)科學(xué)博?學(xué)位,讀者可以在Twitter(@sbarski)和 GitHub(https://github.com/sbarski)上關(guān)注他。 覃宇,ThoughtWorks高級(jí)咨詢師,10余年移動(dòng)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn),Android技術(shù)專家,曾為AOSP貢獻(xiàn)過(guò)測(cè)試用例;目前專注于移動(dòng)應(yīng)用的架構(gòu)設(shè)計(jì)、自動(dòng)化測(cè)試以及持續(xù)交付。譯有《Kotlin實(shí)戰(zhàn)》一書(shū)。 李源,在華為技術(shù)有限公司工作8年,從事研發(fā)、系統(tǒng)架構(gòu)設(shè)計(jì)、項(xiàng)目管理等工作,華為優(yōu)秀講師,美國(guó)質(zhì)量協(xié)會(huì)注冊(cè)質(zhì)量工程師(CQE),2012年加入途牛,先后負(fù)責(zé)途牛CRM系統(tǒng)、供應(yīng)商管理系統(tǒng)、零售平臺(tái)、分銷平臺(tái)等公司級(jí)項(xiàng)目,現(xiàn)任供應(yīng)鏈研發(fā)中心副總經(jīng)理,全面主持途牛供應(yīng)鏈相關(guān)系統(tǒng)的設(shè)計(jì)、開(kāi)發(fā)工作,覆蓋采購(gòu)、資源、庫(kù)存、組裝、確認(rèn)、N-BOOKING等多個(gè)核心系統(tǒng)。譯有《Java性能調(diào)優(yōu)指南》《函數(shù)響應(yīng)式領(lǐng)域建模 》等書(shū)。羅麗,高級(jí)軟件工程師,移動(dòng)技術(shù)開(kāi)發(fā)顧問(wèn),擁有豐富的軟件開(kāi)發(fā)經(jīng)驗(yàn),熟悉ReactNative,Android,iOS等多種開(kāi)發(fā)技術(shù)。目前任職于ThoughtWorks海外事業(yè)部,曾在多個(gè)大型移動(dòng)應(yīng)用項(xiàng)目中擔(dān)任技術(shù)顧問(wèn)。譯有《Kotlin實(shí)戰(zhàn)》一書(shū)。

圖書(shū)目錄

序一.........................................................................................XIII
序二..........................................................................................XV
前言........................................................................................XVII
致謝.........................................................................................XIX
關(guān)于本書(shū)...................................................................................XXI
關(guān)于作者................................................................................XXIII
關(guān)于封面................................................................................XXIV
第 1 部分..踏上征途 ......................................................................................... 1
1 ..無(wú)服務(wù)器初探 ........................................................................................................... 3
1.1 來(lái)龍去脈 ..........................................................................................................4
1.1.1 面向服務(wù)的架構(gòu)與微服務(wù) ..................................................................5
1.1.2 軟件設(shè)計(jì) ..............................................................................................6
1.2 無(wú)服務(wù)器架構(gòu)原則 ..........................................................................................9
1.2.1 根據(jù)需要使用計(jì)算服務(wù)執(zhí)行代碼 ......................................................9
1.2.2 編寫(xiě)單一用途的無(wú)狀態(tài)函數(shù) ............................................................10
1.2.3 設(shè)計(jì)基于推送的、事件驅(qū)動(dòng)的管道 ................................................10
1.2.4 創(chuàng)建更厚、更強(qiáng)大的前端 ................................................................ 11
1.2.5 擁抱第三方服務(wù) ................................................................................12
1.3 從服務(wù)器過(guò)渡到服務(wù) ....................................................................................12
1.4 無(wú)服務(wù)器的利與弊 ........................................................................................13
1.4.1 決策驅(qū)動(dòng)因素 ....................................................................................13
1.4.2 什么時(shí)候使用無(wú)服務(wù)器 ....................................................................14
1.5 本章小結(jié) ........................................................................................................15
2 ...架構(gòu)與模式 ........................................................................................................... 17
2.1 使用場(chǎng)景 ........................................................................................................17
2.1.1 應(yīng)用程序后端 ....................................................................................18
2.1.2 數(shù)據(jù)處理與操作 ................................................................................18
2.1.3 實(shí)時(shí)分析 ............................................................................................19
2.1.4 遺留 API 代理 ....................................................................................19
2.1.5 計(jì)劃服務(wù) ............................................................................................19
2.1.6 機(jī)器人(Bot)和技能(Skill) .........................................................20
2.2 架構(gòu) ................................................................................................................20
2.2.1 計(jì)算即后端 ........................................................................................20
2.2.2 遺留 API 代理 ....................................................................................25
2.2.3 混合 ....................................................................................................26
2.2.4 GraphQL .............................................................................................28
2.2.5 計(jì)算即膠水 ........................................................................................29
2.2.6 實(shí)時(shí)處理 ............................................................................................31
2.3 模式 ................................................................................................................32
2.3.1 命令模式 ............................................................................................32
2.3.2 消息傳輸模式 ....................................................................................33
2.3.3 優(yōu)先級(jí)隊(duì)列模式 ................................................................................35
2.3.4 扇出模式 ............................................................................................36
2.3.5 管道和過(guò)濾器模式 ............................................................................37
2.4 本章小結(jié) ........................................................................................................38
3 ..建立無(wú)服務(wù)器應(yīng)用程序 ...................................................................................... 39
3.1 24 小時(shí)視頻 ...................................................................................................40
3.1.1 總體需求 ............................................................................................41
3.1.2 Amazon Web Services(AWS) .........................................................42
3.1.3 創(chuàng)建第一個(gè) Lambda 函數(shù) .................................................................44
3.1.4 命名你的 Lambda ..............................................................................46
3.1.5 本地測(cè)試 ............................................................................................47
3.1.6 部署到 AWS.......................................................................................48
3.1.7 連接 S3 和 Lambda ............................................................................50
3.1.8 在 AWS 中測(cè)試..................................................................................51
3.1.9 觀察日志 ............................................................................................53
3.2 配置 Simple Notification Service ...................................................................54
3.2.1 連接 SNS 和 S3..................................................................................55
3.2.2 從 SNS 接收電子郵件 .......................................................................58
3.2.3 測(cè)試 SNS ............................................................................................58
3.3 設(shè)置視頻權(quán)限 ................................................................................................58
3.3.1 創(chuàng)建第二個(gè)函數(shù) ................................................................................58
3.3.2 配置與安全 ........................................................................................59
3.3.3 測(cè)試第二個(gè)函數(shù) ................................................................................60
3.4 生成元數(shù)據(jù) ....................................................................................................61
創(chuàng)建第三個(gè)函數(shù)和 FFprobe ..........................................................................61
3.5 收尾 ................................................................................................................64
3.6 練習(xí) ................................................................................................................66
3.7 本章小結(jié) ........................................................................................................67
4 ..設(shè)置你的云服務(wù) ................................................................................................... 69
4.1 安全模型和身份管理 ....................................................................................70
4.1.1 創(chuàng)建和管理 IAM 用戶 ......................................................................70
4.1.2 創(chuàng)建 IAM 組 ......................................................................................73
4.1.3 創(chuàng)建角色 ............................................................................................76
4.1.4 資源 ....................................................................................................77
4.1.5 權(quán)限和策略 ........................................................................................77
4.2 日志與警報(bào) ....................................................................................................79
4.2.1 設(shè)置日志 ............................................................................................80
4.2.2 日志保留期 ........................................................................................81
4.2.3 篩選器、指標(biāo)和警報(bào) ........................................................................81
4.2.4 搜索日志數(shù)據(jù) ....................................................................................83
4.2.5 S3 和日志 ...........................................................................................83
4.2.6 關(guān)于警報(bào)的更多操作 ........................................................................84
4.2.7 CloudTrail ...........................................................................................88
4.3 成本 ................................................................................................................90
4.3.1 創(chuàng)建賬單提醒 ....................................................................................91
4.3.2 監(jiān)控和優(yōu)化成本 ................................................................................92
4.3.3 使用 Simple Monthly Calculator .......................................................93
4.3.4 計(jì)算 Lambda 和 API Gateway 的成本 .............................................94
4.4 練習(xí) ................................................................................................................96
4.5 本章小結(jié) ........................................................................................................97
第 2 部分..深入核心 ...................................................................................... 99
5 ..身份認(rèn)證和授權(quán) ................................................................................................ 101
5.1 無(wú)服務(wù)器環(huán)境中的身份認(rèn)證 ......................................................................101
5.1.1 無(wú)服務(wù)器方法 ..................................................................................102
5.1.2 Amazon Cognito ...............................................................................104
5.1.3 Auth0 ................................................................................................105
5.2 為 24 小時(shí)視頻增加身份認(rèn)證 ....................................................................106
5.2.1 計(jì)劃 ..................................................................................................106
5.2.2 直接調(diào)用 Lambda ............................................................................107
5.2.3 24 小時(shí)視頻網(wǎng)站 .............................................................................108
5.2.4 Auth0 配置 ....................................................................................... 110
5.2.5 在網(wǎng)站中加入 Auth0 ....................................................................... 113
5.2.6 測(cè)試 Auth0 的集成 .......................................................................... 118
5.3 與 AWS 集成 ................................................................................................ 119
5.3.1 用戶信息 Lambda ............................................................................120
5.3.2 API Gateway ....................................................................................124
5.3.3 映射 ..................................................................................................126
5.3.4 通過(guò) API Gateway 調(diào)用 Lambda ....................................................130
5.3.5 自定義授權(quán)方 ..................................................................................130
5.4 委托令牌 ......................................................................................................135
5.4.1 真實(shí)案例 ..........................................................................................136
5.4.2 開(kāi)通委托令牌 ..................................................................................136
5.5 練習(xí) ..............................................................................................................137
5.6 本章小結(jié) ......................................................................................................137
6 ..編排者 Lambda ................................................................................................. 139
6.1 Lambda 內(nèi)幕 ................................................................................................139
6.1.1 事件模型和源 ..................................................................................140
6.1.2 推送和拉取事件模型 ......................................................................141
6.1.3 并發(fā)執(zhí)行 ..........................................................................................142
6.1.4 容器重用 ..........................................................................................143
6.1.5 冷 Lambda 和暖 Lambda .................................................................143
6.2 編程模型 ......................................................................................................145
6.2.1 函數(shù)處理程序 ..................................................................................145
6.2.2 事件對(duì)象 ..........................................................................................145
6.2.3 上下文對(duì)象 ......................................................................................147
6.2.4 回調(diào)函數(shù) ..........................................................................................147
6.2.5 日志 ..................................................................................................148
6.3 版本管理、別名和環(huán)境變量 ......................................................................148
6.3.1 版本管理 ..........................................................................................148
6.3.2 別名 ..................................................................................................150
6.3.3 環(huán)境變量 ..........................................................................................152
6.4 使用命令行界面(CLI) ..............................................................................154
6.4.1 調(diào)用命令 ..........................................................................................155
6.4.2 創(chuàng)建和部署函數(shù) ..............................................................................155
6.5 Lambda 模式 ................................................................................................157
6.5.1 異步瀑布 ..........................................................................................158
6.5.2 序列與并行 ......................................................................................163
6.5.3 使用庫(kù) ..............................................................................................164
6.5.4 把邏輯移到另一個(gè)文件中 ..............................................................167
6.6 測(cè)試 Lambda 函數(shù) .......................................................................................167
6.6.1 在本地測(cè)試 ......................................................................................167
6.6.2 編寫(xiě)測(cè)試 ..........................................................................................168
6.6.3 在 AWS 中測(cè)試................................................................................171
6.7 練習(xí) ..............................................................................................................173
6.8 本章小結(jié) ......................................................................................................173
7 ..API.Gateway ..................................................................................................... 175
7.1 作為接口的 API Gateway ............................................................................176
7.1.1 和 AWS 服務(wù)集成............................................................................177
7.1.2 緩存、限制與日志 ..........................................................................177
7.1.3 階段和版本管理 ..............................................................................178
7.1.4 腳本 ..................................................................................................178
7.2 使用 API Gateway ........................................................................................178
7.2.1 計(jì)劃 ..................................................................................................180
7.2.2 創(chuàng)建資源和方法 ..............................................................................181
7.2.3 配置方法執(zhí)行 ..................................................................................185
7.2.4 Lambda 函數(shù) ....................................................................................187
7.2.5 更新網(wǎng)站 ..........................................................................................191
7.3 優(yōu)化網(wǎng)關(guān) ......................................................................................................194
7.3.1 限制 ..................................................................................................194
7.3.2 日志 ..................................................................................................197
7.3.3 緩存 ..................................................................................................199
7.4 階段和版本管理 ..........................................................................................202
7.4.1 創(chuàng)建階段變量 ..................................................................................202
7.4.2 使用階段變量 ..................................................................................203
7.4.3 版本管理 ..........................................................................................205
7.5 練習(xí) ..............................................................................................................205
7.6 本章小結(jié) ......................................................................................................206
第 3 部分..拓展架構(gòu) ................................................................................... 207
8 ..存儲(chǔ) ....................................................................................................................... 209
8.1 更智能的存儲(chǔ) ..............................................................................................209
8.1.1 版本控制 ..........................................................................................210
8.1.2 托管靜態(tài)網(wǎng)站 ..................................................................................212
8.1.3 存儲(chǔ)類別 ..........................................................................................214
8.1.4 對(duì)象生命周期管理 ..........................................................................216
8.1.5 轉(zhuǎn)移加速 ..........................................................................................217
8.1.6 事件通知 ..........................................................................................219
8.2 安全上傳 ......................................................................................................220
8.2.1 架構(gòu) ..................................................................................................221
8.2.2 上傳策略 Lambda ............................................................................222
8.2.3 S3 CORS 配置 .................................................................................228
8.2.4 在網(wǎng)站中上傳 ..................................................................................228
8.3 限制對(duì)文件的訪問(wèn) ......................................................................................233
8.3.1 禁止公開(kāi)訪問(wèn) ..................................................................................233
8.3.2 生成預(yù)簽名 URL .............................................................................233
8.4 練習(xí) ..............................................................................................................234
8.5 本章小結(jié) ......................................................................................................235
9 ..?dāng)?shù)據(jù)庫(kù) ................................................................................................................... 237
9.1 Firebase 簡(jiǎn)介 ................................................................................................238
9.1.1 數(shù)據(jù)結(jié)構(gòu) ..........................................................................................238
9.1.2 安全規(guī)則 ..........................................................................................240
9.2 為 24 小時(shí)視頻添加 Firebase ......................................................................241
9.2.1 架構(gòu) ..................................................................................................242
9.2.2 設(shè)置 Firebase ....................................................................................243
9.2.3 修改轉(zhuǎn)碼視頻 Lambda ....................................................................245
9.2.4 Transcode Video Firebase Update 函數(shù) ...........................................250
9.2.5 連接 Lambda ....................................................................................251
9.2.6 網(wǎng)站 ..................................................................................................253
9.2.7 端到端測(cè)試 ......................................................................................258
9.3 安全訪問(wèn)文件 ..............................................................................................259
9.3.1 簽名 URL Lambda ...........................................................................260
9.3.2 API Gateway 設(shè)置 ...........................................................................261
9.3.3 再次更新網(wǎng)站 ..................................................................................262
9.3.4 提升性能 ..........................................................................................262
9.3.5 提升 Firebase 安全性 .......................................................................265
9.4 練習(xí) ..............................................................................................................270
9.5 本章小結(jié) ......................................................................................................270
10 ..最后一英里 ..................................................................................................... 271
10.1 部署與框架 ................................................................................................271
10.2 邁向更好的微服務(wù) ....................................................................................272
10.3 Step Functions ............................................................................................277
10.4 AWS Marketplace .......................................................................................283
10.5 未來(lái)之路 ....................................................................................................285
A ..為無(wú)服務(wù)器架構(gòu)而生的服務(wù) ........................................................................ 287
B ..安裝和設(shè)置 ........................................................................................................ 293
C ..身份認(rèn)證和授權(quán)的更多信息 ......................................................................... 305
D ..再探 Lambda 內(nèi)幕 .......................................................................................... 311
E ..模型和映射 ........................................................................................................ 317
F ..S3 事件消息結(jié)構(gòu) .............................................................................................. 335
G ..Serverless.Framework 和 SAM ................................................................. 337

本目錄推薦

掃描二維碼
Copyright ? 讀書(shū)網(wǎng) m.ranfinancial.com 2005-2020, All Rights Reserved.
鄂ICP備15019699號(hào) 鄂公網(wǎng)安備 42010302001612號(hào)