Skip to content

Commit 8682111

Browse files
authored
Serverless ebook (#6260)
* Adding eBook to refactored docs * Update to master TOC * Fix links, begin app insights * Write app insights, logic apps articles * Event Grid article * durable functions articles * Start business cases chapter * Finish business scenarios chapter * Addressing @BillWagner review. * Updates per @mairaw feedback * Formatting updates * update toc * addressing review feedback * Key takeaways. * Refactor for SEO, run Gauntlet verification, run and respond to Acrolinx * Fixes based on publishing build * Review complete with small revisions. (#6044) * Updates from requests in pull request 6044 (#6127) * Update dates, links, and cover (#6194) * last edit pass * typo Per offline convo with @JeremyLikness
1 parent fcb96dd commit 8682111

File tree

61 files changed

+1463
-2
lines changed

Some content is hidden

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

61 files changed

+1463
-2
lines changed

docfx.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@
186186
"docs/standard/microservices-architecture/**/**.md": "dotnet-ebooks",
187187
"docs/standard/modern-web-apps-azure-architecture/**/**.md": "dotnet-ebooks",
188188
"docs/standard/modernize-with-azure-and-containers/**/**.md": "dotnet-ebooks",
189+
"docs/standard/serverless-architecture/**/**.md": "dotnet-ebooks",
189190
"docs/standard/security/**/**.md": "dotnet-security",
190191
"docs/visual-basic/language-reference/error-messages/**/**.md": "vb-diagnostics"
191192
}

docs/standard/guidance-architecture.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ This guide is an introduction to the recommended architecture, design, and deplo
2222

2323
## [Architecting Container and Microservice Based Applications](microservices-architecture/index.md)
2424

25-
This guide is an introduction to developing microservices-based applications and managing them using containers. It discusses architectural design and implementation approaches using .NET Core and Docker containers.
25+
This guide is an introduction to developing microservices-based applications and managing them using containers. It discusses architectural design and implementation approaches using .NET Core and Docker containers.
26+
27+
## [Serverless apps: Architecture, patterns, and Azure implementation](serverless-architecture/index.md)
28+
29+
This is a guide for building serverless applications with examples using Azure. It discusses various architecture and design approaches, the benefits and challenges that come with serverless, and provides scenarios and use cases for serverless apps.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Application Insights - Serverless apps
3+
description: Application Insights is a serverless diagnostics platform that enables developers to detect, triage, and diagnose issues in web apps, mobile apps, desktop apps and microservices.
4+
author: JEREMYLIKNESS
5+
ms.author: jeliknes
6+
ms.date: 06/26/2018
7+
---
8+
# Telemetry with Application Insights
9+
10+
[Application Insights](https://docs.microsoft.com/azure/application-insights) is a serverless diagnostics platform that enables developers to detect, triage, and diagnose issues in web apps, mobile apps, desktop apps, and microservices. You can turn on Application Insights for function apps simply by flipping a switch in the portal. Application Insights provides all of these capabilities without you having to configure a server or set up your own database. All of Application Insights' capabilities are provided as a service that automatically integrates with your apps.
11+
12+
![Application Insights logo](./media/application-insights-logo.png)
13+
14+
Adding Application Insights to existing apps is as easy as adding an instrumentation key to your application's settings. With Application Insights you can:
15+
16+
* Create custom charts and alerts based on metrics such as number of function invocations, the time it takes to run a function, and exceptions
17+
* Analyze failures and server exceptions
18+
* Drill into performance by operation and measure the time it takes to call third-party dependencies
19+
* Monitor CPU usage, memory, and rates across all servers that host your function apps
20+
* View a live stream of metrics including request count and latency for your function apps
21+
* Use [Analytics](https://docs.microsoft.com/azure/application-insights/app-insights-analytics) to search, query, and create custom charts over your function data
22+
23+
![Metrics explorer](./media/metrics-explorer.png)
24+
25+
In addition to built-in telemetry, it's also possible to generate custom telemetry. The following code snippet creates a custom telemetry client using the instrumentation key set for the function app:
26+
27+
```csharp
28+
public static TelemetryClient telemetry = new TelemetryClient()
29+
{
30+
InstrumentationKey = Environment.GetEnvironmentVariable("APPINSIGHTS_INSTRUMENTATIONKEY")
31+
};
32+
```
33+
34+
The following code measures how long it takes to insert a new row into an [Azure Table Storage](https://docs.microsoft.com/azure/cosmos-db/table-storage-overview) instance:
35+
36+
```csharp
37+
var operation = TableOperation.Insert(entry);
38+
var startTime = DateTime.UtcNow;
39+
var timer = System.Diagnostics.Stopwatch.StartNew();
40+
await table.ExecuteAsync(operation);
41+
telemetry.TrackDependency("AzureTableStorageInsert", "Insert", startTime, timer.Elapsed, true);
42+
```
43+
44+
The resulting performance graph is shown:
45+
46+
![Custom telemetry](./media/custom-telemetry.png)
47+
48+
The custom telemetry reveals the average time to insert a new row is 32.6 milliseconds.
49+
50+
Application Insights provides a powerful, convenient way to log detailed telemetry about your serverless applications. You have full control over the level of tracing and logging that is provided. You can track custom statistics such as events, dependencies, and page view. Finally, the powerful analytics enable you to write queries that ask important questions and generate charts and advanced insights.
51+
52+
For more information, see [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring).
53+
54+
>[!div class="step-by-step"]
55+
[Previous](azure-functions.md)
56+
[Next](logic-apps.md)
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: Architecture approaches - Serverless apps
3+
description: An introduction to architecture approaches for building cloud-based enterprise applications, from N-tier architectures to serverless.
4+
author: JEREMYLIKNESS
5+
ms.author: jeliknes
6+
ms.date: 06/26/2018
7+
---
8+
# Architecture approaches
9+
10+
Understanding existing approaches to architecting enterprise apps helps clarify the role played by serverless. There are many approaches and patterns that evolved over decades of software development, and all have their own pros and cons. In many cases, the ultimate solution may not involve deciding on a single approach but may integrate several approaches. Migration scenarios often involve shifting from one architecture approach to another through a hybrid approach.
11+
12+
This chapter provides an overview of both logical and physical architecture patterns for enterprise applications.
13+
14+
## Architecture patterns
15+
16+
Modern business applications follow a variety of architecture patterns. This section represents a survey of common patterns. The patterns listed here aren't necessarily all best practices, but illustrate different approaches.
17+
18+
For more information, see [Azure application architecture guide](https://docs.microsoft.com/azure/architecture/guide/).
19+
20+
## Monoliths
21+
22+
Many business applications follow a monolith pattern. Legacy applications are often implemented as monoliths. In the monolith pattern, all application concerns are contained in a single deployment. Everything from user interface to database calls is included in the same codebase.
23+
24+
![Monolith architecture](./media/monolith-architecture.png)
25+
26+
There are several advantages to the monolith approach. It's often easy to pull down a single code base and start working. Ramp up time may be less, and creating test environments is as simple as providing a new copy. The monolith may be designed to include multiple components and applications.
27+
28+
Unfortunately, the monolith pattern tends to break down at scale. Major disadvantages of the monolith approach include:
29+
30+
* Difficult to work in parallel in the same code base.
31+
* Any change, no matter how trivial, requires deploying a new version of the entire application.
32+
* Refactoring potentially impacts the entire application.
33+
* Often the only solution to scale is to create multiple, resource-intensive copies of the monolith.
34+
* As systems expand or other systems are acquired, integration can be difficult.
35+
* It may be difficult to test due to the need to configure the entire monolith.
36+
* Code reuse is challenging and often other apps end up having their own copies of code.
37+
38+
Many businesses look to the cloud as an opportunity to migrate monolith applications and at the same time refactor them to more usable patterns. It's common to break out the individual applications and components to allow them to be maintained, deployed, and scaled separately.
39+
40+
## N-Layer applications
41+
42+
N-layer application partition application logic into specific layers. The most common layers include:
43+
44+
* User interface
45+
* Business logic
46+
* Data access
47+
48+
Other layers may include middleware, batch processing, and API. It's important to note the layers are logical. Although they're developed in isolation, they may all be deployed to the same target platform.
49+
50+
![N-Layer architecture](./media/n-layer-architecture.png)
51+
52+
There are several advantages to the N-Layer approach, including:
53+
54+
* Refactoring is isolated to a layer.
55+
* Teams can independently build, test, deploy, and maintain separate layers.
56+
* Layers can be swapped out, for example the data layer may access multiple databases without requiring changes to the UI layer.
57+
58+
Serverless may be used to implement one or more layers.
59+
60+
## Microservices
61+
62+
**[Microservices](https://docs.microsoft.com/azure/architecture/guide/architecture-styles/microservices)** architectures contain common characteristics that include:
63+
64+
* Applications are composed of several small services.
65+
* Each service runs in its own process.
66+
* Services are aligned around business domains.
67+
* Services communicate over lightweight APIs, typically using HTTP as the transport.
68+
* Services can be deployed and upgraded independently.
69+
* Services aren't dependent on a single data store.
70+
* The system is designed with failure in mind, and the app may still run even when certain services fail.
71+
72+
Microservices don't have to be mutual to other architecture approaches. For example, an N-Tier architecture may use microservices for the middle tier. It's also possible to implement microservices in a variety of ways, from virtual directories on IIS hosts to containers. The characteristics of microservices make them especially ideal for serverless implementations.
73+
74+
![Microservices architecture](./media/microservices-architecture.png)
75+
76+
The pros of microservices architectures include:
77+
78+
* Refactoring is often isolated to a single service.
79+
* Services can be upgraded independently of each other.
80+
* Resiliency and elasticity can be tuned to the demands of individual services.
81+
* Development can happen in parallel across disparate teams and platforms.
82+
* It's easier to write comprehensive tests for isolated services.
83+
84+
Microservices come with their own challenges, including:
85+
86+
* Determining what services are available and how to call them.
87+
* Managing the lifecycle of services.
88+
* Understanding how services fit together in the overall application.
89+
* Full system testing of calls made across disparate services.
90+
91+
Ultimately there are solutions to address all of these challenges, including tapping into the benefits of serverless that are discussed later.
92+
93+
>[!div class="step-by-step"]
94+
[Previous](index.md)
95+
[Next](architecture-deployment-approaches.md)

0 commit comments

Comments
 (0)