Skip to content

Commit a956e19

Browse files
authored
Azure Architecture guidance (#6140)
1 parent da15e5d commit a956e19

File tree

74 files changed

+1076
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1076
-299
lines changed

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"MD025": {
66
"front_matter_title": ""
77
}
8-
}
8+
},
9+
"dotnet.defaultSolution": "disable"
910
}

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,14 @@ upgradeGuideCoreVersions:
206206

207207
To mark a page as belonging to the [Particular Software Learning Path](https://particular.net/learn) use `isLearningPath: true`.
208208

209+
#### Calls to action
210+
211+
```yaml
212+
callsToAction: ['architecture-review', 'solution-architect']
213+
```
214+
215+
Calls to action are defined in `calls-to-action.yaml`.
216+
209217
### An example header for an article
210218

211219
In the following example, whenever the URLs `/servicecontrol/sc-si` or `/servicecontrol/debugging-servicecontrol` are being requested, the given article will be rendered.
Binary file not shown.
61.1 KB
Loading
120 KB
Loading
Loading
85.1 KB
Loading
Loading
187 KB
Loading
120 KB
Loading

architecture/azure/compute.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Azure compute services
3+
summary:
4+
reviewed: 2023-07-18
5+
callsToAction: ['solution-architect', 'poc-help']
6+
---
7+
8+
Azure offers a [wide range of options](https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/compute-decision-tree) for hosting and running system components, ranging from full control of a virtual machine, including the operating system, to fully managed services.
9+
10+
The Particular Service Platform may be hosted using several Azure hosting models:
11+
12+
![](azure-compute-overview.png)
13+
14+
## Serverless
15+
16+
In serverless (also referred to as "Functions as a service (FaaS)") models, code is deployed directly to the service which runs it.
17+
18+
[Azure Functions](https://azure.microsoft.com/en-us/products/functions) is Azure's serverless hosting model. NServiceBus supports integration with Azure Functions that allows deployment of new or existing NServiceBus applications into serverless environments with minimal effort. NServiceBus applications on Azure Functions can directly consume messages from Azure Service Bus. [Other Azure Functions triggers](https://learn.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings?tabs=csharp) can also [use NServiceBus to send messages to Azure Service Bus](/nservicebus/hosting/azure-functions-service-bus/#basic-usage-dispatching-outside-a-message-handler.md).
19+
20+
![](azure-functions-host.png)
21+
22+
[**Host NServiceBus applications on Azure Functions →**](/nservicebus/hosting/azure-functions-service-bus/)
23+
24+
## Platform as a Service
25+
26+
[Platform as a Service (PaaS)](https://en.wikipedia.org/wiki/Platform_as_a_service) models provide managed hosting environments where applications can be deployed without having to manage the underlying infrastructure, operating system, or runtime environments.
27+
28+
### Azure App Services
29+
30+
[Azure App Services](https://azure.microsoft.com/en-us/products/app-service/) has native support for deployment of .NET applications. NServiceBus endpoints can be integrated into [ASP.NET Core web applications](/nservicebus/hosting/asp-net.md) or run as background tasks using [WebJobs](https://learn.microsoft.com/en-us/azure/app-service/webjobs-create).
31+
32+
### Containers
33+
34+
[Containers](https://en.wikipedia.org/wiki/Containerization_(computing)) are a popular mechanism to deploy and host applications in PaaS services. NServiceBus can be used by containerized applications and deployed to services like:
35+
36+
* [Azure App Services](https://azure.microsoft.com/en-us/products/app-service/) (using containers)
37+
* [Azure Container Instances](https://azure.microsoft.com/en-us/products/container-instances/)
38+
* [Azure Container Apps](https://azure.microsoft.com/en-us/products/container-apps/)
39+
* [Azure Kubernetes Services](https://azure.microsoft.com/en-us/products/kubernetes-service/)
40+
41+
![](azure-container-host.png)
42+
43+
[**Host NServiceBus applications in Docker containers →**](/nservicebus/hosting/docker-host/)
44+
45+
## Infrastructure as a Service
46+
47+
Infrastructure as a Service (IaaS) provides virtualized computing resources like virtual machines, storage, and networking that can be used to build and manage the required infrastructure.
48+
49+
NServiceBus applications can easily be hosted on virtual machines. Popular techniques include:
50+
51+
* [Integrating NServiceBus with the Microsoft Generic Host](/nservicebus/hosting/extensions-hosting.md)
52+
* [Custom hosted web applications](/nservicebus/hosting/web-application.md)
53+
* [Installing NServiceBus endpoints as Windows Services](/nservicebus/hosting/windows-service.md)
54+
* [Manually controlling NServiceBus lifecycle in an executable (e.g. Console or GUI applications)](/nservicebus/hosting/#self-hosting)
55+
* [Custom-managed Kubernetes clusters hosting container applications](/nservicebus/hosting/docker-host)
56+
57+
## Choosing a hosting model
58+
59+
The best choice of hosting model depends on the desired characteristics, such as:
60+
61+
* **Scalability**: Different hosting options offer different approaches to scaling. Managed solutions are typically easier to scale on demand and can scale on more granular levels. In addition to the scalability, elasticity (the time required to scale up or down) may also factor into the choice. Azure documentation provides more information about [subscription and service limits](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits).
62+
* **Pricing:** Managed services typically offer more dynamic pricing models that adjust with the demands of an application, in comparison with more rigid pricing models for infrastructure services. However, managed services typically charge more for their pricing units, so infrastructure services may be more economical for consistent demand. Azure offers a [pricing calculator](https://azure.microsoft.com/en-us/pricing/calculator/) to help understand a given service's pricing model.
63+
* **Portability:** Serverless models are primarily built on proprietary programming models, heavily tied to the cloud service vendor. Hosting models built on open standards make it easier to run components in other hosting environments. Additionally, it may also be desirable to run components using on-premises servers or workstations.
64+
* **Flexibility:** Lower-level infrastructure provides more control over the configuration and management of applications. Serverless offerings offer less flexibility due to the higher level of abstractions exposed to the code.
65+
* **Manageability:** Serverless and PaaS models remove the concerns about the underlying infrastructure challenges (e.g. automatic scaling, OS updates, load balancing, etc.), typically at the cost of flexibility. Managing and maintaining infrastructure using other models may require significant resources and knowledge.
66+
67+
## Additional resources
68+
69+
* [Microsoft compute service overview](https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/compute-decision-tree)
70+
* [Selecting a host for NServiceBus endpoints](/nservicebus/hosting/selecting.md)
71+
* [Azure compute options for microservices](https://learn.microsoft.com/en-us/azure/architecture/microservices/design/compute-options)
72+
* [Azure pricing](https://azure.microsoft.com/en-us/pricing/)

architecture/azure/data-stores.md

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: Azure data stores
3+
summary:
4+
reviewed: 2023-07-18
5+
callsToAction: ['solution-architect', 'poc-help']
6+
---
7+
8+
Azure offers [several data stores](https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/data-store-decision-tree) which can be used with the Particular Service Platform.
9+
10+
## Azure Cosmos DB
11+
12+
[Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/introduction) is a globally distributed, multi-model, managed database service. It offers high availability, low latency, and automatic scaling to handle massive workloads across various data models, including document, key-value, graph, and column-family. Cosmos DB relies on partitioning to achieve high performance and scalability. When working with Cosmos DB, it is important to be familiar with the [partitioning model](https://learn.microsoft.com/en-us/azure/cosmos-db/partitioning-overview).
13+
14+
:heavy_plus_sign: Pros:
15+
16+
- Built and optimized for scalability
17+
- Multi-region support for high availability deployment
18+
- Supports multiple [data models](https://learn.microsoft.com/en-us/azure/cosmos-db/choose-api)
19+
- Fully managed
20+
- [Cosmos DB Emulator](https://learn.microsoft.com/en-us/azure/cosmos-db/local-emulator) can be used for local development and testing
21+
22+
:heavy_minus_sign: Cons:
23+
24+
- Atomic transactions only within the same partition
25+
- Careful partition planning is required
26+
- Fairly expensive
27+
28+
[**Try the NServiceBus Cosmos DB sample →**](/samples/cosmosdb/simple/)
29+
30+
Note: Cosmos DB offers _serverless_ and _provisioned throughput_ pricing models. When using _provisioned throughput_, Cosmos DB rejects further requests after the reserved Request Units are used. The [Cosmos DB pricing model documentation](https://learn.microsoft.com/en-us/azure/cosmos-db/how-pricing-works) has further information.
31+
32+
## Azure Table Storage
33+
34+
[Azure Table Storage](https://learn.microsoft.com/en-us/azure/storage/tables/table-storage-overview) is a NoSQL managed database service. It is a cost-effective and scalable solution for storing semi-structured and structured data, using a key-value pair schema. Designed for fast and efficient data retrieval, it is suitable for applications that require high-performance read and write operations, especially for large-scale, low-latency data storage and retrieval needs.
35+
36+
:heavy_plus_sign: Pros:
37+
38+
- Cost-effective
39+
- Partitioning is managed by the service
40+
- [Azurite emulator](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite) can be used for local development and testing
41+
42+
:heavy_minus_sign: Cons:
43+
44+
- Limited number of columns and single entity (row) size
45+
- Limited query capabilities
46+
- Multi-document transactions are limited to the same partition
47+
- No built-in support for complicated relationships
48+
49+
[**Try the NServiceBus Azure Table Storage sample →**](/samples/azure/azure-table/simple/)
50+
51+
Note: Applications built for Table Storage are compatible with Cosmos DB. See [this table](https://learn.microsoft.com/en-us/azure/cosmos-db/table/support) for a more in-depth comparison.
52+
53+
## Azure SQL Database
54+
55+
[Azure SQL Database](https://azure.microsoft.com/en-us/products/azure-sql/database/) is a fully managed database service based on the [Microsoft SQL Server database engine](https://learn.microsoft.com/en-us/sql/sql-server/?view=sql-server-ver16).
56+
57+
:heavy_plus_sign: Pros:
58+
59+
- Fully managed
60+
- Rich built-in scaling options
61+
- Automatic backups and point-in-time restores
62+
- Active Geo-replication and zone-redundancy
63+
- Different pricing tiers for more cost control
64+
65+
:heavy_minus_sign: Cons:
66+
67+
- Migrating existing SQL server instances might be challenging
68+
69+
Azure SQL Database is supported via the [NServiceBus SQL persistence package](/persistence/sql/).
70+
71+
[**Try the NServiceBus SQL persistence sample →**](/samples/sql-persistence/simple/)
72+
73+
## Azure SQL Managed Instance
74+
75+
[Azure SQL Managed Instance](https://azure.microsoft.com/en-us/products/azure-sql/managed-instance) is a fully managed database service that provides a near-complete compatibility with the [Microsoft SQL Server database engine](https://learn.microsoft.com/en-us/sql/sql-server/?view=sql-server-ver16). It offers a managed solution for migrating and modernizing existing SQL Server applications with minimal code changes.
76+
77+
:heavy_plus_sign: Pros:
78+
79+
- High degree of compatibility with SQL Server
80+
- Supports cross-database queries
81+
- Predictable performance for large databases due to isolation
82+
- More database configuration options compared to Azure SQL Database
83+
84+
:heavy_minus_sign: Cons:
85+
86+
- Higher costs compared to manually managed database servers or Azure SQL Database
87+
88+
Azure SQL Managed Instances is supported via the [NServiceBus SQL persistence package](/persistence/sql/).
89+
90+
[**Try the NServiceBus SQL persistence sample →**](/samples/sql-persistence/simple/)
91+
92+
## Other data store options
93+
94+
Azure provides further relational database services compatible with NServiceBus, e.g. [Azure Database for MySQL](https://azure.microsoft.com/en-us/products/mysql) and [Azure Database for PostgreSQL](https://azure.microsoft.com/en-us/products/postgresql).
95+
96+
While the presented storage options provide the best experience and integration with Azure, other storage options are available and may be valid options depending on the specific requirements. [Explore all supported data stores](/persistence/#supported-persisters).
97+
98+
## Choosing a data store
99+
100+
The following factors should be considered when choosing a data store:
101+
102+
### Existing infrastructure
103+
104+
Using existing infrastructure and know-how can significantly speed up the development process and lower the risks associated with using unfamiliar data store technologies. Unless the existing infrastructure and technologies do not meet the architectural requirements, they are a good default choice.
105+
106+
### Compatibility
107+
108+
When migrating or modernizing existing applications, data stores that are compatible with currently used protocols and languages simplify the switch to cloud-based services significantly. For example, a data store may understand PostgreSQL, SQL Server, and MongoDB dialects which allow applications using any of these dialects to connect with minimal changes required.
109+
110+
### Transactions and consistency model
111+
112+
Transaction capabilities can vary considerably between different data stores. Some only provide transactional consistency within the same partition or have limited transaction isolation levels. It is important to consider whether [eventual consistency](https://en.wikipedia.org/wiki/Eventual_consistency) is acceptable or [ACID](https://en.wikipedia.org/wiki/ACID) guarantees are required.
113+
114+
### Storage model
115+
116+
Data stores may have [different storage models](https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/data-store-overview), optimized for different use cases. Data access patterns, the type of information to be stored, and relations between data should be considered when choosing the most appropriate storage model.
117+
118+
### Scalability
119+
120+
It may be important to consider how easily a data store's capacity and performance can be scaled up when required. Scaling requirements may also depend on the expected access patterns (e.g. the number of reads vs writes) or availability goals.
121+
122+
### Legal and compliance
123+
124+
Sometimes, data may be subject to legal requirements (e.g. data privacy) that require additional consideration of how a data store operates to ensure compliance. See the [Azure compliance offerings](https://learn.microsoft.com/en-us/compliance/regulatory/offering-home) for more detailed information on specific national, regional, and industry-specific regulations.
125+
126+
### Costs
127+
128+
Data stores can have significantly different pricing models. Charges may be based on a number of factors such as storage size, read/write operations, data transfer, or higher consistency guarantees. Some serverless pricing models may be optimized for when data is accessed infrequently or in bursts. The licensing model for a specific data store may also significantly impact the overall cost.
129+
130+
### Portability
131+
132+
Some data stores are only available in the cloud, with no on-premises equivalent. This may affect hosting, CI, testing and development. Some data stores support open standards or protocols which allows the use of on-premises or local data stores in those scenarios. For example, Cosmos DB supports PostgreSQL and MongoDB dialects.
133+
134+
### Security
135+
136+
Data stores offer various approaches to securing data using authentication and authorization. This may be provided by the data store itself or the data store may integrate with third party security services such as Azure IAM.
137+
138+
## Additional resources
139+
140+
- [Azure Architecture Center: Criteria for choosing a data store](https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/data-store-considerations)
141+
- [What is Azure SQL Database?](https://learn.microsoft.com/en-us/azure/azure-sql/database/sql-database-paas-overview?view=azuresql)
142+
- [What is Azure SQL Managed Instance?](https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/sql-managed-instance-paas-overview?view=azuresql)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Event-driven architecture style on Azure
3+
summary:
4+
reviewed: 2023-07-18
5+
callsToAction: ['solution-architect', 'ADSD']
6+
---
7+
8+
The Azure Architecture Center describes the [event-driven architecture style](https://learn.microsoft.com/en-us/azure/architecture/guide/architecture-styles/event-driven) as consisting of event producers and event consumers which can use the [publish/subscribe](https://learn.microsoft.com/en-us/azure/architecture/patterns/publisher-subscriber) (also called pub/sub) model.
9+
10+
The Particular Service Platform implements [pub/sub](/nservicebus/messaging/publish-subscribe/), with each [NServiceBus endpoint](/nservicebus/endpoints) acting as a publisher (event producer) and/or subscriber (endpoint consumer).
11+
12+
![](azure-event-driven-architecture.png)
13+
14+
### Components
15+
16+
* NServiceBus publisher (event producer): Publishes events with business meaning in a reliable fire-and-forget style and has no knowledge of subscribers (there may be none).
17+
* NServiceBus subscriber (event consumer): Subscribed to a specific event type and reacts to it. A subscriber may also be an event publisher, since processing an event may lead to publishing more events.
18+
* Azure Service Bus: The messaging service that brings together publisher and subscriber without explicitly referencing or depending on each other.
19+
20+
### Challenges
21+
22+
* Events order: Subscribers cannot rely on the order they receive published events, which may be affected by many factors such as concurrency, scaling, retries, partitioning, etc. Events and subscribers should be designed so that they [do not rely on strict ordering to execute business processes](https://particular.net/blog/you-dont-need-ordered-delivery).
23+
* Event data: Putting too much data on messages couples publishers and subscribers, defeating one of the main benefits of messaging in the first place. Bloated event contracts indicate sub-optimal service boundaries, perhaps drawn along technical constraints rather than business rules, or [data distribution](/nservicebus/concepts/data-distribution.md) over messaging. Well designed events are [lightweight contracts](https://particular.net/blog/putting-your-events-on-a-diet), focusing on sharing IDs rather than data.
24+
25+
### Technology choices
26+
27+
In event-driven architectures, components are decoupled, allowing choice of the most suitable [compute](compute.md) and [data store](data-stores.md) options for a specific component or set of components.
28+
29+
An event-driven approach requires support for the publish-subscribe model. NServiceBus supports the publish-subscribe model for [Azure Service Bus and Azure Storage Queues](messaging.md), independent of the underlying service capabilities.
30+
31+
## Additional resources
32+
33+
* [Azure Architecture Center—Event-driven architecture style](https://learn.microsoft.com/en-us/azure/architecture/guide/architecture-styles/event-driven)

0 commit comments

Comments
 (0)