Replace all references to Apache Geode and Pivotal GemFire with documentation variables.
Replace all references of Pivotal GemFire with VMware GemFire.
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
[[geode-caching-provider]]
|
||||
== Caching using Apache Geode or Pivotal GemFire
|
||||
== Caching using Apache Geode or VMware GemFire
|
||||
:gemfire-name: VMware GemFire
|
||||
:geode-name: Apache Geode
|
||||
|
||||
One of the quickest, easiest and least invasive ways to get started using Apache Geode or Pivotal GemFire in your
|
||||
Spring Boot applications is to use either Apache Geode or Pivotal GemFire as a
|
||||
One of the quickest, easiest and least invasive ways to get started using {geode-name} or {gemfire-name} in your
|
||||
Spring Boot applications is to use either {geode-name} or {gemfire-name} as a
|
||||
{spring-framework-docs}/integration.html#cache-store-configuration[_caching provider_]
|
||||
in {spring-framework-docs}/integration.html#cache[Spring's Cache Abstraction]. SDG
|
||||
{spring-framework-docs}/integration.html#cache-store-configuration-gemfire[enables]
|
||||
Apache Geode or Pivotal GemFire to function as a _caching provider_ in Spring's Cache Abstraction.
|
||||
{geode-name} or {gemfire-name} to function as a _caching provider_ in Spring's Cache Abstraction.
|
||||
|
||||
TIP: See the _Spring Data for Apache Geode Reference Guide_ for more details on the
|
||||
TIP: See the _Spring Data for {geode-name} Reference Guide_ for more details on the
|
||||
{spring-data-geode-docs-html}/#apis:spring-cache-abstraction[support] and {spring-data-geode-docs-html}/#bootstrap-annotation-config-caching[configuration]
|
||||
of Apache Geode or Pivotal GemFire as a _caching provider_ in Spring's Cache Abstraction.
|
||||
of {geode-name} or {gemfire-name} as a _caching provider_ in Spring's Cache Abstraction.
|
||||
|
||||
TIP: Make sure you thoroughly understand the {spring-framework-docs}/integration.html#cache-strategies[concepts]
|
||||
behind Spring's Cache Abstraction before you continue.
|
||||
@@ -27,9 +29,9 @@ looking up a book by ISBN, geocoding a physical address, caching the calculation
|
||||
when the person applies for a financial loan.
|
||||
|
||||
If you need the proven power of an enterprise-class caching solution, with strong consistency, high availability
|
||||
and multi-site (WAN) capabilities, then you should consider https://geode.apache.org/[Apache Geode], or alternatively
|
||||
https://pivotal.io/pivotal-gemfire[Pivotal GemFire]. Additionally, https://pivotal.io/[Pivotal Software, Inc.]
|
||||
offers Pivotal GemFire as a service, known as https://pivotal.io/platform/services-marketplace/data-management/pivotal-cloud-cache[Pivotal Cloud Cache (PCC)],
|
||||
and multi-site (WAN) capabilities, then you should consider https://geode.apache.org/[{geode-name}], or alternatively
|
||||
https://pivotal.io/pivotal-gemfire[{gemfire-name}]. Additionally, https://pivotal.io/[Pivotal Software, Inc.]
|
||||
offers {gemfire-name} as a service, known as https://pivotal.io/platform/services-marketplace/data-management/pivotal-cloud-cache[Pivotal Cloud Cache (PCC)],
|
||||
when deploying and running your Spring Boot applications in https://pivotal.io/platform[Pivotal Cloud Foundry (PCF)].
|
||||
|
||||
Spring's {spring-framework-docs}/integration.html#cache-annotations[declarative, annotation-based caching] makes it
|
||||
@@ -66,22 +68,22 @@ person within the given span of time. If the person's eligibility in the given
|
||||
then the existing decision is returned from the cache. Otherwise, the `processEligibility(..)` method will be invoked
|
||||
and the result of the method will be cached when the method returns, before returning the value to the caller.
|
||||
|
||||
Spring Boot for Apache Geode/Pivotal GemFire _auto-configures_ Apache Geode or Pivotal GemFire as the _caching provider_
|
||||
Spring Boot for {geode-name}/{gemfire-name} _auto-configures_ {geode-name} or {gemfire-name} as the _caching provider_
|
||||
when either one is declared on the application classpath, and when no other _caching provider_ (e.g. Redis)
|
||||
has been configured.
|
||||
|
||||
If Spring Boot for Apache Geode/Pivotal GemFire detects that another _cache provider_ has already been configured,
|
||||
then neither Apache Geode nor Pivotal GemFire will function as the _caching provider_. This allows users to configure,
|
||||
another store, e.g. Redis, as the _caching provider_ and use Apache Geode or Pivotal GemFire as your application's
|
||||
If Spring Boot for {geode-name}/{gemfire-name} detects that another _cache provider_ has already been configured,
|
||||
then neither {geode-name} nor {gemfire-name} will function as the _caching provider_. This allows users to configure,
|
||||
another store, e.g. Redis, as the _caching provider_ and use {geode-name} or {gemfire-name} as your application's
|
||||
persistent store, perhaps.
|
||||
|
||||
The only other requirement to enable caching in a Spring Boot application is for the declared caches (as specified
|
||||
in Spring's or JSR-107's caching annotations) to have been created and already exist, especially before the operation,
|
||||
on which caching has been applied, is invoked. This means the backend data store must provide the data structure
|
||||
serving as the "_cache_". For Apache Geode or Pivotal GemFire, this means a `Region`.
|
||||
serving as the "_cache_". For {geode-name} or {gemfire-name}, this means a `Region`.
|
||||
|
||||
To configure the necessary Regions backing the caches declared in Spring's cache annotations, this is as simple as
|
||||
using Spring Data for Apache Geode or Pivotal GemFire's
|
||||
using Spring Data for {geode-name} or {gemfire-name}'s
|
||||
{spring-data-geode-javadoc}/org/springframework/data/gemfire/config/annotation/EnableCachingDefinedRegions.html[`@EnableCachingDefinedRegions`] annotation.
|
||||
|
||||
The complete Spring Boot application looks like this:
|
||||
@@ -108,14 +110,14 @@ is annotated with Spring's `@Service` stereotype annotation.
|
||||
TIP: You can set the `DataPolicy` of the Region created through the `@EnableCachingDefinedRegions` annotation by
|
||||
setting the `clientRegionShortcut` to a valid enumerated value.
|
||||
|
||||
NOTE: Spring Boot for Apache Geode/Pivotal GemFire does not recognize nor apply the `spring.cache.cache-names` property.
|
||||
NOTE: Spring Boot for {geode-name}/{gemfire-name} does not recognize nor apply the `spring.cache.cache-names` property.
|
||||
Instead, you should use SDG's `@EnableCachingDefinedRegions` on an appropriate Spring Boot application
|
||||
`@Configuration` class.
|
||||
|
||||
[[geode-caching-provider-look-aside-near-inline]]
|
||||
=== Look-Aside Caching, Near Caching and Inline Caching
|
||||
|
||||
Three different types of caching patterns can be applied with Spring when using Apace Geode or Pivotal GemFire
|
||||
Three different types of caching patterns can be applied with Spring when using Apace Geode or {gemfire-name}
|
||||
for your application caching needs.
|
||||
|
||||
The 3 primary caching patterns include:
|
||||
@@ -176,7 +178,7 @@ pull multiple bits of information to retrieve the Customer record, and so on, he
|
||||
_Near Caching_ is another pattern of caching where the cache is collocated with the application. This is useful when
|
||||
the caching technology is configured using a client/server arrangement.
|
||||
|
||||
We already mentioned that Spring Boot for Apache Geode & Pivotal GemFire <<clientcache-applications.adoc#geode-clientcache-applications, provides>>
|
||||
We already mentioned that Spring Boot for {geode-name} & {gemfire-name} <<clientcache-applications.adoc#geode-clientcache-applications, provides>>
|
||||
an _auto-configured_, `ClientCache` instance, out-of-the-box, by default. The `ClientCache` instance is most effective
|
||||
when the data access operations, including cache access, is distributed to the servers in a cluster accessible by
|
||||
the client, and in most cases, multiple clients. This allows other cache client applications to access the same data.
|
||||
@@ -188,7 +190,7 @@ maintains a subset of the data in the corresponding server-side cache (i.e. Regi
|
||||
only contains the data of interests to the application. This "local" cache (i.e. client-side Region) is consulted
|
||||
before forwarding the lookup request to the server.
|
||||
|
||||
To enable _Near Caching_ when using either Apache Geode or Pivotal GemFire, simply change the Region's (i.e. the `Cache`
|
||||
To enable _Near Caching_ when using either {geode-name} or {gemfire-name}, simply change the Region's (i.e. the `Cache`
|
||||
in Spring's Cache Abstraction) data management policy from `PROXY` (the default) to `CACHING_PROXY`, like so:
|
||||
|
||||
[source,java]
|
||||
@@ -207,7 +209,7 @@ TIP: The default, client Region data management policy is
|
||||
{apache-geode-javadoc}/org/apache/geode/cache/client/ClientRegionShortcut.html#PROXY[`ClientRegionShortcut.PROXY`].
|
||||
As such, all data access operations are immediately forwarded to the server.
|
||||
|
||||
TIP: Also see the Apache Geode documentation concerning
|
||||
TIP: Also see the {geode-name} documentation concerning
|
||||
{apache-geode-docs}/developing/events/how_client_server_distribution_works.html[Client/Server Event Distribution]
|
||||
and specifically, "_Client Interest Registration on the Server_" when using local, client CACHING_PROXY Regions
|
||||
to manage state in addition to the corresponding server-side Region. This is necessary to receive updates on entries
|
||||
@@ -221,25 +223,25 @@ The final pattern of caching we'll discuss is _Inline Caching_.
|
||||
When employing _Inline Caching_ and a cache miss occurs, the application service method may still not be invoked
|
||||
since the a Region can be configured to invoke a loader to load the missing entry from an external data source.
|
||||
|
||||
With Apache Geode and Pivotal GemFire, the cache, or using Apache Geode/Pivotal GemFire terminology, the Region, can be
|
||||
With {geode-name} and {gemfire-name}, the cache, or using {geode-name}/{gemfire-name} terminology, the Region, can be
|
||||
configured with a {apache-geode-javadoc}/org/apache/geode/cache/CacheLoader.html[CacheLoader]. This `CacheLoader` is
|
||||
implemented to retrieve missing values from some external data source, which could be an RDBMS or any other type of
|
||||
data store (e.g. another NoSQL store like Apache Cassandra, MongoDB or Neo4j).
|
||||
|
||||
TIP: See the Apache Geode User Guide on {apache-geode-docs}/developing/outside_data_sources/how_data_loaders_work.html[Data Loaders]
|
||||
TIP: See the {geode-name} User Guide on {apache-geode-docs}/developing/outside_data_sources/how_data_loaders_work.html[Data Loaders]
|
||||
for more details.
|
||||
|
||||
Likewise, an Apache Geode or Pivotal Gemfire Region can be configured with a
|
||||
Likewise, an {geode-name} or {gemfire-name} Region can be configured with a
|
||||
{apache-geode-javadoc}/org/apache/geode/cache/CacheWriter.html[CacheWriter]. A `CacheWriter` is responsible for
|
||||
writing any entry put into the Region to the backend data store, such as an RDBMS. This is referred to as a
|
||||
"_write-through_" operations because it is synchronous. If the backend data store fails to be written to then the entry
|
||||
will not be stored in the Region. This helps to ensure some level of consistency between the backing data store
|
||||
and the Apache Geode or Pivotal GemFire Region.
|
||||
and the {geode-name} or {gemfire-name} Region.
|
||||
|
||||
TIP: It is also possible to implement Inline-Caching using an _asynchronous_, _write-behind_ operation by registering
|
||||
an {apache-geode-javadoc}/org/apache/geode/cache/asyncqueue/AsyncEventListener.html[AsyncEventListener]
|
||||
on an {apache-geode-javadoc}/org/apache/geode/cache/asyncqueue/AsyncEventQueue.html[AEQ] tied to a server-side Region.
|
||||
You should consult the Apache Geode User Guide for more
|
||||
You should consult the {geode-name} User Guide for more
|
||||
{apache-geode-docs}/developing/events/implementing_write_behind_event_handler.html[details].
|
||||
|
||||
NOTE: Since SBDG is currently focused on the client-side, _async_, _write-behind_ behavior is not currently covered with
|
||||
@@ -269,7 +271,7 @@ class CustomerService {
|
||||
----
|
||||
|
||||
The main difference is, there are no Spring or JSR-107 caching annotations applied to the service methods
|
||||
and the `CustomerRepository` is accessing Apache Geode or Pivotal GemFire directly and NOT the RDBMS.
|
||||
and the `CustomerRepository` is accessing {geode-name} or {gemfire-name} directly and NOT the RDBMS.
|
||||
|
||||
[[geode-caching-provider-inline-caching-cacheloader-cachewriter]]
|
||||
===== Implementing CacheLoaders, CacheWriters for Inline Caching
|
||||
@@ -399,7 +401,7 @@ _Inline Caching_ in the next section.
|
||||
[[geode-caching-provider-inline-caching-using-spring-data-repositories]]
|
||||
===== Inline Caching using Spring Data Repositories.
|
||||
|
||||
Spring Boot for Apache Geode & Pivotal GemFire (SBDG) now offers dedicated support and configuration of _Inline Caching_
|
||||
Spring Boot for {geode-name} & {gemfire-name} (SBDG) now offers dedicated support and configuration of _Inline Caching_
|
||||
using Spring Data Repositories.
|
||||
|
||||
This is very powerful because it allows you to:
|
||||
@@ -413,12 +415,12 @@ It is our belief that users should be putting data where it is most easily acces
|
||||
and processing Documents, then most likely MongoDB (or Couchbase or another document store) might be
|
||||
the most logical choice to manage your application's Documents.
|
||||
|
||||
However, that does not mean you have to give up Apache Geode or Pivotal GemFire in your application/system architecture.
|
||||
You can leverage each data store for what it is good at. While MongoDB is good at Document handling, Apache Geode
|
||||
However, that does not mean you have to give up {geode-name} or {gemfire-name} in your application/system architecture.
|
||||
You can leverage each data store for what it is good at. While MongoDB is good at Document handling, {geode-name}
|
||||
is a highly valuable choice for consistency, high availability, multi-site, low-latency/high-throughput scale-out
|
||||
Use Cases.
|
||||
|
||||
As such, using Apache Geode and Pivotal GemFire's `CacheLoader/CacheWriter` mechanism provides a integration point
|
||||
As such, using {geode-name} and {gemfire-name}'s `CacheLoader/CacheWriter` mechanism provides a integration point
|
||||
between itself and other data stores to best serve your Use Case and application requirements/needs.
|
||||
|
||||
And now, SBDG just made this even easier.
|
||||
@@ -427,7 +429,7 @@ EXAMPLE
|
||||
|
||||
Let's say you are using JPA/Hibernate to access (store and retrieve) data in a Oracle Database.
|
||||
|
||||
Then, you can configure Apache Geode to read/write-through to the backend Oracle Database when performing cache (Region)
|
||||
Then, you can configure {geode-name} to read/write-through to the backend Oracle Database when performing cache (Region)
|
||||
operations by delegating to a Spring Data (JPA) Repository.
|
||||
|
||||
The configuration might look something like:
|
||||
@@ -474,10 +476,10 @@ from the SBDG test suite. A dedicated sample will be provided in a future releas
|
||||
[[geode-caching-provider-advanced-configuration]]
|
||||
=== Advanced Caching Configuration
|
||||
|
||||
Both Apache Geode and Pivotal GemFire support additional caching capabilities to manage the entries stored in the cache.
|
||||
Both {geode-name} and {gemfire-name} support additional caching capabilities to manage the entries stored in the cache.
|
||||
|
||||
As you can imagine, given the cache entries are stored in-memory, it becomes important to monitor and manage the
|
||||
available memory wisely. After all, by default, both Apache Geode and Pivotal GemFire store data in the JVM Heap.
|
||||
available memory wisely. After all, by default, both {geode-name} and {gemfire-name} store data in the JVM Heap.
|
||||
|
||||
Several techniques can be employed to more effectively manage memory, such as using
|
||||
{apache-geode-docs}/developing/eviction/chapter_overview.html[Eviction], possibly
|
||||
@@ -490,14 +492,14 @@ and using {apache-geode-docs}/managing/heap_use/off_heap_management.html[Off-Hea
|
||||
There are several other strategies that can be used as well, as described in
|
||||
{apache-geode-docs}/managing/heap_use/heap_management.html[Managing Heap and Off-heap Memory].
|
||||
|
||||
While this is well beyond the scope of this document, know that Spring Data for Apache Geode & Pivotal GemFire
|
||||
While this is well beyond the scope of this document, know that Spring Data for {geode-name} & {gemfire-name}
|
||||
make all of these {spring-data-geode-docs-html}/#bootstrap-annotation-config-regions[configuration options] simple.
|
||||
|
||||
[[geode-caching-provider-disable]]
|
||||
=== Disable Caching
|
||||
|
||||
There may be cases where you do not want your Spring Boot application to cache application state with
|
||||
{spring-framework-docs}/integration.html#cache[Spring's Cache Abstraction] using either Apache Geode or Pivotal GemFire.
|
||||
{spring-framework-docs}/integration.html#cache[Spring's Cache Abstraction] using either {geode-name} or {gemfire-name}.
|
||||
In certain cases, you may be using another Spring supported caching provider, such as Redis, to cache and manage
|
||||
your application state, while, even in other cases, you may not want to use Spring's Cache Abstraction at all.
|
||||
|
||||
@@ -529,9 +531,9 @@ See Spring Boot {spring-boot-docs-html}/boot-features-caching.html#boot-features
|
||||
for more details.
|
||||
|
||||
TIP: It is possible to include multiple providers on the classpath of your Spring Boot application. For instance,
|
||||
you might be using Redis to cache your application's state while using either Apache Geode or Pivotal GemFire
|
||||
you might be using Redis to cache your application's state while using either {geode-name} or {gemfire-name}
|
||||
as your application's persistent store (_System of Record_).
|
||||
|
||||
NOTE: Spring Boot does not properly recognize `spring.cache.type=[gemfire|geode]` even though
|
||||
Spring Boot for Apache Geode/Pivotal GemFire is setup to handle either of these property values
|
||||
Spring Boot for {geode-name}/{gemfire-name} is setup to handle either of these property values
|
||||
(i.e. either "`gemfire`" or "`geode`").
|
||||
|
||||
Reference in New Issue
Block a user