Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ repos:
01-introduction-horizontal-scalability/ecsdemo-.*/kubernetes/.*|
01-introduction-horizontal-scalability/ecsdemo-.*/copilot/.*|
08-cloud-networking-vpc/cloudformation/.*|
09-distributed-file-systems/cloudformation\.yaml
09-distributed-file-systems/cloudformation\.yaml|
10-databases/.*/cloudformation\.yaml
Comment thread
gamaware marked this conversation as resolved.
Comment on lines +13 to +14
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Do not exclude Module 10 CloudFormation templates from YAML validation.

Line 13–Line 14 broadens check-yaml exclusions to skip all 10-databases/*/cloudformation.yaml, which removes syntax validation for newly added infra templates. Keep these files validated and only carve out exclusions for parser-incompatible edge cases with clear justification.

Suggested fix
       - id: check-yaml
         exclude: |
           (?x)^(
             01-introduction-horizontal-scalability/ecsdemo-.*/kubernetes/.*|
             01-introduction-horizontal-scalability/ecsdemo-.*/copilot/.*|
             08-cloud-networking-vpc/cloudformation/.*|
-            09-distributed-file-systems/cloudformation\.yaml|
-            10-databases/.*/cloudformation\.yaml
+            09-distributed-file-systems/cloudformation\.yaml
           )$

Based on learnings: Applies to .yml,.yaml : All YAML files must pass check-yaml validation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml around lines 13 - 14, The check-yaml exclusion
currently skips all Module 10 CloudFormation templates via the pattern
"10-databases/.*/cloudformation\.yaml"; remove that pattern (or replace it with
a narrowly scoped exception for the specific parser-incompatible file) from the
exclusions in .pre-commit-config.yaml so that all Module 10 (*.yml/*.yaml)
CloudFormation templates are validated by check-yaml; if you must keep an
exclusion, document the exact filename and reason and use that exact path
instead of the broad "10-databases/.*/cloudformation\.yaml" pattern.

)$
- id: check-json
- id: check-added-large-files
Expand Down
42 changes: 39 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@
"filename": "06-security-https-oauth2-keycloak/README.md",
"hashed_secret": "44b5ba9d33e8bcaefe1d26c4665f20a90fb84b5a",
"is_verified": false,
"line_number": 665
"line_number": 668
},
{
"type": "Secret Keyword",
"filename": "06-security-https-oauth2-keycloak/README.md",
"hashed_secret": "2be88ca4242c76e8253ac62474851065032d6833",
"is_verified": false,
"line_number": 699
"line_number": 702
}
],
"08-cloud-networking-vpc/LAB-MACOS.md": [
Expand All @@ -217,7 +217,43 @@
"is_verified": false,
"line_number": 108
}
],
"10-databases/mysql/docker-compose.yml": [
{
"type": "Secret Keyword",
"filename": "10-databases/mysql/docker-compose.yml",
"hashed_secret": "e63a0ab2f8e7ecde486b42ebfec16d4434840af4",
"is_verified": false,
"line_number": 6
}
],
"10-databases/mysql/setup.sh": [
{
"type": "Secret Keyword",
"filename": "10-databases/mysql/setup.sh",
"hashed_secret": "7667ad761bd61125e6eb84aafc63fe3bb914ab5b",
"is_verified": false,
"line_number": 81
}
],
"10-databases/visualizer/docker-compose.yml": [
{
"type": "Secret Keyword",
"filename": "10-databases/visualizer/docker-compose.yml",
"hashed_secret": "e63a0ab2f8e7ecde486b42ebfec16d4434840af4",
"is_verified": false,
"line_number": 8
}
],
"10-databases/visualizer/setup.sh": [
{
"type": "Secret Keyword",
"filename": "10-databases/visualizer/setup.sh",
"hashed_secret": "7667ad761bd61125e6eb84aafc63fe3bb914ab5b",
"is_verified": false,
"line_number": 54
}
]
},
"generated_at": "2026-03-28T05:23:05Z"
"generated_at": "2026-04-14T01:35:11Z"
}
63 changes: 63 additions & 0 deletions 10-databases/LAB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Lab 10: Database Scalability

## Main Lab (Interactive Visualizer)

