blog-blueprint 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BlueprintTemplate/.editorconfig +17 -0
- package/BlueprintTemplate/.gitlab-ci.yml +34 -0
- package/BlueprintTemplate/DESIGN.txt +37 -0
- package/BlueprintTemplate/README.md +78 -0
- package/BlueprintTemplate/angular.json +101 -0
- package/BlueprintTemplate/gitignore +42 -0
- package/BlueprintTemplate/package.json +58 -0
- package/BlueprintTemplate/public/assets/lessons/aws/aws-overview.md +139 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-aurora-guide.md +181 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-dynamodb-guide.md +139 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-ec2-guide.md +152 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-eventbridge-guide.md +152 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-iam-guide.md +132 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-lambda-guide.md +129 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-rds-guide.md +193 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-s3-guide.md +158 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-sns-guide.md +163 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-sqs-guide.md +173 -0
- package/BlueprintTemplate/public/assets/lessons/core/aws-vpc-guide.md +145 -0
- package/BlueprintTemplate/public/assets/lessons/groups/aws-application-integration-overview.md +194 -0
- package/BlueprintTemplate/public/assets/lessons/groups/aws-compute-architecture-overview.md +187 -0
- package/BlueprintTemplate/public/assets/lessons/groups/aws-database-architecture.md +104 -0
- package/BlueprintTemplate/public/assets/lessons/groups/aws-networking-architecture.md +97 -0
- package/BlueprintTemplate/public/assets/lessons/groups/aws-security-architecture.md +88 -0
- package/BlueprintTemplate/public/assets/lessons/groups/aws-storage-architecture.md +116 -0
- package/BlueprintTemplate/public/assets/lessons/index.json +202 -0
- package/BlueprintTemplate/public/assets/lessons/theory/aws-caching-strategy.md +61 -0
- package/BlueprintTemplate/public/assets/lessons/theory/aws-disaster-recovery-strategies.md +117 -0
- package/BlueprintTemplate/public/assets/lessons/theory/aws-event-driven-architecture.md +77 -0
- package/BlueprintTemplate/public/assets/lessons/theory/aws-ha-ft-scalability.md +98 -0
- package/BlueprintTemplate/public/assets/lessons/theory/aws-hybrid-cloud.md +82 -0
- package/BlueprintTemplate/public/assets/lessons/theory/aws-microservices-vs-monolithic.md +77 -0
- package/BlueprintTemplate/public/assets/lessons/theory/aws-well-architected-framework.md +174 -0
- package/BlueprintTemplate/public/favicon.ico +0 -0
- package/BlueprintTemplate/public/robots.txt +23 -0
- package/BlueprintTemplate/public/sitemap.xml +11 -0
- package/BlueprintTemplate/src/app/app.config.server.ts +12 -0
- package/BlueprintTemplate/src/app/app.config.ts +16 -0
- package/BlueprintTemplate/src/app/app.html +36 -0
- package/BlueprintTemplate/src/app/app.routes.server.ts +8 -0
- package/BlueprintTemplate/src/app/app.routes.ts +11 -0
- package/BlueprintTemplate/src/app/app.scss +71 -0
- package/BlueprintTemplate/src/app/app.ts +50 -0
- package/BlueprintTemplate/src/app/core/models/lesson.model.ts +8 -0
- package/BlueprintTemplate/src/app/core/services/lesson.service.ts +46 -0
- package/BlueprintTemplate/src/app/core/services/seo.service.ts +68 -0
- package/BlueprintTemplate/src/app/features/about/about.html +14 -0
- package/BlueprintTemplate/src/app/features/about/about.scss +4 -0
- package/BlueprintTemplate/src/app/features/about/about.ts +23 -0
- package/BlueprintTemplate/src/app/features/lesson-detail/lesson-detail.html +4 -0
- package/BlueprintTemplate/src/app/features/lesson-detail/lesson-detail.scss +0 -0
- package/BlueprintTemplate/src/app/features/lesson-detail/lesson-detail.ts +55 -0
- package/BlueprintTemplate/src/app/features/lesson-list/lesson-list.html +13 -0
- package/BlueprintTemplate/src/app/features/lesson-list/lesson-list.scss +0 -0
- package/BlueprintTemplate/src/app/features/lesson-list/lesson-list.ts +59 -0
- package/BlueprintTemplate/src/app/shared/facades/event-abstract.facade.ts +18 -0
- package/BlueprintTemplate/src/app/shared/facades/pages.facade.ts +55 -0
- package/BlueprintTemplate/src/app/shared/utils/common.utils.ts +3 -0
- package/BlueprintTemplate/src/index.html +35 -0
- package/BlueprintTemplate/src/main.server.ts.bak +7 -0
- package/BlueprintTemplate/src/main.ts +6 -0
- package/BlueprintTemplate/src/server.ts.bak +68 -0
- package/BlueprintTemplate/src/styles.scss +36 -0
- package/BlueprintTemplate/tsconfig.app.json +17 -0
- package/BlueprintTemplate/tsconfig.json +34 -0
- package/README.md +22 -0
- package/create.js +92 -0
- package/package.json +21 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Editor configuration, see https://editorconfig.org
|
|
2
|
+
root = true
|
|
3
|
+
|
|
4
|
+
[*]
|
|
5
|
+
charset = utf-8
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 2
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.ts]
|
|
12
|
+
quote_type = single
|
|
13
|
+
ij_typescript_use_double_quotes = false
|
|
14
|
+
|
|
15
|
+
[*.md]
|
|
16
|
+
max_line_length = off
|
|
17
|
+
trim_trailing_whitespace = false
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
image: node:20
|
|
2
|
+
|
|
3
|
+
stages:
|
|
4
|
+
- build
|
|
5
|
+
- publish_and_deploy
|
|
6
|
+
|
|
7
|
+
before_script:
|
|
8
|
+
- npm install -g @angular/cli
|
|
9
|
+
|
|
10
|
+
build_app:
|
|
11
|
+
stage: build
|
|
12
|
+
script:
|
|
13
|
+
- rm -rf node_modules package-lock.json
|
|
14
|
+
- npm cache clean --force
|
|
15
|
+
- npm run postinstall # Install dependencies
|
|
16
|
+
- npm run build
|
|
17
|
+
artifacts:
|
|
18
|
+
paths:
|
|
19
|
+
- dist/aws-learning/browser
|
|
20
|
+
|
|
21
|
+
deploy_to_s3:
|
|
22
|
+
stage: publish_and_deploy
|
|
23
|
+
image: python:3.12-alpine
|
|
24
|
+
before_script:
|
|
25
|
+
- pip install awscli
|
|
26
|
+
script:
|
|
27
|
+
- aws s3 sync dist/aws-learning/browser s3://$S3_BUCKET --delete
|
|
28
|
+
only:
|
|
29
|
+
- master
|
|
30
|
+
environment:
|
|
31
|
+
name: production
|
|
32
|
+
url: https://$S3_BUCKET.s3.amazonaws.com
|
|
33
|
+
dependencies:
|
|
34
|
+
- build_app
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
DESIGN.txt – Frontend Application Design
|
|
2
|
+
|
|
3
|
+
1. Mục đích
|
|
4
|
+
Ứng dụng AWS EDU dùng để học và tra cứu kiến thức AWS cơ bản đến nâng cao.
|
|
5
|
+
Thiết kế đơn giản, tập trung vào nội dung, không xử lý nghiệp vụ phức tạp.
|
|
6
|
+
|
|
7
|
+
2. Tổng thể kiến trúc
|
|
8
|
+
- Frontend: Angular (standalone)
|
|
9
|
+
- Backend: Không
|
|
10
|
+
- Database: Không
|
|
11
|
+
- Nội dung: Markdown
|
|
12
|
+
- Metadata: JSON
|
|
13
|
+
- Deploy: Static hosting (S3 + CloudFront)
|
|
14
|
+
|
|
15
|
+
3. Cấu trúc màn hình
|
|
16
|
+
- Trang Home (Menu)
|
|
17
|
+
- Trang About
|
|
18
|
+
- Trang Detail bài học
|
|
19
|
+
|
|
20
|
+
Luồng:
|
|
21
|
+
Home → Detail → Back to Home
|
|
22
|
+
|
|
23
|
+
4. Phạm vi
|
|
24
|
+
Có:
|
|
25
|
+
- Hiển thị danh sách bài học
|
|
26
|
+
- Xem chi tiết bài học
|
|
27
|
+
- Điều hướng đơn giản
|
|
28
|
+
|
|
29
|
+
Không có:
|
|
30
|
+
- Auth
|
|
31
|
+
- CRUD
|
|
32
|
+
- Backend API
|
|
33
|
+
|
|
34
|
+
5. Nguyên tắc
|
|
35
|
+
- Viết tài liệu trước khi code
|
|
36
|
+
- Mọi dữ liệu đi qua service
|
|
37
|
+
- Nội dung tách biệt UI
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# AWS EDU – Handbook
|
|
2
|
+
|
|
3
|
+
## 🎯 Mục tiêu
|
|
4
|
+
Ứng dụng web học AWS nền tảng, tập trung vào:
|
|
5
|
+
- Nhóm dịch vụ AWS
|
|
6
|
+
- Các chủ đề lý thuyết cốt lõi
|
|
7
|
+
- Các core service thường dùng
|
|
8
|
+
|
|
9
|
+
Ứng dụng đơn giản, không backend, không database, phù hợp cho việc học và tích lũy kiến thức lâu dài.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🧱 Kiến trúc
|
|
14
|
+
- Framework: Angular (standalone components)
|
|
15
|
+
- Backend: Không
|
|
16
|
+
- Database: Không
|
|
17
|
+
- Nội dung bài học: Markdown (.md)
|
|
18
|
+
- Metadata bài học: JSON
|
|
19
|
+
- Deploy: AWS S3 + CloudFront
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📚 Nội dung
|
|
24
|
+
Tổng số bài học: ~25 bài
|
|
25
|
+
- 6 bài: Nhóm dịch vụ AWS
|
|
26
|
+
- 7 bài: Chủ đề lý thuyết
|
|
27
|
+
- 11 bài: Core service
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 📁 Cấu trúc thư mục (rút gọn)
|
|
32
|
+
|
|
33
|
+
src/
|
|
34
|
+
app/
|
|
35
|
+
assets/
|
|
36
|
+
lessons/
|
|
37
|
+
index.json
|
|
38
|
+
theory/
|
|
39
|
+
core/
|
|
40
|
+
groups/
|
|
41
|
+
|
|
42
|
+
docs/
|
|
43
|
+
lesson-spec.md
|
|
44
|
+
routing.md
|
|
45
|
+
ui-flow.md
|
|
46
|
+
libs.md
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 🚀 Chạy local
|
|
51
|
+
|
|
52
|
+
npm install
|
|
53
|
+
ng serve
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 🛠 Tech stack
|
|
58
|
+
- Angular
|
|
59
|
+
- Angular Router
|
|
60
|
+
- HttpClient
|
|
61
|
+
- ngx-markdown
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 🛠 Cần cập nhật khi chạy blueprint
|
|
66
|
+
- Update CI/CD dist folder (gitlab-ci)
|
|
67
|
+
- Update CI/CD dist folder (app.ts)
|
|
68
|
+
- Replace icons & assets (assets folder)
|
|
69
|
+
- Update page content (assets folder)
|
|
70
|
+
- Update SEO metadata (index.html)
|
|
71
|
+
- Update sitemap / robots
|
|
72
|
+
- UI & theme customization (Colors, Fonts, Icons, Layout tweaks)
|
|
73
|
+
- Thay measurement ID của google analytics (index.html)
|
|
74
|
+
- Sửa SEO:
|
|
75
|
+
+ robots.txt
|
|
76
|
+
+ sitemap.xml
|
|
77
|
+
|
|
78
|
+
---
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"aws-learning": {
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"schematics": {
|
|
9
|
+
"@schematics/angular:component": {
|
|
10
|
+
"style": "scss"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"root": "",
|
|
14
|
+
"sourceRoot": "src",
|
|
15
|
+
"prefix": "app",
|
|
16
|
+
"architect": {
|
|
17
|
+
"build": {
|
|
18
|
+
"builder": "@angular/build:application",
|
|
19
|
+
"options": {
|
|
20
|
+
"browser": "src/main.ts",
|
|
21
|
+
"polyfills": [
|
|
22
|
+
"zone.js"
|
|
23
|
+
],
|
|
24
|
+
"tsConfig": "tsconfig.app.json",
|
|
25
|
+
"inlineStyleLanguage": "scss",
|
|
26
|
+
"assets": [
|
|
27
|
+
{
|
|
28
|
+
"glob": "**/*",
|
|
29
|
+
"input": "public"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"styles": [
|
|
33
|
+
"src/styles.scss"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"configurations": {
|
|
37
|
+
"production": {
|
|
38
|
+
"budgets": [
|
|
39
|
+
{
|
|
40
|
+
"type": "initial",
|
|
41
|
+
"maximumWarning": "500kB",
|
|
42
|
+
"maximumError": "1MB"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"type": "anyComponentStyle",
|
|
46
|
+
"maximumWarning": "4kB",
|
|
47
|
+
"maximumError": "8kB"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"outputHashing": "all"
|
|
51
|
+
},
|
|
52
|
+
"development": {
|
|
53
|
+
"optimization": false,
|
|
54
|
+
"extractLicenses": false,
|
|
55
|
+
"sourceMap": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"defaultConfiguration": "production"
|
|
59
|
+
},
|
|
60
|
+
"serve": {
|
|
61
|
+
"builder": "@angular/build:dev-server",
|
|
62
|
+
"configurations": {
|
|
63
|
+
"production": {
|
|
64
|
+
"buildTarget": "aws-learning:build:production"
|
|
65
|
+
},
|
|
66
|
+
"development": {
|
|
67
|
+
"buildTarget": "aws-learning:build:development"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"defaultConfiguration": "development"
|
|
71
|
+
},
|
|
72
|
+
"extract-i18n": {
|
|
73
|
+
"builder": "@angular/build:extract-i18n"
|
|
74
|
+
},
|
|
75
|
+
"test": {
|
|
76
|
+
"builder": "@angular/build:karma",
|
|
77
|
+
"options": {
|
|
78
|
+
"polyfills": [
|
|
79
|
+
"zone.js",
|
|
80
|
+
"zone.js/testing"
|
|
81
|
+
],
|
|
82
|
+
"tsConfig": "tsconfig.spec.json",
|
|
83
|
+
"inlineStyleLanguage": "scss",
|
|
84
|
+
"assets": [
|
|
85
|
+
{
|
|
86
|
+
"glob": "**/*",
|
|
87
|
+
"input": "public"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"styles": [
|
|
91
|
+
"src/styles.scss"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"cli": {
|
|
99
|
+
"analytics": "263694ee-cf6c-42d2-99c8-251b96c0f12b"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# Compiled output
|
|
4
|
+
/dist
|
|
5
|
+
/tmp
|
|
6
|
+
/out-tsc
|
|
7
|
+
/bazel-out
|
|
8
|
+
|
|
9
|
+
# Node
|
|
10
|
+
/node_modules
|
|
11
|
+
npm-debug.log
|
|
12
|
+
yarn-error.log
|
|
13
|
+
|
|
14
|
+
# IDEs and editors
|
|
15
|
+
.idea/
|
|
16
|
+
.project
|
|
17
|
+
.classpath
|
|
18
|
+
.c9/
|
|
19
|
+
*.launch
|
|
20
|
+
.settings/
|
|
21
|
+
*.sublime-workspace
|
|
22
|
+
|
|
23
|
+
# Visual Studio Code
|
|
24
|
+
.vscode/*
|
|
25
|
+
!.vscode/settings.json
|
|
26
|
+
!.vscode/tasks.json
|
|
27
|
+
!.vscode/launch.json
|
|
28
|
+
!.vscode/extensions.json
|
|
29
|
+
.history/*
|
|
30
|
+
|
|
31
|
+
# Miscellaneous
|
|
32
|
+
/.angular/cache
|
|
33
|
+
.sass-cache/
|
|
34
|
+
/connect.lock
|
|
35
|
+
/coverage
|
|
36
|
+
/libpeerconnection.log
|
|
37
|
+
testem.log
|
|
38
|
+
/typings
|
|
39
|
+
|
|
40
|
+
# System files
|
|
41
|
+
.DS_Store
|
|
42
|
+
Thumbs.db
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aws-learning",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"ng": "ng",
|
|
6
|
+
"start": "ng serve",
|
|
7
|
+
"build": "ng build",
|
|
8
|
+
"watch": "ng build --watch --configuration development",
|
|
9
|
+
"test": "ng test",
|
|
10
|
+
"serve:ssr:aws-learning": "node dist/aws-learning/server/server.mjs",
|
|
11
|
+
"postinstall": "npm install angular-dumb-lib@latest --legacy-peer-deps"
|
|
12
|
+
},
|
|
13
|
+
"prettier": {
|
|
14
|
+
"overrides": [
|
|
15
|
+
{
|
|
16
|
+
"files": "*.html",
|
|
17
|
+
"options": {
|
|
18
|
+
"parser": "angular"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"private": true,
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@angular/common": "^20.1.0",
|
|
26
|
+
"@angular/compiler": "^20.1.0",
|
|
27
|
+
"@angular/core": "^20.1.0",
|
|
28
|
+
"@angular/forms": "^20.1.0",
|
|
29
|
+
"@angular/platform-browser": "^20.1.0",
|
|
30
|
+
"@angular/platform-server": "^20.1.0",
|
|
31
|
+
"@angular/router": "^20.1.0",
|
|
32
|
+
"@angular/ssr": "^20.1.5",
|
|
33
|
+
"angular-dumb-lib": "^0.0.40",
|
|
34
|
+
"express": "^5.1.0",
|
|
35
|
+
"marked": "^16.4.2",
|
|
36
|
+
"ngx-markdown": "^20.1.0",
|
|
37
|
+
"primeicons": "^7.0.0",
|
|
38
|
+
"primeng": "^21.0.2",
|
|
39
|
+
"rxjs": "~7.8.0",
|
|
40
|
+
"tslib": "^2.3.0",
|
|
41
|
+
"zone.js": "~0.15.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@angular/build": "^20.1.5",
|
|
45
|
+
"@angular/cli": "^20.1.5",
|
|
46
|
+
"@angular/compiler-cli": "^20.1.0",
|
|
47
|
+
"@types/express": "^5.0.1",
|
|
48
|
+
"@types/jasmine": "~5.1.0",
|
|
49
|
+
"@types/node": "^20.17.19",
|
|
50
|
+
"jasmine-core": "~5.8.0",
|
|
51
|
+
"karma": "~6.4.0",
|
|
52
|
+
"karma-chrome-launcher": "~3.2.0",
|
|
53
|
+
"karma-coverage": "~2.2.0",
|
|
54
|
+
"karma-jasmine": "~5.1.0",
|
|
55
|
+
"karma-jasmine-html-reporter": "~2.1.0",
|
|
56
|
+
"typescript": "~5.8.2"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# AWS Overview – Tổng quan về Amazon Web Services
|
|
2
|
+
|
|
3
|
+
## 1. AWS là gì?
|
|
4
|
+
|
|
5
|
+
**Amazon Web Services (AWS)** là nền tảng cloud computing do Amazon cung cấp, cho phép bạn:
|
|
6
|
+
- Thuê tài nguyên IT theo nhu cầu
|
|
7
|
+
- Trả tiền theo mức sử dụng
|
|
8
|
+
- Không cần đầu tư hạ tầng vật lý ban đầu
|
|
9
|
+
|
|
10
|
+
👉 Hiểu đơn giản: **AWS = thuê server, database, storage, network qua internet**.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Vì sao doanh nghiệp dùng AWS?
|
|
15
|
+
|
|
16
|
+
### 2.1 Không cần đầu tư ban đầu
|
|
17
|
+
- Không mua server
|
|
18
|
+
- Không xây data center
|
|
19
|
+
- Không cần đội vận hành lớn
|
|
20
|
+
|
|
21
|
+
### 2.2 Linh hoạt & mở rộng nhanh
|
|
22
|
+
- Tăng / giảm tài nguyên trong vài phút
|
|
23
|
+
- Phù hợp startup → enterprise
|
|
24
|
+
|
|
25
|
+
### 2.3 Trả tiền theo mức dùng
|
|
26
|
+
- Dùng bao nhiêu trả bấy nhiêu
|
|
27
|
+
- Không dùng thì gần như không tốn chi phí
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 3. Các nhóm dịch vụ chính của AWS
|
|
32
|
+
|
|
33
|
+
### 3.1 Compute – Xử lý (CPU)
|
|
34
|
+
Dùng để chạy application.
|
|
35
|
+
|
|
36
|
+
- **EC2**: Server ảo
|
|
37
|
+
- **Lambda**: Chạy code không cần server (serverless)
|
|
38
|
+
- **ECS / EKS**: Chạy container (Docker)
|
|
39
|
+
|
|
40
|
+
👉 Khi cần “chạy app” → nghĩ tới Compute.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
### 3.2 Storage – Lưu trữ
|
|
45
|
+
Dùng để lưu file, backup, static content.
|
|
46
|
+
|
|
47
|
+
- **S3**: Lưu file (object storage)
|
|
48
|
+
- **EBS**: Ổ cứng gắn vào EC2
|
|
49
|
+
- **EFS**: File system dùng chung
|
|
50
|
+
|
|
51
|
+
👉 Khi cần “lưu dữ liệu” → nghĩ tới Storage.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### 3.3 Database – Cơ sở dữ liệu
|
|
56
|
+
Dùng để lưu dữ liệu có cấu trúc.
|
|
57
|
+
|
|
58
|
+
- **RDS**: MySQL, PostgreSQL, SQL Server
|
|
59
|
+
- **DynamoDB**: NoSQL, serverless
|
|
60
|
+
- **Aurora**: Database hiệu năng cao
|
|
61
|
+
|
|
62
|
+
👉 Khi cần “lưu dữ liệu app” → nghĩ tới Database.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### 3.4 Networking – Mạng
|
|
67
|
+
Dùng để kết nối các tài nguyên.
|
|
68
|
+
|
|
69
|
+
- **VPC**: Mạng riêng trên AWS
|
|
70
|
+
- **Subnet**: Chia nhỏ mạng
|
|
71
|
+
- **Security Group**: Firewall
|
|
72
|
+
|
|
73
|
+
👉 Networking quyết định **bảo mật & kiến trúc**.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 4. Region & Availability Zone (AZ)
|
|
78
|
+
|
|
79
|
+
### Region
|
|
80
|
+
- Là khu vực địa lý (Tokyo, Singapore, Frankfurt…)
|
|
81
|
+
- Mỗi region độc lập
|
|
82
|
+
|
|
83
|
+
### Availability Zone (AZ)
|
|
84
|
+
- Là các data center độc lập trong 1 region
|
|
85
|
+
- Dùng để tăng độ sẵn sàng (high availability)
|
|
86
|
+
|
|
87
|
+
👉 Best practice:
|
|
88
|
+
- Production nên chạy **ít nhất 2 AZ**
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 5. AWS phù hợp với ai?
|
|
93
|
+
|
|
94
|
+
### Phù hợp nếu:
|
|
95
|
+
- Startup
|
|
96
|
+
- Doanh nghiệp muốn scale nhanh
|
|
97
|
+
- Dev làm sản phẩm, side project
|
|
98
|
+
|
|
99
|
+
### Không phù hợp nếu:
|
|
100
|
+
- Hệ thống cực kỳ nhỏ, không cần scale
|
|
101
|
+
- Không có người quản lý chi phí
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 6. Hiểu đúng về chi phí AWS
|
|
106
|
+
|
|
107
|
+
AWS **không đắt**, nhưng:
|
|
108
|
+
- Dễ **tốn tiền nếu không kiểm soát**
|
|
109
|
+
- Dễ quên tài nguyên đang chạy
|
|
110
|
+
|
|
111
|
+
👉 Luôn cần:
|
|
112
|
+
- Tắt resource không dùng
|
|
113
|
+
- Theo dõi billing
|
|
114
|
+
- Thiết kế kiến trúc tối giản
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 7. AWS trong lộ trình học
|
|
119
|
+
|
|
120
|
+
Bạn **không cần học hết AWS**.
|
|
121
|
+
|
|
122
|
+
Nên học theo thứ tự:
|
|
123
|
+
1. EC2
|
|
124
|
+
2. S3
|
|
125
|
+
3. RDS
|
|
126
|
+
4. IAM
|
|
127
|
+
5. VPC (cơ bản)
|
|
128
|
+
|
|
129
|
+
👉 Đủ để build & deploy 1 sản phẩm thực tế.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 8. Tổng kết
|
|
134
|
+
|
|
135
|
+
- AWS là nền tảng cloud lớn nhất hiện nay
|
|
136
|
+
- Cho phép xây dựng hệ thống nhanh, linh hoạt
|
|
137
|
+
- Quan trọng nhất: **hiểu bản chất dịch vụ, không học lan man**
|
|
138
|
+
|
|
139
|
+
👉 Phần tiếp theo: **EC2 là gì và khi nào nên dùng?**
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Amazon Aurora: RDS hiệu năng cao, HA và tự động mở rộng
|
|
2
|
+
|
|
3
|
+
Amazon Aurora là dịch vụ cơ sở dữ liệu quan hệ (RDS) được nâng cấp bởi AWS, tương thích với MySQL và PostgreSQL. Aurora cung cấp hiệu năng cao, khả năng High Availability (HA) và fault-tolerant thiết kế sẵn, đồng thời là managed service giúp tự động patch, backup và failover.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Khái niệm
|
|
8
|
+
|
|
9
|
+
- Aurora = RDS mạnh hơn thông thường, tối ưu performance và HA.
|
|
10
|
+
- Tốc độ nhanh hơn RDS thông thường (3–5x MySQL, 2x PostgreSQL)
|
|
11
|
+
- Managed service → không phải lo patch, backup, failover.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Phân loại (Engines / Editions)
|
|
16
|
+
|
|
17
|
+
- Aurora MySQL-compatible
|
|
18
|
+
- Aurora PostgreSQL-compatible
|
|
19
|
+
- Aurora Serverless v2 → scale tự động theo workload
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 3. Thành phần chính
|
|
24
|
+
|
|
25
|
+
| Component | Mô tả |
|
|
26
|
+
|--------------------|-------|
|
|
27
|
+
| DB Cluster | 1 primary + 0–15 read replicas |
|
|
28
|
+
| Primary instance | Chịu trách nhiệm read/write |
|
|
29
|
+
| Read Replicas | Chỉ đọc, giảm tải ứng dụng |
|
|
30
|
+
| Cluster volume | Storage 6 copies / 3 AZs, 64 TB max |
|
|
31
|
+
| Snapshots / Backups | Auto backup & manual snapshot |
|
|
32
|
+
| Aurora Serverless | Compute tự động scale theo request |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 4. Sử dụng và giải quyết vấn đề
|
|
37
|
+
|
|
38
|
+
### Vấn đề khi dùng RDS thông thường
|
|
39
|
+
- Performance giới hạn read/write
|
|
40
|
+
- Multi-AZ chỉ có 1 standby
|
|
41
|
+
- Scaling vertical có downtime
|
|
42
|
+
- Backup và failover chậm
|
|
43
|
+
|
|
44
|
+
### Aurora giải quyết
|
|
45
|
+
- High performance → ghi nhanh, read nhiều, auto split read replicas
|
|
46
|
+
- Highly available → 6 copies, tự phục hồi khi AZ down
|
|
47
|
+
- Auto scaling → Serverless scale theo workload
|
|
48
|
+
- Durable → Storage replicated across AZ
|
|
49
|
+
- Managed → Backup, patch, failover tự động
|
|
50
|
+
|
|
51
|
+
### Khi nào nên dùng
|
|
52
|
+
- Ứng dụng quan hệ cần performance cao
|
|
53
|
+
- Workload read-heavy (analytics/reporting)
|
|
54
|
+
- Multi-AZ cần HA và fault-tolerance
|
|
55
|
+
|
|
56
|
+
### Khi không nên dùng
|
|
57
|
+
- Workload non-relational → dùng DynamoDB
|
|
58
|
+
- Không cần performance cao → RDS bình thường rẻ hơn
|
|
59
|
+
- Cần full control OS hoặc custom DB → EC2 DB
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 5. Ưu điểm & Nhược điểm
|
|
64
|
+
|
|
65
|
+
### Ưu điểm
|
|
66
|
+
- Tốc độ cao (3–5x MySQL, 2x PostgreSQL)
|
|
67
|
+
- HA mạnh: 6 copies / 3 AZ
|
|
68
|
+
- Auto failover 30s–1 phút
|
|
69
|
+
- Auto backup & snapshot
|
|
70
|
+
- Auto scaling (Serverless v2)
|
|
71
|
+
- Read replicas up to 15
|
|
72
|
+
|
|
73
|
+
### Nhược điểm
|
|
74
|
+
- Chi phí cao hơn RDS bình thường
|
|
75
|
+
- Không custom OS
|
|
76
|
+
- Serverless v2 chưa suitable write-heavy cực lớn
|
|
77
|
+
- Multi-region replication không tự động (cần Aurora Global DB)
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## 6. So sánh với dịch vụ tương tự
|
|
82
|
+
|
|
83
|
+
### Aurora vs RDS MySQL/Postgres
|
|
84
|
+
|
|
85
|
+
| Feature | Aurora | RDS MySQL/Postgres |
|
|
86
|
+
|----------------------|---------------|------------------|
|
|
87
|
+
| Performance | 3–5x | Standard |
|
|
88
|
+
| Multi-AZ | 6 copies/3 AZ | 2 copies/2 AZ |
|
|
89
|
+
| Read replicas | Up to 15 | Max 5 |
|
|
90
|
+
| Auto failover | < 1 phút | 1–2 phút |
|
|
91
|
+
| Serverless option | Có | Không |
|
|
92
|
+
|
|
93
|
+
### Aurora vs DynamoDB
|
|
94
|
+
|
|
95
|
+
| Feature | Aurora | DynamoDB |
|
|
96
|
+
|----------------------|---------------|-----------------|
|
|
97
|
+
| Type | Relational | NoSQL |
|
|
98
|
+
| Queries | SQL | Key-value/document |
|
|
99
|
+
| Transactions | ACID | Limited |
|
|
100
|
+
| Scaling | Vertical + read scaling | Horizontal global scaling |
|
|
101
|
+
| HA in region | Có | Multi-region replication |
|
|
102
|
+
|
|
103
|
+
### Aurora vs RDS Multi-AZ
|
|
104
|
+
|
|
105
|
+
| Feature | Aurora | RDS Multi-AZ |
|
|
106
|
+
|----------------------|---------------|-----------------|
|
|
107
|
+
| Copies/AZ | 6 copies/3 AZ | 2 copies/2 AZ |
|
|
108
|
+
| Failover speed | Nhanh | Chậm |
|
|
109
|
+
| Read replicas | Up to 15 | Max 5 |
|
|
110
|
+
| Performance | Cao | Standard |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 7. Luồng hoạt động
|
|
115
|
+
|
|
116
|
+
1. App write → primary instance
|
|
117
|
+
2. Aurora lưu dữ liệu vào cluster volume (6 copies / 3 AZs)
|
|
118
|
+
3. Read requests → routed đến read replicas
|
|
119
|
+
4. Primary fail → auto failover → read replica chuyển thành primary
|
|
120
|
+
5. App reconnect tự động nhờ cluster endpoint
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 8. Cách mở rộng (Scaling)
|
|
125
|
+
|
|
126
|
+
- **Vertical scaling**: thay đổi instance type → downtime vài phút (Serverless tránh downtime)
|
|
127
|
+
- **Horizontal scaling**: Read replicas (up to 15) → chia tải đọc
|
|
128
|
+
- **Global scale**: Aurora Global DB → multi-region replication, RTO < 1 phút
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 9. Bảo mật
|
|
133
|
+
|
|
134
|
+
- VPC → private subnet
|
|
135
|
+
- Security Group → mở port 3306/5432
|
|
136
|
+
- IAM Authentication → MySQL/Postgres auth
|
|
137
|
+
- KMS encryption → at rest & in transit
|
|
138
|
+
- Snapshots encryption → backup bảo mật
|
|
139
|
+
- SSL/TLS → encrypt connection
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 10. Tích hợp với dịch vụ AWS khác
|
|
144
|
+
|
|
145
|
+
| Service | Công dụng |
|
|
146
|
+
|------------------|-------------------------------|
|
|
147
|
+
| EC2 / ECS / Lambda | Connect database |
|
|
148
|
+
| CloudWatch | Metrics & logs |
|
|
149
|
+
| CloudTrail | Audit actions |
|
|
150
|
+
| Secrets Manager | Store credentials |
|
|
151
|
+
| DMS | DB migration |
|
|
152
|
+
| S3 | Backup, data import/export |
|
|
153
|
+
| Aurora Global DB | Cross-region HA |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 11. Kiến trúc thực tế
|
|
158
|
+
|
|
159
|
+
### Web app read-heavy
|
|
160
|
+
- ALB → ECS Fargate → Aurora Cluster
|
|
161
|
+
- Primary (write)
|
|
162
|
+
- Read Replicas (read)
|
|
163
|
+
|
|
164
|
+
### Serverless App
|
|
165
|
+
- API Gateway → Lambda → Aurora Serverless v2
|
|
166
|
+
|
|
167
|
+
### Multi-region Disaster Recovery
|
|
168
|
+
- Aurora Global DB: US-East primary → EU secondary
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 12. Sự cố thường gặp & cách xử lý
|
|
173
|
+
|
|
174
|
+
| Issue | Cause | Fix |
|
|
175
|
+
|------------------------|---------------------------|-----|
|
|
176
|
+
| Connection timeout | SG, subnet | Check VPC/Security group |
|
|
177
|
+
| Write-heavy bottleneck | Primary overloaded | Add replicas, scale instance |
|
|
178
|
+
| Failover | Primary down | Auto failover → reconnect app |
|
|
179
|
+
| Read lag | Read replicas delayed | Reduce heavy writes / use reader endpoint |
|
|
180
|
+
| Storage full | Cluster volume limit | Enable autoscaling storage |
|
|
181
|
+
| Aurora Serverless cold start | No active connections | Adjust min capacity |
|