-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add database scalability labs with interactive visualizer #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 on lines
+13
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not exclude Module 10 CloudFormation templates from YAML validation. Line 13–Line 14 broadens 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 🤖 Prompt for AI Agents |
||
| )$ | ||
| - id: check-json | ||
| - id: check-added-large-files | ||
|
|
||
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 |
||
Uh oh!
There was an error while loading. Please reload this page.