Skip to content

Commit c4baf36

Browse files
authored
+ std opt for each question to improve UX
- Highlighted the static nature of the frontend and optional backend functionality. - Added standardized options for each question to improve user-friendliness. - Included detailed steps for deploying both the frontend and backend to Azure. - Provided a clear example of how the tool works.
1 parent 7665dc4 commit c4baf36

4 files changed

Lines changed: 97 additions & 29 deletions

File tree

tool/README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Last updated: 2025-06-20
2626
The **Azure Databases Advisor Tool** is designed to help users select the most suitable Azure database service based on their specific use case. It provides recommendations by analyzing user inputs such as data type, scalability needs, latency requirements, and more.
2727

2828
This tool consists of:
29-
- **Static Frontend**: A web-based interface for users to input their requirements and view recommendations.
29+
- **Static Frontend**: A web-based interface for users to input their requirements and view recommendations. The frontend operates independently and uses hardcoded logic for recommendations.
3030
- **Optional Backend**: A Flask API that processes user inputs and provides dynamic recommendations. The backend must be deployed separately to enable advanced functionality.
3131

3232
## Features
@@ -78,15 +78,29 @@ The backend (Flask API) processes user inputs and generates recommendations dyna
7878

7979
The tool now includes the following questions to refine recommendations:
8080
- **Data Volume**: Expected size and growth.
81+
- Options: `<10GB`, `10GB-1TB`, `>1TB`.
8182
- **Data Type**: Structured, semi-structured, or unstructured.
82-
- **Performance Requirements**: Latency and throughput needs.
83-
- **Scalability**: Horizontal or vertical scaling, global distribution.
83+
- Options: `Structured`, `Semi-structured`, `Unstructured`.
84+
- **Latency Requirements**: Maximum acceptable delay for database operations.
85+
- Options: `<10ms`, `10-100ms`, `>100ms`.
86+
- **Scalability Needs**: Horizontal or vertical scaling, global distribution.
87+
- Options: `Global`, `Local`.
8488
- **Consistency Model**: Strong or eventual consistency.
89+
- Options: `Strong`, `Eventual`.
8590
- **Integration Needs**: Compatibility with Azure services.
86-
- **Security and Compliance**: Encryption, role-based access control, compliance requirements.
91+
- Options: `Yes`, `No`.
92+
- **Security Requirements**: Encryption, role-based access control, compliance requirements.
93+
- Options: `Encryption`, `RBAC`, `Compliance`.
8794
- **Budget Constraints**: Monthly budget for database services.
88-
- **Deployment Model**: Fully managed (PaaS), self-hosted (IaaS), or serverless.
95+
- Options: `<100 USD`, `100-500 USD`, `>500 USD`.
8996
- **Use Case Specifics**: OLTP, OLAP, or AI/ML workloads.
97+
- Options: `OLTP`, `OLAP`, `AI/ML`.
98+
- **Backup and Disaster Recovery**: Automated backups and disaster recovery options.
99+
- Options: `Yes`, `No`.
100+
- **Query Complexity**: Expected complexity of database queries.
101+
- Options: `Simple`, `Moderate`, `Complex`.
102+
- **Data Retention Policy**: Retention period for data.
103+
- Options: `Short-term`, `Medium-term`, `Long-term`.
90104

91105
## Example Recommendation Flow
92106

tool/backend/app.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,30 @@ def recommend_database():
1313
integration_needs = data.get('integration_needs')
1414
security = data.get('security')
1515
budget = data.get('budget')
16-
deployment_model = data.get('deployment_model')
1716
use_case = data.get('use_case')
17+
backup_recovery = data.get('backup_recovery')
18+
query_complexity = data.get('query_complexity')
19+
data_retention = data.get('data_retention')
1820

1921
# Example recommendation logic
2022
if use_case == "OLTP":
2123
if data_type == "structured" and scalability == "global":
2224
recommendation = "Azure Cosmos DB (SQL API)"
23-
elif data_volume < 10 and budget < 100:
25+
elif data_volume == "<10GB" and budget == "<100 USD":
2426
recommendation = "Azure SQL Database (Serverless)"
2527
else:
2628
recommendation = "Azure Database for PostgreSQL"
2729
elif use_case == "OLAP":
2830
recommendation = "Azure Synapse Analytics"
31+
elif use_case == "AI/ML":
32+
recommendation = "Azure Cosmos DB (Gremlin API)"
2933
else:
3034
recommendation = "Azure Blob Storage or Azure Data Lake Storage"
3135

36+
# Add logic for query complexity and data retention
37+
if query_complexity == "complex" and data_retention == "long-term":
38+
recommendation += " with advanced analytics and long-term storage options."
39+
3240
return jsonify({"recommendation": recommendation})
3341

3442
if __name__ == '__main__':

tool/web-app/index.html

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,86 @@ <h1>Azure Database Selector</h1>
1212
</header>
1313
<main>
1414
<form id="advisor-form">
15-
<label for="data-volume">Data Volume (GB):</label>
16-
<input type="number" id="data-volume" name="data-volume" required>
15+
<label for="data-volume">Data Volume:</label>
16+
<select id="data-volume" name="data-volume" required title="Select the expected size of your data.">
17+
<option value="<10GB">Less than 10GB</option>
18+
<option value="10GB-1TB">10GB to 1TB</option>
19+
<option value=">1TB">More than 1TB</option>
20+
</select>
1721

