Skip to content

Commit 3117b3e

Browse files
authored
Merge pull request #184 from tebanieo/master
Simplified database prompts
2 parents 3f99219 + 51d3f24 commit 3117b3e

File tree

4 files changed

+108
-82
lines changed

4 files changed

+108
-82
lines changed

workshops/modernizr/prompts/01-mysql-analysis/tasks.md

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# MySQL Analysis - Tasks
22

3-
- [x] 0. Set up Git source control for the project
3+
**IMPORTANT**:
4+
- **Commit changes frequently** throughout this stage to maintain a clean Git history
5+
- **Use `git -P`** to avoid interactive prompts
6+
- **Mark tasks as completed** by changing `[ ]` to `[x]` as you finish each task
7+
- **Commit after each major task completion** with descriptive messages
8+
- **Update the tasks.md file** itself when marking tasks complete and commit those changes too
9+
- **DO NOT MODIFY THE CONTENT OF THIS FILE**: Only add a [x] mark to complete the task, for tracking purposes.
10+
- [ ] 0. Set up Git source control for the project
411
- Initialize GIT at the root of this workspace so you have a point to revert your changes if needed in the future
512
- You must always use git -P to avoid getting stuck in git operations
613
- The subfolders have compiled projects, make sure to create a gitignore so you track only what you will be modifying not the compiled version or the node_modules
@@ -9,7 +16,7 @@
916
- Commit the latest changes registered in the working log and other artifacts
1017
- _Requirements: 1.1, 1.2, 1.3, 1.4, 1.5_
1118

12-
- [x] 1. Identify current application access patterns
19+
- [ ] 1. Identify current application access patterns
1320
- Make sure you have a clean commit log
1421
- From the backend/ folder use the README.md to understand its API endpoints
1522
- Explore the backend/ folder to understand in detail the available access patterns
@@ -19,34 +26,46 @@
1926
- Update the file task.md once completed, please let the user know that you have completed this task and summarize what has been done
2027
- _Requirements: 3.3, 4.2, 4.4_
2128

22-
- [x] 2. Read MySQL source database information
29+
- [ ] 2. Analyze MySQL database logs for performance patterns
2330
- Make sure you have a clean commit log
24-
- From the database/ folder use the mysql_log_parser.py script to capture mysql query statistics
25-
- Use the MySQL MCP server's execute_sql tool to run SQL queries and collect the actual schema information deployed in the database, that will be used to understand the entity relationships
31+
- From the database/ folder use the mysql_log_parser.py script to capture mysql query statistics and performance data
32+
- Generate `artifacts/stage-01/01_2_mysql_log_analysis.md` with comprehensive analysis of:
33+
- Query frequency and patterns from log analysis
34+
- Performance bottlenecks and slow queries
35+
- Access pattern identification from actual usage
36+
- RPS estimates based on log data
37+
- Use a temporary file called `artifacts/stage-01/01_2_working_log.md` to track your current work and important notes
38+
- Update the file task.md once completed, please let the user know that you have completed this task and summarize what has been done
39+
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6_
40+
41+
- [ ] 3. Extract table structure using MySQL MCP server
42+
- Make sure you have a clean commit log
43+
- Use the MySQL MCP server's execute_sql tool to run SQL queries and collect the actual schema information deployed in the database
2644
- Write and execute SQL queries to extract table structures, relationships, indexes, and constraints for the online shopping store database
27-
- Using both results generate a comprehensive report where you explain the entity relationship information, table structure and add the access patterns at the bottom to understand the nature of the workload. DO NOT SUGGEST A DYNAMODB TABLE STRUCTURE
28-
- Generate focused artifacts as you progress: schema extraction results, entity relationships, table structures, performance analysis, and access patterns in separate files under `artifacts/stage-01/`
29-
- Use a temporary file called `artifacts/stage-01/01_2_working_log.md` so you can track what is your current work and important notes and use it as a reference
45+
- Generate `artifacts/stage-01/01_3_table_structure_analysis.md` with comprehensive documentation of:
46+
- Complete table definitions with columns, data types, and constraints
47+
- Primary keys, foreign keys, and indexes
48+
- Entity relationships and cardinalities
49+
- Current database schema structure
50+
- Use a temporary file called `artifacts/stage-01/01_3_working_log.md` to track your current work and important notes
51+
- DO NOT SUGGEST A DYNAMODB TABLE STRUCTURE - focus only on current MySQL analysis
3052
- Update the file task.md once completed, please let the user know that you have completed this task and summarize what has been done
31-
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 3.1, 3.2, 3.4, 3.5, 4.1, 4.3, 4.5_
53+
- _Requirements: 3.1, 3.2, 3.4, 3.5, 4.1, 4.3, 4.5_
3254

3355
## Output Validation Checklist
3456

