Skip to content

Commit fde9f0b

Browse files
nickdalaKSchlobohm
andauthored
Architecture docs (#31)
* dev container matches repository name * add mwa java diagram * Prerequisites doc * Add the CHANGES doc that describes changes from RWA * Update README * prod deployment doc updates * Terraform refactoring * prod deployment scripts and readme * add contoso intro * add description of requirement and design changes * Update .gitignore --------- Co-authored-by: Ken Schlobohm <[email protected]>
1 parent 80cd226 commit fde9f0b

20 files changed

+2930
-118
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "web-app-pattern-java",
2+
"name": "modern-web-app-pattern-java",
33
"build": {
44
"dockerfile": "Dockerfile",
55
"args": {

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,8 @@ application-dev.properties
5353

5454
# Azure CLI configuration
5555
az_ssh_config/
56-
ssh-config
56+
ssh-config
57+
58+
# CAMS artifacts
59+
modern-java-web-email-processor-*.tar
60+
deployment-env

CHANGES.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Modernization Journey of Contoso Fiber's CAMS Web App
2+
3+
After migrating their Customer Account Management System (CAMS) to Azure, Contoso Fiber achieved their initial goals: a 99.9% SLO, optimized costs, and expanded reach. However, they recognized that leveraging Azure's cloud-native services would further improve agility, reliability, and scalability
4+
5+
## Modern Web App pattern for Java
6+
Building on the prior [Reliable Web App pattern for Java](https://aka.ms/eap/rwa/java), which re-platformed CAMS in Azure with minimal code changes, Contoso now focuses on a Modern Web App Pattern to better utilize cloud-native capabilities. This phase involves:
7+
8+
- Refactoring the Monolith: By using the strangler-fig pattern, Contoso is gradually transforming the monolithic CAMS into modular components, enhancing scalability.
9+
- Applying Queue-Based Load Leveling: This pattern optimizes performance by buffering external dependencies like email services, reducing load peaks.
10+
- Improving Security and Reliability: Isolating services allows Contoso to better secure components and contain any potential failures.
11+
12+
This modernization lays a cloud-native foundation for CAMS, positioning Contoso Fiber for sustainable growth and adaptability.
13+
14+
## New services
15+
16+
* **Azure Container Apps** - The Modern Web App pattern reference sample uses Azure Container Apps to host a new email processing service that was separated from the web API as part of applying the [Strangler Fig pattern](https://learn.microsoft.com/azure/architecture/patterns/strangler-fig). Azure Container Apps is a fully managed serverless platform for running containerized apps. The reference sample uses Azure Container Apps because it provides managed container orchestration with support for automatic scale-in and scale-out based on a wide variety of rules using [KEDA](https://keda.sh/docs/2.13/) scalers. This allows the email processing service to automatically scale to zero when there is no work to be done and automatically scale up, as needed, based on the number of messages in the Service Bus queue.
17+
18+
* **Azure Container Registry** - Because the Modern Web App pattern reference sample uses Azure Container Apps, it also uses Azure Container Registry to store the container images for the email processing service. Azure Container Registry allows you to build, store, and manage container images and artifacts in a private registry for all types of container deployments. Azure Container Registry supports the reference sample's SLO goals by being highly available thanks to its [geo-replication](https://learn.microsoft.com/azure/container-registry/container-registry-geo-replication#configure-geo-replication) feature.
19+
20+
* **Azure Service Bus** - The Modern Web App pattern reference sample uses Azure Service Bus to enable message-based communication between the CAMS Application and the new email processing service. Using message-based communication allows improved reliability and performance by decoupling the CAMS application from the email processing service. Applying a [Queue-Based Load Leveling pattern](https://learn.microsoft.com/azure/architecture/patterns/queue-based-load-leveling) means that neither the CAMS application nor the email processing service will be affected by large numbers of email requests. The reference sample uses Azure Service Bus because it provides a fully managed, reliable, and secure messaging service that supports the reference sample's SLO goals.
21+
22+
* **Azure App Configuration Feature Manager** - The Modern Web App pattern uses Azure App Configuration to store the CAMS application settings. Azure App Configuration is a managed service that provides a central place to manage application settings and feature flags.

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Contributing
2+
3+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
4+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
5+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
6+
7+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
8+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
9+
provided by the bot. You will only need to do this once across all repos using our CLA.
10+
11+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
12+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
13+
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

README.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22

33
## Introduction
44

5-
This repository contains a collection of patterns and best practices for building modern Java web applications. The patterns are designed to be used with the [Spring Framework](https://spring.io/) and [Azure](https://azure.microsoft.com/), but can be adapted to other frameworks and cloud providers.
5+
This repository provides a "real-world" application that implements the best practices and design patterns discussed in [Modern Web App pattern for Java](https://aka.ms/eap/mwa/java/doc). The patterns are designed to be used with the [Spring Framework](https://spring.io/) and [Azure](https://azure.microsoft.com/), but can be adapted to other frameworks and cloud providers.
66

7+
This project has [a companion article in the Azure Architecture Center](https://aka.ms/eap/mwa/java/doc) that describes design patterns and best practices. Here's an outline of the contents in this readme:
78

8-
## Prerequisites
9+
- [Architecture](#architecture)
10+
- [Workflow](#workflow)
11+
- [Steps to deploy the reference implementation](#steps-to-deploy-the-reference-implementation)
12+
- [Changes from Reliable Web App](./CHANGES.md)
13+
- [Additional links](#additional-links)
14+
- [Data Collection](#data-collection)
915

10-
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
11-
- [Azure Dev CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd?tabs=winget-windows%2Cbrew-mac%2Cscript-linux&pivots=os-mac)
12-
- [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli)
13-
- [jq](https://stedolan.github.io/jq/download/)
14-
- [Java 17](https://adoptopenjdk.net/)
15-
- [Maven 3.9.1](https://maven.apache.org/download.cgi)
16-
- [Protoc](https://grpc.io/docs/protoc-installation/)
16+
## Architecture
17+
18+
Contoso Fiber aligned to a hub and spoke network topology in the production deployment architecture to centralize common resources. This network topology provided cost savings, enhanced security, and facilitated network integration (platform and hybrid):
19+
20+
![Architecture](./docs/assets/diagrams/modern-web-app-java.svg)
1721

1822
## Steps to deploy the reference implementation
1923

@@ -59,7 +63,7 @@ Once the command palette is open, search for `Dev Containers: Rebuild and Reopen
5963

6064
![WSL Ubuntu](docs/assets/vscode-reopen-in-container-command.png)
6165

62-
## Login to Azure
66+
### 3. Login to Azure
6367

6468
Before deploying, you must be authenticated to Azure and have the appropriate subscription selected. Run the following command to authenticate:
6569

@@ -95,7 +99,7 @@ If you have multiple tenants, you can use the following command to log into the
9599
azd auth login --tenant-id <tenant-id>
96100
```
97101

98-
## Create a new environment
102+
### 4. Create a new environment
99103

100104
Next we provide the AZD tool with variables that it uses to create the deployment. The first thing we initialize is the AZD environment with a name.
101105

@@ -123,23 +127,23 @@ Optional: Set the App Registration Service management reference:
123127
azd env set AZURE_SERVICE_MANAGEMENT_REFERENCE <service_management_reference>
124128
```
125129

126-
## Build the applications
130+
### 5. Build the applications
127131

128132
Run the following command to build the applications:
129133

130134
```shell
131135
./mvnw clean install
132136
```
133137

134-
## Create the Azure resources and deploy the code
138+
### 6. Create the Azure resources and deploy the code
135139

136140
Run the following command to create the Azure resources and deploy the code (about 15-minutes to complete):
137141

138142
```shell
139143
azd up
140144
```
141145

142-
## Tear down the deployment
146+
### 7. Tear down the deployment
143147

144148
Run the following command to tear down the deployment:
145149

@@ -161,10 +165,26 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
161165
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
162166
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
163167

168+
## Additional links
169+
170+
- [Known issues](known-issues.md)
171+
- [Troubleshooting](troubleshooting.md)
172+
- [Pattern Simulations](demo.md)
173+
- [Developer Experience](developer-experience.md)
174+
- [Calculating SLA](sla-calculation.md)
175+
- [Find additional resources](additional-resources.md)
176+
- [Report security concerns](SECURITY.md)
177+
- [Find Support](SUPPORT.md)
178+
- [Contributing](CONTRIBUTING.md)
179+
164180
## Trademarks
165181

166182
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
167183
trademarks or logos is subject to and must follow
168184
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
169185
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
170186
Any use of third-party trademarks or logos are subject to those third-party's policies.
187+
188+
## Data Collection
189+
190+
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkId=521839. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

additional-resources.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Starting your modernization journey
2+
3+
In this guide, we've shared how Contoso Fiber modernized their Customer Account Management System (CAMS) by leveraging Azure's cloud-native capabilities, addressing scalability, reliability, and cost optimization. Contoso made these changes to break free from limitations of their monolithic setup, allowing for easier scaling and more efficient handling of fluctuating demand. These strategies, drawn from Azure resources and best practices, illustrate a modernization path that other businesses can follow to achieve similar benefits.
4+
5+
This section highlights those key resources, providing a deeper dive into Azure’s architecture and modernization techniques that empower other projects to succeed with cloud-native solutions.
6+
7+
## Additional sources for Azure Best Practices
8+
9+
Use the following resources to learn more about Microsoft's best practices and recommendations for building solutions on Azure.
10+
11+
For further guidance on how to build Azure solutions that align with Microsoft's best practices and recommendations
12+
13+
- [Cloud Adoption Framework](https://learn.microsoft.com/azure/cloud-adoption-framework/overview) - Helps an organization prepare and execute their strategy to build solutions on Azure.
14+
- [Azure Architecture Center fundamentals](https://learn.microsoft.com/azure/architecture/guide/) - Provides a library of content that presents a structured approach for designing applications on Azure that are scalable, secure, resilient, and highly available.
15+
- [Well Architected Framework](https://learn.microsoft.com/azure/architecture/framework/) - Describes the best practices and design principles that should be applied when designing Azure solutions that align with Microsoft's recommended best practices.
16+
- [Azure Architectures](https://learn.microsoft.com/azure/architecture/browse/) - Provides architecture diagrams and technology descriptions for reference architectures, real world examples of cloud architectures, and solution ideas for common workloads on Azure.
17+
18+
## Additional sources for Azure Migration
19+
20+
The following tools and resources can help you with migrating on-prem resources to Azure.
21+
22+
- [Azure Migrate](https://learn.microsoft.com/azure/migrate/migrate-services-overview) - Azure Migrate provides a simplified migration, modernization, and optimization service for Azure that handles assessment, migration of web apps, SQL server, and Virtual Machines.
23+
- [Azure Database Migration Guides](https://learn.microsoft.com/data-migration/) - Provides resources for different database types, and different tools designed for your migration scenario.
24+
- [Azure App Service Landing Zone Accelerator](https://learn.microsoft.com/azure/cloud-adoption-framework/scenarios/app-platform/app-services/landing-zone-accelerator) - Deployment architecture guidance for hardening and scaling Azure App Service deployments.
25+
- [Register an application](https://learn.microsoft.com/entra/identity-platform/quickstart-register-app) - Quickstart: Register an application with the Microsoft identity platform.
26+
- [Application authentication certificate credentials](https://learn.microsoft.com/entra/identity-platform/certificate-credentials) - Microsoft identity platform application authentication certificate credentials.
27+
28+
## References
29+
30+
- [Well-Architected Framework](https://docs.microsoft.com/azure/architecture/framework/)
31+
- [12 Factor Application](https://12factor.net/)
32+
- [Retry Pattern](https://docs.microsoft.com/azure/architecture/patterns/retry)

0 commit comments

Comments
 (0)