SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Real-time data and statistics on the
open hybrid cloud with Quarkus and
Infinispan
Katia Aresti
Infinispan (Red Hat)
Image © Nathalie https://flic.kr/p/DjZzhR (CC BY 2.0)
24/06/2021
Hi! I’m Katia
Aresti
2
@karesti
Senior Software Engineer
2017 Infinispan
Duchess France & Devoxx France
2019 Java Champion
@karesti | DevNation Tech Talks #Infinispan #Quarkus
Battleship Game - Red Hat Summit Keynote 2021
@karesti | DevNation Tech Talks #Infinispan #Quarkus
Scoring API
Managed
WSS
Cloud Event
Broker
Game
Scores
Matches
Players
Leaderboard
Game Stats
WebSocket
WebSocket
HTTP
Binary
Binary
Binary
HTTPS
Binary
3 Clusters, Open Hybrid Cloud
GCP, AWS, Azure
@karesti | DevNation Tech Talks #Infinispan #Quarkus
Scoring API
Managed
WSS
Cloud Event
Broker
Game
Scores
Matches
Players
Leaderboard
Game Stats
WebSocket
WebSocket
HTTP
Binary
Binary
Binary
HTTPS
Binary
3 Clusters, Open Hybrid Cloud
GCP, AWS, Azure
Image © Nathalie https://flic.kr/p/DjZzhR (CC BY 2.0)
@karesti | DevNation Tech Talks #Infinispan #Quarkus
Infinispan
100% Open-Source, In-Memory Distributed Data (caches)
Interoperability
Resilient
Fault Tolerant Data
Clustered Processing Query
ACID Tx
@karesti | DevNation Tech Talks #Infinispan #Quarkus
Game
Leaderboard
Hot Rod
(binary)
REST
...
Backoffice
Data
Infinispan Cluster
Data
Data
Infinispan Client-Server
@karesti | DevNation Tech Talks #Infinispan #Quarkus
Basic Cache Configuration
{
"distributed-cache": {
"mode": "SYNC",
"statistics": true
}
}
- API code client
- Server configuration: infinispan.xml
- Command Line Tool (CLI)
- Infinispan Console
- Infinispan Operator (Kubernetes)
players-scores
@karesti | DevNation Tech Talks #Infinispan #Quarkus
@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();
@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
@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
@karesti | DevNation Tech Talks #Infinispan #Quarkus
Indexing and Encoding Configuration
{
"distributed-cache": {
"encoding": {
"media-type": "application/x-protostream"
},
"indexing": {
"indexed-entities": [
"com.redhat.PlayerScore"
],
"enabled": true
},
players-scores
@karesti | DevNation Tech Talks #Infinispan #Quarkus
@karesti | DevNation Tech Talks #Infinispan #Quarkus
LON
(AWS)
NYC
(GCP)
Load Balancer
APP
APP
Leaderboard
APP
APP
Leaderboard
Shared
State
Shared
State
Shared
State
Shared
State
Scores Aws
Scores GCP
scores
scores
Infinispan Cross-Site Replication
@karesti | DevNation Tech Talks #Infinispan #Quarkus
Cluster Backup Configuration
"distributed-cache": {
"backups": {
"backup": {
"site": "LON",
"strategy": "SYNC",
"failure-policy": "WARN"
}
"distributed-cache": {
"backups": {
"backup": {
"site": "NYC",
"strategy": "SYNC",
"failure-policy": "WARN"
}
London
data
New York
data
Cross-Site Replication
Active-Active
players-scores players-scores
Leaderboard demo
Image © Nathalie https://flic.kr/p/DjZzhR (CC BY 2.0)
@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

Contenu connexe

Plus de Red Hat Developers

Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Red Hat Developers
 

Plus de Red Hat Developers (20)

Containers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech TalkContainers without docker | DevNation Tech Talk
Containers without docker | DevNation Tech Talk
 
Distributed deployment of microservices across multiple OpenShift clusters | ...
Distributed deployment of microservices across multiple OpenShift clusters | ...Distributed deployment of microservices across multiple OpenShift clusters | ...
Distributed deployment of microservices across multiple OpenShift clusters | ...
 
DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...
DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...
DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...
 
Dear security, compliance, and auditing: We’re sorry. Love, DevOps | DevNatio...
Dear security, compliance, and auditing: We’re sorry. Love, DevOps | DevNatio...Dear security, compliance, and auditing: We’re sorry. Love, DevOps | DevNatio...
Dear security, compliance, and auditing: We’re sorry. Love, DevOps | DevNatio...
 
11 CLI tools every developer should know | DevNation Tech Talk
11 CLI tools every developer should know | DevNation Tech Talk11 CLI tools every developer should know | DevNation Tech Talk
11 CLI tools every developer should know | DevNation Tech Talk
 
A Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
A Microservices approach with Cassandra and Quarkus | DevNation Tech TalkA Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
A Microservices approach with Cassandra and Quarkus | DevNation Tech Talk
 
GitHub Actions and OpenShift: ​​Supercharging your software development loops...
GitHub Actions and OpenShift: ​​Supercharging your software development loops...GitHub Actions and OpenShift: ​​Supercharging your software development loops...
GitHub Actions and OpenShift: ​​Supercharging your software development loops...
 
To the moon and beyond with Java 17 APIs! | DevNation Tech Talk
To the moon and beyond with Java 17 APIs! | DevNation Tech TalkTo the moon and beyond with Java 17 APIs! | DevNation Tech Talk
To the moon and beyond with Java 17 APIs! | DevNation Tech Talk
 
Profile your Java apps in production on Red Hat OpenShift with Cryostat | Dev...
Profile your Java apps in production on Red Hat OpenShift with Cryostat | Dev...Profile your Java apps in production on Red Hat OpenShift with Cryostat | Dev...
Profile your Java apps in production on Red Hat OpenShift with Cryostat | Dev...
 
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
Kafka at the Edge: an IoT scenario with OpenShift Streams for Apache Kafka | ...
 
Kubernetes configuration and security policies with KubeLinter | DevNation Te...
Kubernetes configuration and security policies with KubeLinter | DevNation Te...Kubernetes configuration and security policies with KubeLinter | DevNation Te...
Kubernetes configuration and security policies with KubeLinter | DevNation Te...
 
Level-up your gaming telemetry using Kafka Streams | DevNation Tech Talk
Level-up your gaming telemetry using Kafka Streams | DevNation Tech TalkLevel-up your gaming telemetry using Kafka Streams | DevNation Tech Talk
Level-up your gaming telemetry using Kafka Streams | DevNation Tech Talk
 
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
Friends don't let friends do dual writes: Outbox pattern with OpenShift Strea...
 
Know your app: Add metrics to Java with Micrometer | DevNation Tech Talk
Know your app: Add metrics to Java with Micrometer | DevNation Tech TalkKnow your app: Add metrics to Java with Micrometer | DevNation Tech Talk
Know your app: Add metrics to Java with Micrometer | DevNation Tech Talk
 
Building streaming applications using a managed Kafka service | DevNation Tec...
Building streaming applications using a managed Kafka service | DevNation Tec...Building streaming applications using a managed Kafka service | DevNation Tec...
Building streaming applications using a managed Kafka service | DevNation Tec...
 
RESTEasy Reactive: Why should you care? | DevNation Tech Talk
RESTEasy Reactive: Why should you care? | DevNation Tech TalkRESTEasy Reactive: Why should you care? | DevNation Tech Talk
RESTEasy Reactive: Why should you care? | DevNation Tech Talk
 
Improving security with Istio | DevNation Tech Talk
Improving security with Istio | DevNation Tech TalkImproving security with Istio | DevNation Tech Talk
Improving security with Istio | DevNation Tech Talk
 
Building successful business Java apps: How to deliver more, code less, and c...
Building successful business Java apps: How to deliver more, code less, and c...Building successful business Java apps: How to deliver more, code less, and c...
Building successful business Java apps: How to deliver more, code less, and c...
 
Let's make a contract: The art of designing a Java API | DevNation Tech Talk
Let's make a contract: The art of designing a Java API | DevNation Tech TalkLet's make a contract: The art of designing a Java API | DevNation Tech Talk
Let's make a contract: The art of designing a Java API | DevNation Tech Talk
 
Building kubectl plugins with Quarkus | DevNation Tech Talk
Building kubectl plugins with Quarkus | DevNation Tech TalkBuilding kubectl plugins with Quarkus | DevNation Tech Talk
Building kubectl plugins with Quarkus | DevNation Tech Talk
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Real-time data and statistics on the open hybrid cloud with Quarkus and Infinispan | DevNation Tech Talk

  • 1. Real-time data and statistics on the open hybrid cloud with Quarkus and Infinispan Katia Aresti Infinispan (Red Hat) Image © Nathalie https://flic.kr/p/DjZzhR (CC BY 2.0) 24/06/2021
  • 2. Hi! I’m Katia Aresti 2 @karesti Senior Software Engineer 2017 Infinispan Duchess France & Devoxx France 2019 Java Champion
  • 3. @karesti | DevNation Tech Talks #Infinispan #Quarkus Battleship Game - Red Hat Summit Keynote 2021
  • 4. @karesti | DevNation Tech Talks #Infinispan #Quarkus Scoring API Managed WSS Cloud Event Broker Game Scores Matches Players Leaderboard Game Stats WebSocket WebSocket HTTP Binary Binary Binary HTTPS Binary 3 Clusters, Open Hybrid Cloud GCP, AWS, Azure
  • 5. @karesti | DevNation Tech Talks #Infinispan #Quarkus Scoring API Managed WSS Cloud Event Broker Game Scores Matches Players Leaderboard Game Stats WebSocket WebSocket HTTP Binary Binary Binary HTTPS Binary 3 Clusters, Open Hybrid Cloud GCP, AWS, Azure
  • 6. Image © Nathalie https://flic.kr/p/DjZzhR (CC BY 2.0)
  • 7. @karesti | DevNation Tech Talks #Infinispan #Quarkus Infinispan 100% Open-Source, In-Memory Distributed Data (caches) Interoperability Resilient Fault Tolerant Data Clustered Processing Query ACID Tx
  • 8. @karesti | DevNation Tech Talks #Infinispan #Quarkus Game Leaderboard Hot Rod (binary) REST ... Backoffice Data Infinispan Cluster Data Data Infinispan Client-Server
  • 9. @karesti | DevNation Tech Talks #Infinispan #Quarkus Basic Cache Configuration { "distributed-cache": { "mode": "SYNC", "statistics": true } } - API code client - Server configuration: infinispan.xml - Command Line Tool (CLI) - Infinispan Console - Infinispan Operator (Kubernetes) players-scores
  • 10. @karesti | DevNation Tech Talks #Infinispan #Quarkus
  • 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
  • 14. @karesti | DevNation Tech Talks #Infinispan #Quarkus Indexing and Encoding Configuration { "distributed-cache": { "encoding": { "media-type": "application/x-protostream" }, "indexing": { "indexed-entities": [ "com.redhat.PlayerScore" ], "enabled": true }, players-scores
  • 15. @karesti | DevNation Tech Talks #Infinispan #Quarkus
  • 16. @karesti | DevNation Tech Talks #Infinispan #Quarkus LON (AWS) NYC (GCP) Load Balancer APP APP Leaderboard APP APP Leaderboard Shared State Shared State Shared State Shared State Scores Aws Scores GCP scores scores Infinispan Cross-Site Replication
  • 17. @karesti | DevNation Tech Talks #Infinispan #Quarkus Cluster Backup Configuration "distributed-cache": { "backups": { "backup": { "site": "LON", "strategy": "SYNC", "failure-policy": "WARN" } "distributed-cache": { "backups": { "backup": { "site": "NYC", "strategy": "SYNC", "failure-policy": "WARN" } London data New York data Cross-Site Replication Active-Active players-scores players-scores
  • 18. Leaderboard demo Image © Nathalie https://flic.kr/p/DjZzhR (CC BY 2.0)
  • 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