3557
Before marking this stage complete, verify:
36-
- [x] Git repository initialized with proper .gitignore
37-
- [x] Working log files created in artifacts/stage-00/ and artifacts/stage-01/ directories
38-
- [ ] Modular artifacts created for each analysis component:
39-
- [x] `artifacts/stage-01/01_1_API_access_patterns.md` - Backend API endpoints and access patterns
40-
- [ ] `artifacts/stage-01/01_2_schema_extraction.md` - Raw SQL query results
41-
- [ ] `artifacts/stage-01/01_3_entity_relationships.md` - E-commerce entity analysis
42-
- [ ] `artifacts/stage-01/01_4_table_structures.md` - Detailed table definitions
43-
- [ ] `artifacts/stage-01/01_5_performance_analysis.md` - mysql_log_parser.py results
44-
- [ ] `artifacts/stage-01/01_6_access_patterns.md` - Identified access patterns
45-
- [ ] All MySQL tables, relationships, and constraints are documented in focused artifacts
46-
- [ ] Access patterns are identified from mysql_log_parser.py analysis
47-
- [ ] Entity relationship information explains e-commerce domain structure
48-
- [ ] Table structure includes detailed column definitions and constraints
49-
- [ ] Performance analysis results from Python script are included
58+
- [ ] Git repository initialized with proper .gitignore
59+
- [ ] Working log files created in artifacts/stage-00/ and artifacts/stage-01/ directories
60+
- [ ] **Three essential artifacts created**:
61+
- [ ] `artifacts/stage-01/01_1_API_access_patterns.md` - Backend API endpoints and access patterns from API specifications
62+
- [ ] `artifacts/stage-01/01_2_mysql_log_analysis.md` - Performance patterns and query statistics from mysql_log_parser.py
63+
- [ ] `artifacts/stage-01/01_3_table_structure_analysis.md` - Complete table structures and relationships from MySQL MCP server
64+
- [ ] API analysis includes detailed endpoint documentation and entity relationships
65+
- [ ] MySQL log analysis provides query frequency, performance bottlenecks, and RPS estimates
66+
- [ ] Table structure analysis includes complete schema with relationships, indexes, and constraints
67+
- [ ] All MySQL tables, relationships, and constraints are documented
68+
- [ ] Performance data from log analysis is comprehensive
5069
- [ ] Documentation focuses on current state analysis without DynamoDB suggestions
5170
- [ ] All changes are committed to Git with meaningful messages
5271

workshops/modernizr/prompts/02-a-dynamodb-data-modeling/design.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,28 @@ graph TD
5151
- **Scale Requirements**: [from 01_5_performance_analysis.md]
5252

5353
## Access Patterns Summary
54-
[Extracted from 01_1_API_access_patterns.md and 01_6_access_patterns.md]
54+
[Extracted from 01_1_API_access_patterns.md and 01_2_mysql_log_analysis.md]
5555
| Pattern | Description | RPS (Peak/Avg) | Type | Entities | Requirements |
5656
|---------|-------------|-----------------|------|----------|--------------|
5757
| 1 | Get user by ID | [USER PROVIDED] | Read | User | <50ms latency |
5858

5959
## Entity Relationships
60-
[From 01_3_entity_relationships.md]
60+
[From 01_3_table_structure_analysis.md]
6161
- User → Orders: 1:Many (cardinality from analysis)
6262
- Order → OrderItems: 1:Many (cardinality from analysis)
6363

6464
## Current MySQL Schema
65-
[From 01_2_schema_extraction.md and 01_4_table_structures.md]
65+
[From 01_3_table_structure_analysis.md]
6666
- Tables, columns, indexes, constraints
6767
- Current performance characteristics
6868
- Known bottlenecks and issues
6969

70+
## Performance Data
71+
[From 01_2_mysql_log_analysis.md]
72+
- Query frequency and patterns from log analysis
73+
- Performance bottlenecks and slow queries
74+
- RPS estimates based on actual usage
75+
7076
## Design Constraints and Preferences
7177
- Multi-table first approach (not single-table)
7278
- Natural keys preferred (user_id, order_id vs PK, SK)
@@ -102,6 +108,7 @@ interface MCPDynamoDBDesignRequest {
102108
}
103109

104110
interface MCPDynamoDBDesignResponse {
111+
data_model_document: string; // Complete dynamodb_data_model.md content
105112
recommended_design: {
106113
tables: TableDesign[];
107114
gsis: GSIDesign[];
@@ -116,10 +123,11 @@ interface MCPDynamoDBDesignResponse {
116123

117124
**MCP Server Usage Workflow**:
118125
1. **Design Request**: Send comprehensive context to MCP server
119-
2. **Design Analysis**: Receive multiple design options with trade-offs
120-
3. **Cost Analysis**: Get detailed cost breakdown and optimization suggestions
121-
4. **Risk Assessment**: Obtain hot partition and scaling risk analysis
122-
5. **Contract Generation**: Generate migration contract with MCP assistance
126+
2. **Data Model Generation**: MCP server creates `dynamodb_data_model.md` with complete design documentation
127+
3. **Design Analysis**: Receive multiple design options with trade-offs
128+
4. **Cost Analysis**: Get detailed cost breakdown and optimization suggestions
129+
5. **Risk Assessment**: Obtain hot partition and scaling risk analysis
130+
6. **Contract Generation**: Generate migration contract with MCP assistance
123131

124132
### 3. Design Validation and Enhancement System
125133
**Purpose**: Validate MCP server outputs and ensure completeness

0 commit comments

Comments
 (0)