Architecting on AWS 上課小記
Day 1 - 2019/3/19
請上課學員確認有電子書以及 Lab 建立帳號
e-kit
Lab
上課使用
Architecting on AWS 6.3
Module 0 Welcome to Architecting on AWS
Module 1
==== Class Break ====
Global: 15 + 1 ( GovCloud ) + 2 ( China )
Module 2
Permission / Policy ( JSON )
- 哪些人( Principal )對哪些資源( Resource )可以做哪些動作( Action )
可以使用 AWS Policy Generator 建立
Amazon S3 Versioning
- S3 可以開啟版本控制
- 會耗費比教多的空間
Amazon S3 Access Control - CORS
- 跨來源資源共用(Cross-Origin Resource Sharing (CORS))是一種使用額外 HTTP 標頭令目前瀏覽網站的使用者代理取得存取其他來源(網域)伺服器特定資源權限的機制。
比對 Bucket 或是 filesystem 的概念
Bucket -- > Prefix -- > Object
Filesystem -- > Folder -- > File
- Per object 大小限制 5TB
- Per Account 限制 100 Bucket
Amazon S3 Transfer Acceleration
- 透過 Amazon CloudFront edge location 走 Amazon Network 達到加速功能
- 打開這個功能就會取得新的 URL, 會走 edge location
AWS Snowball
- Petabyte-scale data transport
- 實體方式進行資料轉移
AWS Snowmobile
- Exabyte-scale data transport
Good use cases for S3
- Write once, read many times
- Spiky data access
- Large number of users and diverse amounts of content
- Growing data sets
Amazon S3 Costs
- GSs per month
- Transfer OUT
- PUT, COPY, POST, LIST, GET requests
Amazon Glacier
- Long-term data storage
- Archival or backup
- Very low-cost storge
Vault -------- > Archive
Storage Class - S3 / Glacier
- S3 Standard
- General purpose
- S3 Standard IA
- Infrequent but rapid access
- S3 One Zone IA
- Re-creatable, infrequently accessed data
- Amazon Glacier / Deep Archive
- Archival data, cheapest available storage tier
決定 AWS region 參考
S3 SIMPLE MONTHLY CALCULATOR
Architecting on AWS - Lab 1 - Hosting a Static Website ( qwiklabs )
- 使用 Qwiklabs 練習
Lab + 中午用餐
13:35 上課
==== Class Break ====
Module 3
EC2
- AMI ( Template )
- Instance ( VM )
- EBS ( Virtual Disk )
Instance storage 是暫時性的, 一開機就不見
EBS 只能被一個 instance 掛載
EBS Optimized Instance
- 主機在存取 EBS 的頻寬比一般 Instance 來得大, 所以 IOPS 效能會比較好
Shared File Systems
- Amazon EFS and FSx are perfect for this task
- EFS
- Linux Workloads
- NFS v4 file system
- Share Across
- Availability Zones
- Regions
- VPCs
- Account
- FSx
- Windows Workloads
- NTFS file system ( Samba file system )
- Share Across
- Availability Zones
EC2 Instances Types
EC2 General Purpose Example
- Good for burstable workloads like website and web applications
- T - burstable
- Burstable
- CPU credit / hour
- 適合平常 loading 比較小, 但是有可能突然爆量的服務
- 如果平常沒有使用到, 會存 cpu credit, 如果突然爆量可以從 credit 點數內扣
用途專屬的 instance cpu 就不會有 credit / hour, 因為 CPU 是專屬的
Amazon EC2 Dedicated Instances
- 實體隔離
- 一般都是法令規定
==== Class Break ====
Module 4
Amazon Database Options
Relational Databases
- Amazon RDS
- Amazon Redshift
Non-Relational Databases
- Amazon DynamoDB
- Amazon ElastiCache
- Amazon Neptune
Amazon Aurora
- Fully managed, MySQL and PostgreSQL compatible relational database engine.
Amazon DynamoDB Use Case
- Leaderboards and Scoring
- Temporary Data ( Online Cart )
Amazon DynamoDB Consistency Options
- Eventually Consistent
- 例如遊戲排名
- 只先讀取最近的一份, 速度比較快
- Strongly Consistent
- 適合比較嚴謹的資料
- 讀完所有的資料
CAP定理(CAP theorem)
- 網路有隔離的時候, 可用性與一致性只能選一個
AWS DMS ( Database Migration Service )
Lab2: Deploying a Web Application on AWS
==== Class Break ====
Module 5
VPC Limits
VPC and IP Addressing
- 每個 VPC 保留一個私有 IP 網段
VPC 是 region 等級
- 所以 VPC 可以跨 AZ
- VPC 的範圍內可以跨 AZ, 然後可以設定私有網段, 只要同一個 VPC 範圍內的 subnet 不重複就可以.
Subnet 是 AZ 等級的服務
- 存在 AZ 範圍內
- 保留五個 IP ( 前面 4 個 + 最後一個 )
- 第1個IP: 網路
- 第2個IP: Gateway
- 第3個IP: DNS Server
- 第4個IP: 保留 IP
- 最後一個 IP: 保留給 Broadcast 用, 目前不 support
Subnets Allow Different Level of Network Isolation
- Use subnet to define internet accessibility
- Public subnets
- Include a routing table entry to an internet gateway to support inbound / outbound access to the public internet.
- Private subnets
- Do not have a routing entry to an internet gateway
- Are not directly accessible from the public internet
- Typically use a NAT gateway to support restricted, outbound public internet access
路由表
- 預設的路由表會連接所有的 subnet
- 例如 10.0.0.0/16 -- > local
- Local 指的是每個 subnet 的第二個 ip, 也就是 gateway
- 自訂的路由表一定要包含 default routing table
- 如果要讓 instance 可以到 internet
- 自訂路由表, 路由如下
- 10.0.0.0 / 16 -- > local
- 0.0.0.0 / 0 -- > igw-id
Subnet Recommendations
- Consider larger subnets over smaller ones ( /24 and larger )
- AWS 用需不需要用 internet 來區分網路, 所以不需要切太小的 subnet, 這樣比較好管理
建議 Private subnet 留多一點
Elastic Network Interfaces
- Virtual network interface
- Can be moved across EC2 instances in the same Availability Zone
Elastic IP Addresses
- 固定 IP
- Can be associated with an instance or a network interface
- Able to re-associate and direct traffic immediately
- Five allowed per AWS Region
Network ACLs
沒有留言:
張貼留言