From e034469ad72b6fb4f1500bc47589db5d831ce5ea Mon Sep 17 00:00:00 2001 From: John Blum Date: Thu, 3 Sep 2020 16:41:28 -0700 Subject: [PATCH] Add brief section on Multi-Site Caching referring to the Sample Guide and Code. --- .../src/docs/asciidoc/_includes/caching.adoc | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/spring-geode-docs/src/docs/asciidoc/_includes/caching.adoc b/spring-geode-docs/src/docs/asciidoc/_includes/caching.adoc index f17d3f5c..da47a198 100644 --- a/spring-geode-docs/src/docs/asciidoc/_includes/caching.adoc +++ b/spring-geode-docs/src/docs/asciidoc/_includes/caching.adoc @@ -53,9 +53,9 @@ Our application might consist of a financial loan service to process a person's @Service class FinancialLoanApplicationService { - @Cacheable("EligibilityDecisions", ...) + @Cacheable("EligibilityDecisions") EligibilityDecision processEligility(Person person, Timespan timespan) { - ... + // ... } } ---- @@ -92,8 +92,6 @@ The complete Spring Boot application looks like this: ---- package example.app; -import ...; - @SpringBootApplication @EnableCachingDefinedRegions class FinancialLoanApplication { @@ -131,10 +129,13 @@ Typically, when most users think of caching, they are thinking of _Look-Aside Ca pattern applied by _Spring's Cache Abstraction_. In a nutshell, _Near Caching_ keeps the data closer to where the data is used thereby improving on performance -due to lower latencies when data is needed (i.e. no network hops). +due to lower latencies when data is needed (i.e. no network hops). This also improves application throughput, +i.e. the amount of work completed in a given time frame. Within _Inline Caching_, developers have a choice between synchronous (_Read/Write-Through_) and asynchronous -(_Write-Behind_) configurations depending on the application use case and requirements. +(_Write-Behind_) configurations depending on the application use case and requirements. Synchronous, Read/Write-Through +_Inline Caching_ is necessary if consistency is a concern. Asynchronous, Write-Behind _Inline Caching_ is applicable +if throughput and low-latency are a priority. Within _Multi-Site Caching_, there are _Active-Passive_ and _Active-Active_ arrangements. More details on _Multi-Site Caching_ will be presented in a later release. @@ -231,7 +232,7 @@ in the Region that might have been changed by other clients accessing the same d [[geode-caching-provider-inline-caching]] ==== Inline Caching -The final pattern of caching we will discuss in this chapter is _Inline Caching_. +The next pattern of caching we will discuss in this chapter is _Inline Caching_. There are two different configurations of _Inline Caching_ that developers can apply to their Spring Boot applications when using this pattern of caching: Synchronous (_Read/Write-Through_) and Asynchronous (_Write-Behind_). @@ -346,8 +347,8 @@ class FinancialLoanApplicationServer { } @Bean - DataSource dataSource(..) { - ... + DataSource dataSource() { + // ... } } ---- @@ -370,9 +371,8 @@ class DecisionManagementSystemLoader implements CacheLoader entryEvent) { // Use the configured DataSource to delete (i.e. DELETE) the entry value from the backend data store } - - ... } ---- @@ -493,6 +491,18 @@ TIP: To see a similar implementation of _Inline Caching_ using a Database (In-Me look at this https://github.com/spring-projects/spring-boot-data-geode/blob/master/spring-geode/src/test/java/org/springframework/geode/cache/inline/database/InlineCachingWithDatabaseIntegrationTests.java[test class] from the SBDG test suite. A dedicated sample will be provided in a future release. +[[geode-caching-provider-multi-site-caching]] +==== Multi-Site Caching + +The final pattern of caching presented in this chapter is _Multi-Site Caching_. + +As described above, there are 2 configuration arrangements depending on your application usage patterns, requirements +and user demographic: _Active-Active_ & _Active-Passive_. + +_Multi-Site Caching_ along with _Active-Active_ and _Active-Passive_ configuration arrangements will be described +in more detail in the Sample link:guides/caching-multi-site.html[Guide]. Also, be sure to review the Sample +{github-samples-url}/caching/multi-site[Code]. + [[geode-caching-provider-advanced-configuration]] === Advanced Caching Configuration