4. Issues we contend with:
1. fault tolerance
2. performance
Geode WAN replication gives us both.
4
5. Fault Tolerance
Keeping a redundant cluster as a hot spare
dramatically reduces service interruptions.
To be effective, the hot spare should be
• physically removed from the original
• independent of the original
• immediately available when a failure
occurs
5
6. Performance
If data is generated in Chile, but
needs to be used by an
application in India, it takes a lot
of time for that data to travel
around the world.
6
7. Geode's WAN distribution feature
At the region level:
• sets up asynchronous communication between clusters (sites)
(synchronous updates would be amazingly slow)
• implements an eventual consistency model, facilitating
replication of region operations, such that distinct clusters can
host the same region
7
8. Event Queues make it work
Gateway Sender Queues propagate region write operations from one
cluster to another without impacting the performance of CRUD operations
within each site.
cluster
A
cluster
B
gateway sender gateway receiver
DSID=1 DSID=2
8
10. Configuration
Given that we know the assigned DSIDs, create:
• locators
• servers
• gateway receivers
• gateway senders
• regions
The Geode WAN example does all of this.
10
19. Active-Active
GatewayConflictResolver:
• A cache-level plugin
• Resolves changes with
other Distributed System
IDs
• Checks that sites will
receive updates in the
same way
• Can be overridden with
custom implementations
• Must be the same for all
distributed systems
A B
app 1 app 1 app 1 app 1
GatewayConf
lictResolver
GatewayConf
lictResolver
19
21. Active-Active - Real-world Example
app 1 app 1
NY
/products
app 1app 1
London
/products
put
Put a new
entry:
Id: 3
Name: Shirt
Price: $15
21
22. Active-Active - Real-world Example
app 1 app 1
NY
/products
app 1app 1
London
/products
Id: 3
Name: Shirt
Price: $15
22
23. Active-Active - Real-world Example
app 1app 1
London
/products
app 1 app 1
NY
/products
Id: 3
Name: Shirt
Price: $15
23
24. Active-Active - Real-world Example
app 1 app 1
NY
/products
app 1app 1
London
/products
Id: 3
Name: Shirt
Price: $15
Id: 3
Name: Shirt
Price: $15
24
25. Active-Active - Real-world Example
app 1 app 1
NY
/products
app 1app 1
London
/products
put
Id: 3
Name: Shirt
Price: $15
Id: 3
Name: Shirt
Price: $15
Put to update
an entry:
Id: 3
Name: Shirt
Price: $15 $10.50
25
26. Active-Active - Real-world Example
app 1 app 1
NY
/products
Id: 3
Name: Shirt
Price: $15
app 1app 1
London
/products
Id: 3
Name: Shirt
Price: $10.50
26
27. Active-Active - Real-world Example
app 1 app 1
NY
/products
Id: 3
Name: Shirt
Price: $15
app 1app 1
London
/products
Id: 3
Name: Shirt
Price: $10.50
27
28. Active-Active - Real-world Example
app 1 app 1
NY
/products
Id: 3
Name: Shirt
Price: $10.50
app 1app 1
London
/products
Id: 3
Name: Shirt
Price: $10.50
28
29. Active-Active - Example with multiple regions
app 1app 1
London
/products
/
customers
app 1 app 1
NY
/products
/
customers
29
30. Active-Active - Redundancy with multiple regions
app 1app 1
London
/NewYork
Products
/London
Products
app 1 app 1
NY
/NewYork
Products
/London
Products
30
31. • Multiple sites have and use copies of the same data
• Eventual consistency between sites
• Conflicting changes are resolved
• Reads are faster than writes
• Can be used with multiple regions
• Reduces risk of data loss due to redundancy at the site level
Active-Active: Summary
31
32. CQRS
• Command Query Responsibility Segregation
• Separates the responsibilities of Querying from Commands
• Queries cannot have side effects
• Commands may not return data
• Can make it easier to reason about the state of the system
32
34. CQRS - Real world Example
A B
Temp.
Sensor
Fill
Sensor
querying
app
querying
app
Factory site Analytics site
/coffee/coffee
34
35. CQRS - Example with two Regions
A B
Temp.
Sensor
Fill
Sensor
querying
app
querying
app
Factory site Analytics site
/coffee /coffee
/cafeAuLait /cafeAuLait
35
36. Hub and Spoke (or Star) Topology
Design patterns are
location-aware.
36
38. Adelaide
Only the Adelaide cluster writes to Australia-based region entries.
/Companies region:
("Acme", "10 Main St., Sydney, NSW, Australia")
("Best", "12 Oak, Portland, OR, USA")
("Cabet", "4 Rue Blanc, Paris, France")
("Daks", "7 Magpie, Adelaide, Adelaide, Australia")
38
39. Adelaide
Forward all operation requests for
Australia-based region entries to the
hub and then to the Adelaide cluster
for processing.
39
GatewayEventFilter
40. Follow the Sun Pattern (Global Book pattern)
NY London
Tokyo
Transactions occur in the active
timezone.
40
41. Follow the Sun Pattern (Global Book pattern)
NY London
Tokyo
41
47. unidirectional configuration
1. Plan the cluster sites. Assign a unique distributed system ID (DSID) to
each site, and let the sites know all the DSIDs of sites they will
communicate with.
2. create locators(in each cluster), specifying the DSID and the locators in
the remote cluster
3. create servers (in each cluster), specifying the DSID
4. create the gateway receiver on the receiving side
5. create gateway sender(s) on the sending side
6. create regions, specifying which gateway senders through which to
propagate data
47
48. adding SSL/TLS to the configuration
• specify
ssl-enabled-components=all
in the gemfire.properties file
• specify keystore, truststore, and username/password in the
gfsecurity.properties file
• specify both properties files on locator/server start up
See SSL Sample Implementation in the Geode manual for details.
48