SlideShare a Scribd company logo
1 of 33
Download to read offline
How Big Fish Games Developed Real-Time Analytics Using
Kafka Streams and Elastic Search
2 Big Fish Confidential
Big Fish Games
o Leading producer and distributor of casual
games.
o 2.5 billion games distributed to customers in
150 countries
o 450 unique mobile games
o 3500 unique PC games
3 Big Fish Confidential
Cooking Craze
4 Big Fish Confidential
Live Operations Real Time Dashboard
Let’s Dish
5 Big Fish Confidential
Live Ops and Free to Play Games
o Monetization through “in app” purchases
o Games evolve and are extended indefinitely
o Live Operations
o Games which allow real-time updates to
improve the game or align to audiences
needs
6 Big Fish Confidential
Monitoring a Forced Update
7 Big Fish Confidential
Monitoring New Content
8 Big Fish Confidential
Monitoring Event Participation
9 Big Fish Confidential
Kafka at Big Fish
10 Big Fish Confidential
Let’s Dish Dashboards
Data Sources
o Game Telemetry Events from a Kafka Topic
o restaurant leave , restaurant join
o session start, session foreground, session
background, session heartbeat
o recipe complete, recipe burn
o Hive Data
o Install Date
o bookings , bookings Last30
o channel Type
o bfgudid
11 Big Fish Confidential
Elastic Search Document{
"_index": "letsdish-2018-19",
"_type": "recipes",
"_id": "f4858a61-cf4e-400c-952e-6e940774e1ef",
"_score": 1,
"_source": {
"count": 1,
"restaurantScheduleId": "french",
"restaurantsAvailable": 5,
"installDate": "2018-05-09",
"bookingsBin": "No Monetization",
"bookingsBinLast30": "No Monetization",
"channelType": "Organic",
"environment": "prod",
"appName": "LetsDish",
"bfgudid": "f8e1d52b7a5edb26aafed418e2a25c6879766f9c",
"platform": "android",
"customUtc": 1526078368,
"countryCode": "US",
"appVersion": "42",
"guid": "f4858a61-cf4e-400c-952e-6e940774e1ef“
(…)
},
"fields": {
"customUtc": [
"2018-05-11T22:39:28.000Z"
],
"installDate": [
"2018-05-09T00:00:00.000Z"
]
}
}
12 Big Fish Confidential
Two Streams APIs
o Streams DSL
o Abstraction of Processor API
o Used for Let’s Dish Dashboards
o Streams Processor API
o More flexible
o Finer control of stream processing
13 Big Fish Confidential
Let’s Dish Streaming Transformation
Topology
14 Big Fish Confidential
Mapping, Filtering and
Branching
15 Big Fish Confidential
Map Function
KeyValueMapper<String, String,
<String,GtEvent>>
Maps JSON String Value to Game
Telemetry Pojo: GtEvent
16 Big Fish Confidential
Java 8 Lambda Function
Map Function
public static KeyValueMapper<String, String,
KeyValue<String, GtEvent>>
mapStringToGtEvent = (k, v) ->
{
GtEvent gtEvent;
try {
gtEvent = new Gson().fromJson(v,GtEvent.class);
} catch (Exception e) {
gtEvent = new CustomEvent();
} return
new KeyValue<String, GtEvent>(k, gtEvent);
};
17 Big Fish Confidential
Filter Predicates
KStreams filter and branch methods
take a Predicate interface
KStream.filter(Predicate)
KStream.branch(Predicate[])
18 Big Fish Confidential
Java 8 Lambda Functions
Filter Predicates
public static Predicate<String, GtEvent>
isRecipeComplete = (k, v) ->
"recipe_complete".equals(
v.data.eventName.toLowerCase());
public static Predicate<String, GtEvent>
isSession = (k, v) ->
Arrays.asList("session_start",
"session_foreground",
"session_background",
"session_heartbeat")
.contains(v.data.eventName.toLowerCase());
19 Big Fish Confidential
Map and Filters Combined
public static KStream<String, GtEvent>[] createBranchedStreams(
KStream<String, String> source) {
return source
.map(Mappers.mapStringToGtEvent)
.branch(
FilterPredicates.isRecipeComplete,
FilterPredicates.isRecipeBurn,
FilterPredicates.isSession,
FilterPredicates.isRestaurant);
}
20 Big Fish Confidential
Four KStreams
o Recipe Burn
o Recipe Complete
o Restaurant Unlocked
o Restaurant Names
21 Big Fish Confidential
Aggregated Player Purchases Table
Enhance KStreams with
Hive Table
ID FIRST
INSTALL
DATE
BOOKINGS
BIN
BOOKINGS LAST
30 DAYS
CHANNEL TYPE
1 9/12/2018 $1 <= $5 $1 <= $5 paid
2 9/12/2018 $5 <= $20 $5 <= $20 organic
3 9/12/2018 $1 <= $5 $1 <= $5 paid
22 Big Fish Confidential
Kafka Topic
23 Big Fish Confidential
Joining Streams
24 Big Fish Confidential
Types of Joins
o Windowed Join (No State)
o KStream->KStream
o Non-Windowed Joins (State Maintained )
o KStream->KTable
o KTable->KTable
25 Big Fish Confidential
Using Group By Key
Creating a KTable from Kstream
.groupByKey(Serialized.with(stringSerde,longSerde))
.reduce((oldValue, newValue) ->
Math.max(oldValue, newValue),
Materialized.<String, Long,
KeyValueStore<Bytes, byte[]>>
as("restaurants-unlocked-store")
.withKeySerde(stringSerde)
.withValueSerde(longSerde));
26 Big Fish Confidential
Recipe Burn Stream to Restaurant Unlocked KTable
Steps to Joining
recipeBurnKStream.leftJoin(
restaurantUnlockedKTable,
RecipeValueJoiners.joinRecipeToRestaurantUnlocked,
Joined.with(
stringSerde,enrichedEventSerde,longSerde)
);
27 Big Fish Confidential
Where are the join conditions?
Join Keys
KStream<String, EnrichedEvent> recipeBurnKStream
Joined with
KTable<String, Long> restaurantUnlockedKTable
on the Keys.
28 Big Fish Confidential
Value Joiner
public static ValueJoiner<EnrichedEvent, Long, EnrichedEvent>
joinRecipeToRestaurantUnlocked =
(e, restaurantsUnlocked) -> {
e.enrichedRecipeEvent.restaurantsUnlocked =
(restaurantsUnlocked == null) ?
-1L : restaurantsUnlocked;
return e;
};
29 Big Fish Confidential
• EnrichedEventSerde
• org.apache.kafka.common.serialization
interfaces
Custom Serialization
Joined.with(stringSerde,enrichedEventSerde
,longSerde)
30 Big Fish Confidential
Join Recap
o Keys are used for joining
o KStream<String, EnrichedEvent>
o KTable<String, Long>
o Value Joiners
o Return the number of restaurants
unlocked
o If null return -1
o Custom Serde for EnrichedEvent
31 Big Fish Confidential
Elastic Search Document
{
"_index": "letsdish-2018-19",
"_type": "recipes",
"_id": "f4858a61-cf4e-400c-
952e-6e940774e1ef",
"_score": 1,
"_source": {
"count": 1,
"restaurantScheduleId": "fr
ench",
"restaurantsAvailable": 5,
"installDate": "2018-05-
09",
"bookingsBin": "No
Monetization",
"bookingsBinLast30": "No
Monetization",
…
32 Big Fish Confidential
Elastic Search Bulk API
o Bulk Processing Greatly Increases the Index
Speed
o Two possible implementations of the Bulk
API
o Direct calls to the REST service
o Elastic Search Libraries
o BulkProcessor and RestClientBuilder
o Wrap lower level work
33 Big Fish Confidential
Continue to Build Real Time
Dashboards for Games

More Related Content

Similar to How Big Fish Games Developed Real-Time Analytics Using Kafka Streams and Elasticsearch

Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingNAVER D2
 
Oracle Goldengate for Big Data - LendingClub Implementation
Oracle Goldengate for Big Data - LendingClub ImplementationOracle Goldengate for Big Data - LendingClub Implementation
Oracle Goldengate for Big Data - LendingClub ImplementationVengata Guruswamy
 
Elastic stack upgrade
Elastic stack upgradeElastic stack upgrade
Elastic stack upgradeAnna Ossowski
 
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017Mike Nakhimovich
 
Event-driven Microservices with Python and Apache Kafka with Dave Klein | Ka...
Event-driven Microservices with Python and Apache Kafka with Dave Klein  | Ka...Event-driven Microservices with Python and Apache Kafka with Dave Klein  | Ka...
Event-driven Microservices with Python and Apache Kafka with Dave Klein | Ka...HostedbyConfluent
 
Chunlei Wu BD2K 201601 MyGene.info and MyVariant.info
Chunlei Wu BD2K 201601 MyGene.info and MyVariant.infoChunlei Wu BD2K 201601 MyGene.info and MyVariant.info
Chunlei Wu BD2K 201601 MyGene.info and MyVariant.infoChunlei Wu
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJohn Anderson
 
Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!C2B2 Consulting
 
JSR107 Come, Code, Cache, Compute!
JSR107 Come, Code, Cache, Compute! JSR107 Come, Code, Cache, Compute!
JSR107 Come, Code, Cache, Compute! Payara
 
Taming WebSocket with Scarlet
Taming WebSocket with ScarletTaming WebSocket with Scarlet
Taming WebSocket with ScarletZhixuan Lai
 
Refatorando com a API funcional do Java
Refatorando com a API funcional do JavaRefatorando com a API funcional do Java
Refatorando com a API funcional do JavaGiovane Liberato
 
Docker Summit 2016 - Kubernetes: Sweets and Bitters
Docker Summit 2016 - Kubernetes: Sweets and BittersDocker Summit 2016 - Kubernetes: Sweets and Bitters
Docker Summit 2016 - Kubernetes: Sweets and Bitterssmalltown
 
Building a Streaming Platform with Kafka
Building a Streaming Platform with KafkaBuilding a Streaming Platform with Kafka
Building a Streaming Platform with Kafkaconfluent
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXDocker, Inc.
 
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouseApplication Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouseVictoriaMetrics
 
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...Altinity Ltd
 
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORKAltitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORKFastly
 
Building Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaGuido Schmutz
 
Realtime Analytics on AWS
Realtime Analytics on AWSRealtime Analytics on AWS
Realtime Analytics on AWSSungmin Kim
 
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017Network Performance: Making Every Packet Count - NET401 - re:Invent 2017
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017Amazon Web Services
 

Similar to How Big Fish Games Developed Real-Time Analytics Using Kafka Streams and Elasticsearch (20)

Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
 
Oracle Goldengate for Big Data - LendingClub Implementation
Oracle Goldengate for Big Data - LendingClub ImplementationOracle Goldengate for Big Data - LendingClub Implementation
Oracle Goldengate for Big Data - LendingClub Implementation
 
Elastic stack upgrade
Elastic stack upgradeElastic stack upgrade
Elastic stack upgrade
 
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
Data Loading Made Easy with Mike Nakhimovich DroidCon Italy 2017
 
Event-driven Microservices with Python and Apache Kafka with Dave Klein | Ka...
Event-driven Microservices with Python and Apache Kafka with Dave Klein  | Ka...Event-driven Microservices with Python and Apache Kafka with Dave Klein  | Ka...
Event-driven Microservices with Python and Apache Kafka with Dave Klein | Ka...
 
Chunlei Wu BD2K 201601 MyGene.info and MyVariant.info
Chunlei Wu BD2K 201601 MyGene.info and MyVariant.infoChunlei Wu BD2K 201601 MyGene.info and MyVariant.info
Chunlei Wu BD2K 201601 MyGene.info and MyVariant.info
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your Life
 
Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!Jsr107 come, code, cache, compute!
Jsr107 come, code, cache, compute!
 
JSR107 Come, Code, Cache, Compute!
JSR107 Come, Code, Cache, Compute! JSR107 Come, Code, Cache, Compute!
JSR107 Come, Code, Cache, Compute!
 
Taming WebSocket with Scarlet
Taming WebSocket with ScarletTaming WebSocket with Scarlet
Taming WebSocket with Scarlet
 
Refatorando com a API funcional do Java
Refatorando com a API funcional do JavaRefatorando com a API funcional do Java
Refatorando com a API funcional do Java
 
Docker Summit 2016 - Kubernetes: Sweets and Bitters
Docker Summit 2016 - Kubernetes: Sweets and BittersDocker Summit 2016 - Kubernetes: Sweets and Bitters
Docker Summit 2016 - Kubernetes: Sweets and Bitters
 
Building a Streaming Platform with Kafka
Building a Streaming Platform with KafkaBuilding a Streaming Platform with Kafka
Building a Streaming Platform with Kafka
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINX
 
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouseApplication Monitoring using Open Source: VictoriaMetrics - ClickHouse
Application Monitoring using Open Source: VictoriaMetrics - ClickHouse
 
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
Application Monitoring using Open Source - VictoriaMetrics & Altinity ClickHo...
 
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORKAltitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
Altitude San Francisco 2018: Fastly Purge Control at the USA TODAY NETWORK
 
Building Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache KafkaBuilding Event-Driven (Micro) Services with Apache Kafka
Building Event-Driven (Micro) Services with Apache Kafka
 
Realtime Analytics on AWS
Realtime Analytics on AWSRealtime Analytics on AWS
Realtime Analytics on AWS
 
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017Network Performance: Making Every Packet Count - NET401 - re:Invent 2017
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017
 

More from confluent

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flinkconfluent
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsconfluent
 
Workshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con FlinkWorkshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con Flinkconfluent
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...confluent
 
AWS Immersion Day Mapfre - Confluent
AWS Immersion Day Mapfre   -   ConfluentAWS Immersion Day Mapfre   -   Confluent
AWS Immersion Day Mapfre - Confluentconfluent
 
Eventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalkEventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalkconfluent
 
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent CloudQ&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent Cloudconfluent
 
Citi TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Diveconfluent
 
Build real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with ConfluentBuild real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with Confluentconfluent
 
Q&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Meshconfluent
 
Citi Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservicesconfluent
 
Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3confluent
 
Citi Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging ModernizationCiti Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging Modernizationconfluent
 
Citi Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time dataCiti Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time dataconfluent
 
Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2confluent
 
Data In Motion Paris 2023
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023confluent
 
Confluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with SynthesisConfluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with Synthesisconfluent
 
The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023confluent
 
The Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streamsconfluent
 

More from confluent (20)

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flink
 
Unlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insightsUnlocking the Power of IoT: A comprehensive approach to real-time insights
Unlocking the Power of IoT: A comprehensive approach to real-time insights
 
Workshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con FlinkWorkshop híbrido: Stream Processing con Flink
Workshop híbrido: Stream Processing con Flink
 
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
Industry 4.0: Building the Unified Namespace with Confluent, HiveMQ and Spark...
 
AWS Immersion Day Mapfre - Confluent
AWS Immersion Day Mapfre   -   ConfluentAWS Immersion Day Mapfre   -   Confluent
AWS Immersion Day Mapfre - Confluent
 
Eventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalkEventos y Microservicios - Santander TechTalk
Eventos y Microservicios - Santander TechTalk
 
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent CloudQ&A with Confluent Experts: Navigating Networking in Confluent Cloud
Q&A with Confluent Experts: Navigating Networking in Confluent Cloud
 
Citi TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
 
Build real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with ConfluentBuild real-time streaming data pipelines to AWS with Confluent
Build real-time streaming data pipelines to AWS with Confluent
 
Q&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service MeshQ&A with Confluent Professional Services: Confluent Service Mesh
Q&A with Confluent Professional Services: Confluent Service Mesh
 
Citi Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka MicroservicesCiti Tech Talk: Event Driven Kafka Microservices
Citi Tech Talk: Event Driven Kafka Microservices
 
Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3Confluent & GSI Webinars series - Session 3
Confluent & GSI Webinars series - Session 3
 
Citi Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging ModernizationCiti Tech Talk: Messaging Modernization
Citi Tech Talk: Messaging Modernization
 
Citi Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time dataCiti Tech Talk: Data Governance for streaming and real time data
Citi Tech Talk: Data Governance for streaming and real time data
 
Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2Confluent & GSI Webinars series: Session 2
Confluent & GSI Webinars series: Session 2
 
Data In Motion Paris 2023
Data In Motion Paris 2023Data In Motion Paris 2023
Data In Motion Paris 2023
 
Confluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with SynthesisConfluent Partner Tech Talk with Synthesis
Confluent Partner Tech Talk with Synthesis
 
The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023The Future of Application Development - API Days - Melbourne 2023
The Future of Application Development - API Days - Melbourne 2023
 
The Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streams
 

Recently uploaded

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...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
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 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
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 Takeoffsammart93
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Recently uploaded (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...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

How Big Fish Games Developed Real-Time Analytics Using Kafka Streams and Elasticsearch

  • 1. How Big Fish Games Developed Real-Time Analytics Using Kafka Streams and Elastic Search
  • 2. 2 Big Fish Confidential Big Fish Games o Leading producer and distributor of casual games. o 2.5 billion games distributed to customers in 150 countries o 450 unique mobile games o 3500 unique PC games
  • 3. 3 Big Fish Confidential Cooking Craze
  • 4. 4 Big Fish Confidential Live Operations Real Time Dashboard Let’s Dish
  • 5. 5 Big Fish Confidential Live Ops and Free to Play Games o Monetization through “in app” purchases o Games evolve and are extended indefinitely o Live Operations o Games which allow real-time updates to improve the game or align to audiences needs
  • 6. 6 Big Fish Confidential Monitoring a Forced Update
  • 7. 7 Big Fish Confidential Monitoring New Content
  • 8. 8 Big Fish Confidential Monitoring Event Participation
  • 9. 9 Big Fish Confidential Kafka at Big Fish
  • 10. 10 Big Fish Confidential Let’s Dish Dashboards Data Sources o Game Telemetry Events from a Kafka Topic o restaurant leave , restaurant join o session start, session foreground, session background, session heartbeat o recipe complete, recipe burn o Hive Data o Install Date o bookings , bookings Last30 o channel Type o bfgudid
  • 11. 11 Big Fish Confidential Elastic Search Document{ "_index": "letsdish-2018-19", "_type": "recipes", "_id": "f4858a61-cf4e-400c-952e-6e940774e1ef", "_score": 1, "_source": { "count": 1, "restaurantScheduleId": "french", "restaurantsAvailable": 5, "installDate": "2018-05-09", "bookingsBin": "No Monetization", "bookingsBinLast30": "No Monetization", "channelType": "Organic", "environment": "prod", "appName": "LetsDish", "bfgudid": "f8e1d52b7a5edb26aafed418e2a25c6879766f9c", "platform": "android", "customUtc": 1526078368, "countryCode": "US", "appVersion": "42", "guid": "f4858a61-cf4e-400c-952e-6e940774e1ef“ (…) }, "fields": { "customUtc": [ "2018-05-11T22:39:28.000Z" ], "installDate": [ "2018-05-09T00:00:00.000Z" ] } }
  • 12. 12 Big Fish Confidential Two Streams APIs o Streams DSL o Abstraction of Processor API o Used for Let’s Dish Dashboards o Streams Processor API o More flexible o Finer control of stream processing
  • 13. 13 Big Fish Confidential Let’s Dish Streaming Transformation Topology
  • 14. 14 Big Fish Confidential Mapping, Filtering and Branching
  • 15. 15 Big Fish Confidential Map Function KeyValueMapper<String, String, <String,GtEvent>> Maps JSON String Value to Game Telemetry Pojo: GtEvent
  • 16. 16 Big Fish Confidential Java 8 Lambda Function Map Function public static KeyValueMapper<String, String, KeyValue<String, GtEvent>> mapStringToGtEvent = (k, v) -> { GtEvent gtEvent; try { gtEvent = new Gson().fromJson(v,GtEvent.class); } catch (Exception e) { gtEvent = new CustomEvent(); } return new KeyValue<String, GtEvent>(k, gtEvent); };
  • 17. 17 Big Fish Confidential Filter Predicates KStreams filter and branch methods take a Predicate interface KStream.filter(Predicate) KStream.branch(Predicate[])
  • 18. 18 Big Fish Confidential Java 8 Lambda Functions Filter Predicates public static Predicate<String, GtEvent> isRecipeComplete = (k, v) -> "recipe_complete".equals( v.data.eventName.toLowerCase()); public static Predicate<String, GtEvent> isSession = (k, v) -> Arrays.asList("session_start", "session_foreground", "session_background", "session_heartbeat") .contains(v.data.eventName.toLowerCase());
  • 19. 19 Big Fish Confidential Map and Filters Combined public static KStream<String, GtEvent>[] createBranchedStreams( KStream<String, String> source) { return source .map(Mappers.mapStringToGtEvent) .branch( FilterPredicates.isRecipeComplete, FilterPredicates.isRecipeBurn, FilterPredicates.isSession, FilterPredicates.isRestaurant); }
  • 20. 20 Big Fish Confidential Four KStreams o Recipe Burn o Recipe Complete o Restaurant Unlocked o Restaurant Names
  • 21. 21 Big Fish Confidential Aggregated Player Purchases Table Enhance KStreams with Hive Table ID FIRST INSTALL DATE BOOKINGS BIN BOOKINGS LAST 30 DAYS CHANNEL TYPE 1 9/12/2018 $1 <= $5 $1 <= $5 paid 2 9/12/2018 $5 <= $20 $5 <= $20 organic 3 9/12/2018 $1 <= $5 $1 <= $5 paid
  • 22. 22 Big Fish Confidential Kafka Topic
  • 23. 23 Big Fish Confidential Joining Streams
  • 24. 24 Big Fish Confidential Types of Joins o Windowed Join (No State) o KStream->KStream o Non-Windowed Joins (State Maintained ) o KStream->KTable o KTable->KTable
  • 25. 25 Big Fish Confidential Using Group By Key Creating a KTable from Kstream .groupByKey(Serialized.with(stringSerde,longSerde)) .reduce((oldValue, newValue) -> Math.max(oldValue, newValue), Materialized.<String, Long, KeyValueStore<Bytes, byte[]>> as("restaurants-unlocked-store") .withKeySerde(stringSerde) .withValueSerde(longSerde));
  • 26. 26 Big Fish Confidential Recipe Burn Stream to Restaurant Unlocked KTable Steps to Joining recipeBurnKStream.leftJoin( restaurantUnlockedKTable, RecipeValueJoiners.joinRecipeToRestaurantUnlocked, Joined.with( stringSerde,enrichedEventSerde,longSerde) );
  • 27. 27 Big Fish Confidential Where are the join conditions? Join Keys KStream<String, EnrichedEvent> recipeBurnKStream Joined with KTable<String, Long> restaurantUnlockedKTable on the Keys.
  • 28. 28 Big Fish Confidential Value Joiner public static ValueJoiner<EnrichedEvent, Long, EnrichedEvent> joinRecipeToRestaurantUnlocked = (e, restaurantsUnlocked) -> { e.enrichedRecipeEvent.restaurantsUnlocked = (restaurantsUnlocked == null) ? -1L : restaurantsUnlocked; return e; };
  • 29. 29 Big Fish Confidential • EnrichedEventSerde • org.apache.kafka.common.serialization interfaces Custom Serialization Joined.with(stringSerde,enrichedEventSerde ,longSerde)
  • 30. 30 Big Fish Confidential Join Recap o Keys are used for joining o KStream<String, EnrichedEvent> o KTable<String, Long> o Value Joiners o Return the number of restaurants unlocked o If null return -1 o Custom Serde for EnrichedEvent
  • 31. 31 Big Fish Confidential Elastic Search Document { "_index": "letsdish-2018-19", "_type": "recipes", "_id": "f4858a61-cf4e-400c- 952e-6e940774e1ef", "_score": 1, "_source": { "count": 1, "restaurantScheduleId": "fr ench", "restaurantsAvailable": 5, "installDate": "2018-05- 09", "bookingsBin": "No Monetization", "bookingsBinLast30": "No Monetization", …
  • 32. 32 Big Fish Confidential Elastic Search Bulk API o Bulk Processing Greatly Increases the Index Speed o Two possible implementations of the Bulk API o Direct calls to the REST service o Elastic Search Libraries o BulkProcessor and RestClientBuilder o Wrap lower level work
  • 33. 33 Big Fish Confidential Continue to Build Real Time Dashboards for Games