Getting Started
This section contains guidance for getting started with GigaSpaces Service Grid A built-in orchestration tool which contains a set of Grid Service Containers (GSCs) managed by a Grid Service Manager. The containers host various deployments of Processing Units and data grids. Each container can be run on a separate physical machine. This orchestration is available for XAP only. (for XAP GigaSpaces eXtreme Application Platform. Provides a powerful solution for data processing, launching, and running digital services) and Kubernetes An open-source container orchestration system for automating software deployment, scaling, and management of containerized applications. (XAP Skyline A highly customizable developer platform that allows building scalable HA with high throughput and ultra-low latency Java applications running on Kubernetes clusters) environments.
Some useful terms: Stateful PU This is a Space containing data and might also include code and services. They are displayed in all UI tools and the metrics for them are managed., Stateless PU Built-in services such as mirror WAN-GW, data GW and custom services. They are displayed in some UI tools (Ops-UI/Web-UI) but NOT in SpaceDeck. Metrics are managed., Client Services
Order | Action | Code Example | Reference/Explanation |
---|---|---|---|
1 | Create and connect to a Space Where GigaSpaces data is stored. It is the logical cache that holds data objects in memory and might also hold them in layered in tiering. Data is hosted from multiple SoRs, consolidated as a unified data model. |
// an example of instantiating a remote proxy
|
The Space Bean |
2 | GigaSpaces Basic API - Write & Read | Client Blueprint | The Space Operations |
3 | Build your Data Model | @SpaceClass
public class Person {
private Integer id;
private String name;
private String lastName;
private int age;
...
public Person() {}
@SpaceId(autoGenerate=false)
@SpaceRouting
public Integer getId() { return id;}
public void setId(Integer id) { this.id = id; }
@SpaceIndex(type=SpaceIndexType.EQUAL)
public String getLastName() { return lastName; }
public void setLastName(String lastName) { this.lastName = lastName; }
@SpaceProperty(nullValue="-1")
public int getAge(){ return age; }
.......
}
|
Modeling Your Data |
4 | Understanding Routing The mechanism that is in charge of routing the objects into and out of the corresponding partitions. The routing is based on a designated attribute inside the objects that are written to the Space, called the Routing Index. |
Routing is the property inside a space class that says how objects will be distributed across partitions, there is also a strategy that instead of distributing you can replicate the table data across all partitions for small tables.
|
|
5 | Add Colocated Logic to your Space |
Colocated logic can contain event processing, code for services, and any application bean that should run together within the Space partition, in the example provided, you can see colocated event containers and remote service exposure
In your installation folder you will find examples of event processing:
|
|
6 | Query your data | results = gigaSpace.readMultiple(new SQLQuery<MyClass>(MyClass.class, "num > 1 ORDER BY name"));
|
Query Language |
7 | Change your Data Efficiently |
|
Change API Overview |
8 | Send Code to be Executed on Data JVMs |
AsyncFuture<Long> future = gigaSpace.execute(new MyDistTask()); long result = future.get(); // result will be number of partitions
|
Task Execution Overview |
9 | Build Workflows |
With event processing you can build workflows, moving related object from one state to the other and define listeners per state
|
|
10 | Interact with the Database |
You can perform an initial load into the Space from a data source and can replicate changes in memory to a target (database, Kafka Apache Kafka is a distributed event store and stream-processing platform. Apache Kafka is a distributed publish-subscribe messaging system. A message is any kind of information that is sent from a producer (application that sends the messages) to a consumer (application that receives the messages). Producers write their messages or data to Kafka topics. These topics are divided into partitions that function like logs. Each message is written to a partition and has a unique offset, or identifier. Consumers can specify a particular offset point where they can begin to read messages.). Refer to the blueprint Java project templating framework provided by DIH for developers, a bueprint, or class, contains a set of attributes and behaviors that define an object. example (see #2 above) of how to load data from a relational database using hibernate integration and how to replicate data to that database, similar can be done with other kinds of sources such as MongoDB, Cassandara and Kafka.
|
Persistency for a Database |
11 | Creating a PU This is the unit of packaging and deployment in the GigaSpaces Data Grid, and is essentially the main GigaSpaces service. The Processing Unit (PU) itself is typically deployed onto the Service Grid. When a Processing Unit is deployed, a Processing Unit instance is the actual runtime entity. (Service) | ||
12a |
Deploy your Services in Service Grid XAP only |
Deploying onto the Service Grid | |
12b |
Deploy your Services in Kubernetes XAP Skyline only |
Deploying a Customer Processing Unit helm install custom-pu gigaspaces/xap-pu --version 16.5.0 --set instances=0,partitions=1,resourceUrl=pu.jar,image.repository=my-space,image.tag=latest
|
|
Training Materials
The following training materials can be accessed in order to assist in getting started:
-
GigaSpaces Kubernetes - XAP Skyline and Smart DIH Smart DIH allows enterprises to develop and deploy digital services in an agile manner, without disturbing core business applications. This is achieved by creating an event-driven, highly performing, efficient and available replica of the data from multiple systems and applications, only.
Examples
Integration examples such as Spring data, how to use Grafana Grafana is a multi-platform open source analytics and interactive visualization web application. It provides charts, graphs, and alerts for the web when connected to supported data sources., monitoring with Kubernetes, installing on OpenShift, deep learning, and more can be found in our Git Solution Hub. You can also find a best practice section with examples for WAN gateway replication, Data modeling patterns, Custom aggregation examples, and much more.
Need assistance or further information? Don't hesitate to contact us — we're here to help!