1822
<label for="data-type">Data Type:</label>
19-
<select id="data-type" name="data-type" required>
20-
<option value="structured">Structured</option>
21-
<option value="semi-structured">Semi-structured</option>
22-
<option value="unstructured">Unstructured</option>
23+
<select id="data-type" name="data-type" required title="Choose the type of data you will store.">
24+
<option value="structured">Structured (e.g., tables)</option>
25+
<option value="semi-structured">Semi-structured (e.g., JSON, XML)</option>
26+
<option value="unstructured">Unstructured (e.g., images, videos)</option>
2327
</select>
2428

2529
<label for="latency">Latency Requirements:</label>
26-
<input type="text" id="latency" name="latency" required>
30+
<select id="latency" name="latency" required title="Select the maximum acceptable delay for database operations.">
31+
<option value="<10ms">Less than 10ms</option>
32+
<option value="10-100ms">10ms to 100ms</option>
33+
<option value=">100ms">More than 100ms</option>
34+
</select>
2735

2836
<label for="scalability">Scalability Needs:</label>
29-
<input type="text" id="scalability" name="scalability" required>
37+
<select id="scalability" name="scalability" required title="Choose whether the database needs to scale globally or locally.">
38+
<option value="global">Global</option>
39+
<option value="local">Local</option>
40+
</select>
3041

3142
<label for="consistency">Consistency Model:</label>
32-
<select id="consistency" name="consistency" required>
43+
<select id="consistency" name="consistency" required title="Select the consistency model for your database.">
3344
<option value="strong">Strong</option>
3445
<option value="eventual">Eventual</option>
3546
</select>
3647

3748
<label for="integration-needs">Integration Needs:</label>
38-
<input type="text" id="integration-needs" name="integration-needs">
49+
<select id="integration-needs" name="integration-needs" title="Specify if the database needs to integrate with other Azure services.">
50+
<option value="yes">Yes</option>
51+
<option value="no">No</option>
52+
</select>
3953

4054
<label for="security">Security Requirements:</label>
41-
<input type="text" id="security" name="security">
42-
43-
<label for="budget">Budget (USD/month):</label>
44-
<input type="number" id="budget" name="budget" required>
55+
<select id="security" name="security" title="Select the security features required for your database.">
56+
<option value="encryption">Encryption</option>
57+
<option value="rbac">Role-based Access Control</option>
58+
<option value="compliance">Compliance</option>
59+
</select>
4560

46-
<label for="deployment-model">Deployment Model:</label>
47-
<select id="deployment-model" name="deployment-model" required>
48-
<option value="PaaS">Fully Managed (PaaS)</option>
49-
<option value="IaaS">Self-hosted (IaaS)</option>
50-
<option value="Serverless">Serverless</option>
61+
<label for="budget">Budget:</label>
62+
<select id="budget" name="budget" required title="Choose your monthly budget for database services.">
63+
<option value="<100 USD">Less than 100 USD</option>
64+
<option value="100-500 USD">100 to 500 USD</option>
65+
<option value=">500 USD">More than 500 USD</option>
5166
</select>
5267

5368
<label for="use-case">Use Case:</label>
54-
<select id="use-case" name="use-case" required>
69+
<select id="use-case" name="use-case" required title="Select the primary use case for your database.">
5570
<option value="OLTP">Transactional Processing (OLTP)</option>
5671
<option value="OLAP">Analytical Processing (OLAP)</option>
5772
<option value="AI/ML">AI/ML Workloads</option>
5873
</select>
5974

75+
<label for="backup-recovery">Backup and Disaster Recovery:</label>
76+
<select id="backup-recovery" name="backup-recovery" title="Specify if automated backups and disaster recovery are required.">
77+
<option value="yes">Yes</option>
78+
<option value="no">No</option>
79+
</select>
80+
81+
<label for="query-complexity">Query Complexity:</label>
82+
<select id="query-complexity" name="query-complexity" title="Select the expected complexity of database queries.">
83+
<option value="simple">Simple (e.g., basic CRUD operations)</option>
84+
<option value="moderate">Moderate (e.g., joins, aggregations)</option>
85+
<option value="complex">Complex (e.g., advanced analytics, AI/ML queries)</option>
86+
</select>
87+
88+
<label for="data-retention">Data Retention Policy:</label>
89+
<select id="data-retention" name="data-retention" title="Choose the expected retention period for your data.">
90+
<option value="short-term">Short-term (e.g., days or weeks)</option>
91+
<option value="medium-term">Medium-term (e.g., months)</option>
92+
<option value="long-term">Long-term (e.g., years)</option>
93+
</select>
94+
6095
<button type="submit">Get Recommendation</button>
6196
</form>
6297

tool/web-app/script.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,24 @@ document.getElementById('advisor-form').addEventListener('submit', async (event)
99
const integrationNeeds = document.getElementById('integration-needs').value;
1010
const security = document.getElementById('security').value;
1111
const budget = document.getElementById('budget').value;
12-
const deploymentModel = document.getElementById('deployment-model').value;
1312
const useCase = document.getElementById('use-case').value;
13+
const backupRecovery = document.getElementById('backup-recovery').value;
1414

1515
const response = await fetch('http://your-backend-url/recommend', {
1616
method: 'POST',
1717
headers: { 'Content-Type': 'application/json' },
18-
body: JSON.stringify({ data_volume: dataVolume, data_type: dataType, latency, scalability, consistency, integration_needs: integrationNeeds, security, budget, deployment_model: deploymentModel, use_case: useCase })
18+
body: JSON.stringify({
19+
data_volume: dataVolume,
20+
data_type: dataType,
21+
latency,
22+
scalability,
23+
consistency,
24+
integration_needs: integrationNeeds,
25+
security,
26+
budget,
27+
use_case: useCase,
28+
backup_recovery: backupRecovery
29+
})
1930
});
2031

2132
const result = await response.json();

0 commit comments

Comments
 (0)