Data is everywhere these days, but how can we make it work together? How would you make the Red Hat Summit 2021 Keynote Battleship game a reality, syncing thousands of transactions across multiple different clouds in different continents in real time? Quarkus and Infinispan to the rescue! Join us on this tech talk to witness how these technologies can make your life a joy - either by coding or playing a fantastic interactive online game.
8. @karesti | DevNation Tech Talks #Infinispan #Quarkus
Game
Leaderboard
Hot Rod
(binary)
REST
...
Backoffice
Data
Infinispan Cluster
Data
Data
Infinispan Client-Server
11. @karesti | DevNation Tech Talks #Infinispan #Quarkus
Infinispan Query
Infinispan Client Extension
@Inject
@Remote("player-scores")
RemoteCache<String, PlayerScore> playersScores;
QueryFactory queryFactory =
Search.getQueryFactory(playersScores);
topTenQuery = queryFactory.create( "from com.redhat.PlayerScore p
WHERE p.human=true ORDER BY p.score DESC")
.maxResults(10);
List<PlayerScore> topTen = topTenQuery.execute().list();
12. @karesti | DevNation Tech Talks #Infinispan #Quarkus
Marshalling and Data formats
Data
Stores the data
- Java
- Text, JSON, XML
- Protobuf
Application
Uses a Marshaller
- JavaMarshaller
- StringMarshaller
- ProtostreamMarshaller
Serialized data
🔗 New Guide Available
Protostream
13. @karesti | DevNation Tech Talks #Infinispan #Quarkus
Infinispan Protostream API
@ProtoDoc("@Indexed")
public class PlayerScore {
@ProtoFactory
public PlayerScore(String userName) {
@ProtoField(number = 1)
@ProtoDoc("@Field(index=Index.YES,
analyze = Analyze.YES, store =
Store.YES)")
public String getUserName() {
return userName;
}
PlayerScore.java
package com.redhat;
/**
* @Indexed
*/
message PlayerScore {
/**
* @Field(index=Index.YES, analyze
= Analyze.YES, store = Store.NO)
*/
optional string userName = 1;
⚙
Protostream
player-score.proto
https://github.com/infinispan/protostream
19. @karesti | DevNation Tech Talks #Infinispan #Quarkus
Thank You!!!
Q & A
@infinispan
Infinispan documentation
Building a real-time leaderboard with Red Hat Data Grid and Quarkus on a hybrid Kubernetes
deployment
Create and manage Red Hat Data Grid services in the hybrid cloud
Live demonstration: Building cloud-native applications with AI/ML
Quarkus and Infinispan Client extension