VMware Tanzu GemFire Architecture

Tanzu GemFire Basics

VMware Tanzu GemFire is the data store within VMware Tanzu GemFire for VMs. A Tanzu GemFire service instance requires a small amount of administrative VMware Tanzu GemFire setup, and any app will use a limited portion of the VMware Tanzu GemFire API.

The Tanzu GemFire architectural model is a client-server model. The clients are apps or microservices, and the servers are a set of VMware Tanzu GemFire servers maintained by a Tanzu GemFire service instance. The VMware Tanzu GemFire servers provide a low-latency, consistent, fault-tolerant data store within Tanzu GemFire.

Client Server Model

VMware Tanzu GemFire holds data in key/value pairs. Each pair is called an entry. Entries are logically grouped into sets called regions. A region is a map (or dictionary) data structure.

The app (client) uses Tanzu GemFire as a cache. A cache lookup (read) is a get operation on a VMware Tanzu GemFire region. The cache operation of a cache write is a put operation on a VMware Tanzu GemFire region. The VMware Tanzu GemFire command-line interface, called gfsh, facilitates region administration. Use gfsh to create and destroy regions within the Tanzu GemFire service instance.

The Tanzu GemFire Cluster

Tanzu GemFire deploys cache clusters that use VMware Tanzu GemFire to provide high availability, replication guarantees, and eventual consistency.

When you first spin up a cluster, you have three locators and at least four servers.

graph TD; Client subgraph Cluster subgraph locators Locator1 Locator2 Locator3 end subgraph servers Server1 Server2 Server3 Server4 end end Client==>Locator1 Client-->Server1 Client-->Server2 Client-->Server3 Client-->Server4

When you scale up the cluster, you have more servers, increasing the capacity of the cache. There are always three locators.

graph TD; Client subgraph Cluster subgraph locators Locator1 Locator2 Locator3 end subgraph servers Server1 Server2 Server3 Server4 Server5 Server6 Server7 end end Client==>Locator1 Client-->Server1 Client-->Server2 Client-->Server3 Client-->Server4 Client-->Server5 Client-->Server6 Client-->Server7

Member Communication

When a client connects to the cluster, it first connects to a locator. The locator replies with the IP address of a server for it to talk to. The client then connects to that server.

sequenceDiagram participant Client participant Locator participant Server1 Client->>+Locator: What servers can I talk to? Locator->>-Client: Server1 Client->>Server1: Hello!

When the client wants to read or write data, it sends a request directly to the server.

sequenceDiagram participant Client participant Server1 Client->>+Server1: What’s the value for KEY? Server1->>-Client: VALUE

If the server doesn’t have the data locally, it fetches it from another server.

sequenceDiagram participant Client participant Server1 participant Server2 Client->>+Server1: What’s the value for KEY? Server1->>+Server2: What’s the value for KEY? Server2->>-Server1: VALUE Server1->>-Client: VALUE