The primary lab for this module is an interactive web visualizer
connected to a live MySQL primary-replica cluster. It covers three
scalability mechanisms through animated diagrams, real SQL execution,
and a built-in SQL console.

| Lab | What It Covers | Time |
| --- | --- | --- |
| [Interactive Visualizer](visualizer/LAB-VISUALIZER.md) | Replication, ACID transactions, indexing -- all via browser | ~45 min |

```bash
cd 10-databases/visualizer
./setup.sh
# Open http://localhost:8081
```

## Optional Labs (CLI-based, deeper dive)

For students who want to go deeper with other database paradigms,
three optional CLI labs use the same university enrollment data model:

| Lab | Database | Scalability Mechanisms | Time |
| --- | --- | --- | --- |
| [10A: MySQL](mysql/LAB-MYSQL.md) | MySQL 8 (Relational) | GTID replication, ACID transactions, indexing | ~30 min |
| [10B: MongoDB](mongodb/LAB-MONGODB.md) | MongoDB 7 (Document) | Replica set, read/write concerns, denormalization | ~30 min |
| [10C: Cassandra](cassandra/LAB-CASSANDRA.md) | Cassandra 4.1 (Wide-column) | Multi-node ring, tunable consistency, partition keys | ~30 min |

## Scalability Mechanisms Compared

| Mechanism | MySQL | MongoDB | Cassandra |
| --- | --- | --- | --- |
| **Replication** | Primary + replica (GTID) | 3-node replica set | 3-node ring (RF=3) |
| **Failover** | Manual promotion | Automatic election | No single point of failure |
| **Consistency** | ACID transactions | Tunable write/read concern | Tunable CL (ONE/QUORUM/ALL) |
| **Schema** | Rigid, normalized | Flexible, denormalized | Query-driven, partition keys |
| **Scaling reads** | Add read replicas | Read from secondaries | Read from any node |
| **Scaling writes** | Vertical only | Sharding (manual) | Add nodes to ring |

## Shared Data Model

All labs use the same university enrollment scenario:

- **Students** -- 10 students with name, email, major
- **Courses** -- 4 courses with code, title, capacity
- **Enrollments** -- student-to-course relationships

This lets you compare how the same data is modeled differently in
each paradigm (tables with foreign keys vs embedded documents vs
partition-key-driven tables).

## Environment Options

Each lab supports two environments:

| Environment | What You Need | Setup |
| --- | --- | --- |
| **Local** | Docker Desktop | `./setup.sh` in the lab directory |
| **EC2** | Browser + SSH | Upload `cloudformation.yaml` via AWS Console |

Run one lab at a time to avoid port conflicts and resource contention.
Comment on lines +54 to +63
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add EC2 sizing guidance for the multi-node labs.

This table implies every lab is fine on a generic EC2 host, but the MongoDB and Cassandra labs run multiple database nodes and are much heavier than a standard free-tier-style instance. Call out minimum sizing here, or steer low-resource users to local setup / MySQL first.

📝 Suggested fix
 | **Local** | Docker Desktop | `./setup.sh` in the lab directory |
 | **EC2** | Browser + SSH | Upload `cloudformation.yaml` via AWS Console |
 
+> Note: the MongoDB and Cassandra labs run multiple database nodes and typically need more memory than a standard AWS Free Tier-style instance.
+> If you're on a low-resource host, prefer local Docker or start with the MySQL lab first.
+
 Run one lab at a time to avoid port conflicts and resource contention.

As per coding guidelines, "Review lab content for technical accuracy, clear step-by-step instructions, and educational value. Flag any steps that may not work in a standard AWS Free Tier environment."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@10-databases/LAB.md` around lines 54 - 63, The "Environment Options" section
and its table (headers "Environment Options", rows "Local" and "EC2", and
artifacts like `./setup.sh` and `cloudformation.yaml`) needs EC2 sizing
guidance: update this section to call out that multi-node labs (MongoDB,
Cassandra) require larger instances (recommend minimum t3.medium/t3.large or
m5.large with 2+ vCPUs and >=4–8GB RAM and adequate EBS) or advise users on
alternatives (use Local/Docker or run single-node MySQL first) and add a short
note directing low-resource users to the Local setup or to follow smaller
single-node lab options; keep the guidance brief and place it directly below the
existing table.

Loading
Loading