[ Serverless Website : Todo List ]
1. This website should scale globally
2. Blogs are rarely written, but often read
3. Some of the website is purely static files, the rest is a dynamic REST API
4. Caching must be implement where possible
5. Any new users that subscribes should receive a welcome email
6. Any photo uploaded to the blog should have a thumbnail generated
[ 1. Serving static content, globally ]
※ CloudFront 를 사용하여 Amazon S3(region)를 global 로 사용
[ 2. Serving static content, globally, securely ]
S3 Bucket policy 설정을 통해 OAI (Origin Access Identity) 만 권한(authorize) 부여
client 는 Amazon S3 에 직접 접근 불가하며 CloudFont 를 통해서만 S3 에 접근 가능
[ 2-2. Serving static content, globally, securely ]
[ Sending Email ]
DynamoDB Stream 을 통해 데이터 변화시 Lambda 를 호출,
(SES(Simple Email Service) 를 사용 할 수 있는 IAM Role을 가진) Lambda 는 Amazon SES를 사용하여 email 전송
[ Making Thumbnail on photo added ]
Client 가 S3 에 직접 혹은 CloudFront 를 통해 이미지 업로드시 Lambda 를 호출(trigger),
Lambda 가 thumbnail 을 생성하여 S3 에 업로드. (이때 S3 는 SQS/SNS 를 사용하여 부가적인 동작 가능)
[ AWS Hosted Website Summary ]
- We've seen static content being distributed using CloudFront with S3
- The REST API was serverless, didn't need Cognito because public
- We leveraged a Global DynamoDB table to serve the data globally (could use Aurora Global Tables)
- We enabled DynamoDB streams to trigger a Lambda function
- The lambda function had an IAM role which use SES(Simple Email Service)
- SES(Simple Email Service) was used to send emails in a serverless way
- S3 can trigger SQS/SNS/Lambda to notify of events
'infra & cloud > AWS' 카테고리의 다른 글
[AWS] 17-4. Distributing paid content (0) | 2021.09.17 |
---|---|
[AWS] 17-3. Micro Service Architecture (0) | 2021.09.17 |
[AWS] 17-1. Serverless Solution Architecture Discussions (0) | 2021.09.17 |
[AWS] 16-2. AWS SAM : Serverless Application Model (0) | 2021.09.12 |
[AWS] 16-1. AWS Cognito (0) | 2021.09.12 |