Skip to content

Commit 0fbacfe

Browse files
robvetmairawnishanil
committed
Chapter 5 octupdates (#15353)
* 10-22 Ch 5 PR * 10-22 Ch 5 PR - fix images * 10-22 Ch5 PR Update #1 * 10-23 Ch 5 fine-tuning verbage * Update docs/architecture/cloud-native/distributed-data.md Excellent. Thanks! Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * 10-27 Ch 5 Empty commit * 10-29 Ch 5 Updated intro * 11-01 Ch5 Cleansing Section 2 * 11-1 CH5 Updated Date * 11-02 Ch 5 Section 2 updates * 11-3 Ch 5 Section 2 fine tuning * 11-3 Ch 5 Section 2 more fine tuning * 11-3 ch 5 updates to section 3 * 11-4 Chatper 5 Section 3 * 11-06 Chapter 5 final update-pass 1 * 11-28 Ch 5 consolidated images in section 1 * 11-28 Ch 5 Updated Section 1 * 11-28 Ch 5 Updated Section 1 - fix md error * 11-28 Ch 5 Consolidating Section 1 and 2 * 11-29 Ch 5 setion 1 * 12/5 Ch 5 Section 1 * 12-6 Ch 5 Event sourcing * 12/8 ch 5 event sourcing * 12/8 Chapter 5 Event Sourcing Section 1 complete * 12/8 Ch 5 added caching and updated TOC * 12/8 Ch 5 fix md fomratting error * 12/8 Ch 5 fix 2nd md fomratting error * 12/8 Ch 5 fix 3rd md fomratting error * 12/18 Caching section complete * 12/18 Caching section complete 2 * 12/19 Ch 5 updates to sql vs nosql * 12/19 Ch 5 updates to sql vs nosql2 * 12/19 Ch 5 updates to sql vs nosql3 * 12/19 Ch 5 updates to sql vs nosql4 * 12/20 Ch 5 update to caching * 12/20 Ch 5 * 12/21 Ch 5 WIP NoSQL vs SQL * 12/21 Ch 5 WIP NoSQL vs SQL2 * 12/21 Ch 5 WIP SQL vs NoSQL * 12/22 Ch 5 * 12/23 Ch 5 All except customer stories and ElaticSearch * 12-24 Ch 5 Fine tuning to Sql vs NoSql * 12/24 chapter 5 fine tuning to sql vs nosql * 12/25 Ch 5 more fine tuning to sql vs nosql * 12/25 Updates to navigation * 12/25 Ch 5 added consistency graphic * 12/25 Ch 5 corrections * 12/27 Enhancing CosmosDB and NewSQL sections * 12/27 Enhancing CosmosDB and NewSQL sections * 12/29 Ch5 adding elasticsearch * 12/29 Ch 5 lowercasing file name for Database-per-microservice * 12/29 Ch 5 elastic complete first pass * 12/30 CH 5 updates to Cosmos Table API * 12/30 Ch 5 fine-tuning verbage * 12/31 Ch 5 final wrap#1 * 12/31 Ch 5 final wrap#1 - fix link * Update docs/architecture/cloud-native/Database-per-microservice.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/Database-per-microservice.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/Database-per-microservice.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/Database-per-microservice.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/azure-caching.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/azure-caching.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/Database-per-microservice.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/Database-per-microservice.md Co-Authored-By: Nish Anil <nish@microsoft.com> * Update docs/architecture/cloud-native/Database-per-microservice.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/azure-caching.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/azure-caching.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/elastic-search-in-azure.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/elastic-search-in-azure.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/Database-per-microservice.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Updates responding to PR comments from Nish and Maira * Ch5 Push with PR Corrections * Ch 5 fix warnings * Ch 5 fix more warnings * Ch 5 fix even more warnings * Apply suggestions from code review Commit updates Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> Co-Authored-By: Nish Anil <nish@microsoft.com> * rename * rename #2 * Apply suggestions from code review Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update to TOC * Apply suggestions from code review Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Update docs/architecture/cloud-native/relational-vs-nosql-data.md Co-Authored-By: Maira Wenzel <mairaw@microsoft.com> * Removed NewSQL Database image * set up redirects * fix redirect Co-authored-by: Maira Wenzel <mairaw@microsoft.com> Co-authored-by: Nish Anil <nish@microsoft.com>
1 parent 48ae62a commit 0fbacfe

35 files changed

+597
-414
lines changed

.openpublishing.redirection.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88
"source_path": "docs/about/products.md",
99
"redirect_url": "/dotnet/standard/components"
1010
},
11+
{
12+
"source_path": "docs/architecture/cloud-native/azure-data-storage.md",
13+
"redirect_url": "/dotnet/architecture/cloud-native/relational-vs-nosql-data"
14+
},
15+
{
16+
"source_path": "docs/architecture/cloud-native/data-patterns.md",
17+
"redirect_url": "/dotnet/architecture/cloud-native/database-per-microservice"
18+
},
19+
{
20+
"source_path": "docs/architecture/cloud-native/distributed-data.md",
21+
"redirect_url": "/dotnet/architecture/cloud-native/database-per-microservice"
22+
},
1123
{
1224
"source_path": "docs/architecture/microservices/architect-microservice-container-applications/communication-between-microservices.md",
1325
"redirect_url": "/dotnet/architecture/microservices/architect-microservice-container-applications/communication-in-microservice-architecture",
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: Caching in a cloud-native application
3+
description: Learn about caching strategies in a cloud-native application.
4+
author: robvet
5+
ms.date: 01/22/2020
6+
---
7+
# Caching in a cloud-native app
8+
9+
[!INCLUDE [book-preview](../../../includes/book-preview.md)]
10+
11+
The benefits of caching are well understood. The technique works by temporarily copying frequently accessed data from a backend data store to *fast storage* that's located closer to the application. Caching is often implemented where...
12+
13+
- Data remains relatively static.
14+
- Data access is slow, especially compared to the speed of the cache.
15+
- Data is subject to high levels of contention.
16+
17+
## Why?
18+
19+
As discussed in the [Microsoft caching guidance](https://docs.microsoft.com/azure/architecture/best-practices/caching), caching can increase performance, scalability, and availability for individual microservices and the system as a whole. It reduces the latency and contention of handling large volumes of concurrent requests to a data store. As data volume and the number of users increase, the greater the benefits of caching become.
20+
21+
Caching is most effective when a client repeatedly reads data that is immutable or that changes infrequently. Examples include reference information such as product and pricing information, or shared static resources that are costly to construct.
22+
23+
While microservices should be stateless, a distributed cache can support concurrent access to session state data when absolutely required.
24+
25+
Also consider caching to avoid repetitive computations. If an operation transforms data or performs a complicated calculation, cache the result for subsequent requests.
26+
27+
## Caching architecture
28+
29+
Cloud native applications typically implement a distributed caching architecture. The cache is hosted as a cloud-based [backing service](./definition.md#backing-services), separate from the microservices. Figure 5-20 shows the architecture.
30+
31+
![Caching in a cloud native app](media/caching-in-a-cloud-native-app.png)
32+
33+
**Figure 5-19**: Caching in a cloud native app
34+
35+
In the previous figure, note how the cache is independent of and shared by the microservices. In this scenario, the cache is invoked by the [API Gateway](./front-end-communication.md). As discussed in chapter 4, the gateway serves as a front end for all incoming requests. The distributed cache increases system responsiveness by returning cached data whenever possible. Additionally, separating the cache from the services allows the cache to scale up or out independently to meet increased traffic demands.
36+
37+
The figure presents a common caching pattern known as the [cache-aside pattern](https://docs.microsoft.com/azure/architecture/patterns/cache-aside). For an incoming request, you first query the cache (step \#1) for a response. If found, the data is returned immediately. If the data doesn't exist in the cache (known as a [cache miss](https://www.techopedia.com/definition/6308/cache-miss)), it's retrieved from a local database in a downstream service (step \#2). It's then written to the cache for future requests (step \#3), and returned to the caller. Care must be taken to periodically evict cached data so that the system remains timely and consistent.
38+
39+
As a shared cache grows, it might prove beneficial to partition its data across multiple nodes. Doing so can help minimize contention and improve scalability. Many Caching services support the ability to dynamically add and remove nodes and rebalance data across partitions. This approach typically involves clustering. Clustering exposes a collection of federated nodes as a seamless, single cache. Internally, however, the data is dispersed across the nodes following a predefined distribution strategy that balances the load evenly.
40+
41+
## Azure Cache for Redis
42+
43+
[Azure Cache for Redis](https://azure.microsoft.com/services/cache/) is a secure data caching and messaging broker service, fully managed by Microsoft. Consumed as a Platform as a Service (PaaS) offering, it provides high throughput and low-latency access to data. The service is accessible to any application within or outside of Azure.
44+
45+
The Azure Cache for Redis service manages access to open-source Redis servers hosted across Azure data centers. The service acts as a facade providing management, access control, and security. The service natively supports a rich set of data structures, including strings, hashes, lists, and sets. If your application already uses Redis, it will work as-is with Azure Cache for Redis.
46+
47+
Azure Cache for Redis is more than a simple cache server. It can support a number of scenarios to enhance a microservices architecture:
48+
49+
- An in-memory data store
50+
- A distributed non-relational database
51+
- A message broker
52+
- A configuration or discovery server
53+
54+
For advanced scenarios, a copy of the cached data can be [persisted to disk](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-how-to-premium-persistence). If a catastrophic event disables both the primary and replica caches, the cache is reconstructed from the most recent snapshot.
55+
56+
Azure Redis Cache is available across a number of predefined configurations and pricing tiers. The [Premium tier](https://docs.microsoft.com/azure/azure-cache-for-redis/cache-premium-tier-intro) features many enterprise-level features such as clustering, data persistence, geo-replication, and virtual-network isolation.
57+
58+
>[!div class="step-by-step"]
59+
>[Previous](relational-vs-nosql-data.md)
60+
>[Next](elastic-search-in-azure.md)

0 commit comments

Comments
 (0)