SlideShare a Scribd company logo
1 of 25
Seamless Guest Experience with Kafka Streams
Ram IndukuriHimani Arora Suresh Mulukaladu
About Knoldus
Technology consulting firm with focus on digital transformation
Functional. Reactive. Cloud Native
We are global cruise vacation company that controls and operates four global
brands. Royal Caribbean International, Azamara club, Celebrity cruises and
Silversea Cruises.We are also 50% joint venture owner of German brand TUI
Cruises and 49% owner of the spanish brand Pullmantur Cruceros.
About Royal Caribbean International
Royal Caribbean International - Facts
● World’s second largest global cruise line
● Represents more than 20% of global cruisers
● 9.5 billion in revenues (2018)
● Serving more than 5 Million guests every year around the globe
● 60 ships in service and another 14 ships on the way
● Oasis class(World’s largest) ships carry close to 6000 guests and 2000
crew
Guest Journey - touchpoints
Discover Book
Cruise
Excursions Check In Board Ship Cruise Take
Excursions
Debark Create
Memories
● Research vacation options
● Book the cruise & air reservations
● Plan and Book activities on the cruise
● Complete online check-in and get boarding pass
● Pre cruise activities
● Get to the embarkation port
● Check-in to the cruise and board
● Get to your state room
● Book dinner reservations and activities
● Enjoy the cruise and activities
● Excursions at ports of call
● Debarkation
● Post cruise activities
● Fly back
● Get home
Excalibur
Digital Vision
Discover Book Cruise Pre Cruise
Planning
Check In Board Ship Cruise Take
Excursions
Debark Create
Memories
Sensor
Wearable
TV
API Layer
Device Layer
One App
Architectural Challenges
1
How to Standardize Footprints
on all ships and shore ?
3
How do guests have seamless
experience on ship(s) and
shore if we rely on batch
process ?
2
How do we build on what we
have today ?
Same infrastructure on
ship/shore
API and Microservices Event driven Architecture with real time
synchronization
Ship-Shore Highway - Event enabling Fleet
System of
Record
System of
Record
Ship Shore Highway
Event enablement, transmission, processing & Analytics across fleet
SoR Ship-Shore Pattern
API Gateway
Micro Service
Data Store
System of
Record
Data Store
System of
Record
Micro Service
Change data Capture - Using Kafka Connect
Web
Call Center
Travel Agent
SQL
Mirror
Kafka
Connect
Kafka
Shore
Reservation
SOR
AWS
Data Transformer
Kafka Ship
Broadcasting events - Using Streams
Web
Call Center
Travel Agent
IIDR
Business Events &
Change Data
Reservation
SOR
AWS
Kafka
Streams
Kafka
Generating Business Events by Combining Topics
Booking ID(pk)
Guest ID
Guest ID(pk)
Name
Address
State Store
State Store
JOIN
Guest ID
Booking ID
Name
Address
Generating Business Events by Combining Topics
StreamsBuilder builder = new StreamsBuilder();
KStream<String, BookingDetails> guestBookings = builder.stream(guestBookingTopic)
.selectKey((key, value) -> value.getGuestId());
KStream<String, GuestDetails> guestDetails = builder.stream(guestDetailsTopic);
KStream<String, GuestBookingDetails> guestBookingAndDetails = guestBookings
.join(guestDetails,
(guestBooking, guestDetail) -> /* business event message */,
JoinWindows.of(Duration.ofHours(10));
Guest Bookings Stream
Guest Details Stream
Transparent Handling of Late Arrival Records
SLIDING
WINDOW
JoinWindows.of(Duration.ofHours(10))
Late
Arriving
Record
Event 1Event 2
Event 1Event 2
Event 12
Event 13
Event 13
Event 14
Event 14
Event 15
Transparent Handling of Late Arrival Records
Guest Bookings Stream
Guest Details Stream
SLIDING
WINDOW
Grace Period set to:
JoinWindows.of(Duration.ofHours(10)).grace(Duration.ofHours(24)))
Event 1Event 2
Event 1Event 2
Event 12
Event 13
Event 13
Event 14
Event 14
Event 15
Transparent Handling of Late Arrival Records
StreamsBuilder builder = new StreamsBuilder();
KStream<String, BookingDetails> guestBookings = builder.stream(guestBookingTopic)
.selectKey((key, value) -> value.getGuestId());
KStream<String, GuestDetails> guestDetails = builder.stream(guestDetailsTopic);
KStream<String, GuestBookingDetails> guestBookingAndDetails = guestBookings
.join(guestDetails,
(guestBooking, guestDetail) -> /* business event message */,
JoinWindows.of(Duration.ofHours(10)
.grace(Duration.ofHours(24))
);
Consecutive Joins on Multiple Topics
Booking ID
Guest ID
Guest ID
Name
Address
State Store
State Store
JOIN
Guest ID
Purchase ID
Intermediate
State Store
Consecutive Joins on Multiple Topics
Booking ID
Guest ID
Guest ID
Name
Address
State Store
State Store
JOIN
Guest ID
Purchase ID
Intermedia
te Store
State Store
JOIN
Guest ID
Booking ID
Purchase ID
Name
Address
Transparent Handling of Late Arrival Records
StreamsBuilder builder = new StreamsBuilder();
KStream<String, BookingDetails> guestBookings = builder.stream(guestBookingTopic)
.selectKey((key, value) -> value.getGuestId());
KStream<String, PurchaseDetails> guestPurchases = builder.stream(guestPurchasesTopic);
.selectKey((key, value) -> value.getGuestId());
KStream<String, GuestDetails> guestDetails = builder.stream(guestDetailsTopic);
KStream<String, GuestBookingDetails> guestBookingAndDetails = guestBookings
.join(guestDetails,
(guestBooking, guestDetail) -> /* business event message with booking id and
guest details */,
JoinWindows.of(Duration.ofHours(10)
.join(guestPurchases,
(guestBookingDetail,guestPurchase) -> /* business event message with guest
details, booking and purchase details*/,
JoinWindows.of(Duration.ofHours(10)));
Ensuring Streaming reliability - Graphite/Grafana
Kafka
Stream
App
JMX
Graphite Grafana
● Consumer Lag to detect surges
● Idle time threshold to predict Thread health
● Bytes Received in last window indicating Kafka broker issues
Lack of activity indicate either
broker failure or app failure
Ensuring Data Quality - Apache Spark
Apache Spark Apache Spark
Minio incremental
Mirroring
1
2
3
4 5
Next Steps - Interactive Queries
Instance 1
Instance 2
Instance 3
GUEST API
Local Kafka
State Store
Local Kafka
State Store
Local Kafka
State Store
host1:4047
host2:5047
host3:4460
Exposing RPC endpoint and
information about its local
state store
Kafka Cluster
Summary
● Real time guest information synchronization across ship and
shore was possible with kafka, connect and replicators
● Kafka streams and IIDR helped to reduce the latency in
processing the CDC
● Isolate critical connectors into their own connect cluster to
reduce risk
● Order guarantee is easier to achieve with streams than
connectors.
● Invest in domain driven design
● Include legacy dependencies in critical path for planning
feature delivery.
More Information
Ram Indukuri ram@knoldus.com
Himani Arora himani@knoldus.com
Suresh Mulukuladu smulukuladu@rccl.com
For more information
Blog: https://blog.knoldus.com/join-semantics-kafka-streams/
Git Samples: https://github.com/knoldus/

More Related Content

What's hot

Serving the Real-Time Data Needs of an Airport with Kafka Streams and KSQL
Serving the Real-Time Data Needs of an Airport with Kafka Streams and KSQL Serving the Real-Time Data Needs of an Airport with Kafka Streams and KSQL
Serving the Real-Time Data Needs of an Airport with Kafka Streams and KSQL
confluent
 

What's hot (20)

Kafka Streams State Stores Being Persistent
Kafka Streams State Stores Being PersistentKafka Streams State Stores Being Persistent
Kafka Streams State Stores Being Persistent
 
Lead confluent HQ Dec 2019
Lead   confluent HQ Dec 2019Lead   confluent HQ Dec 2019
Lead confluent HQ Dec 2019
 
Real time data processing and model inferncing platform with Kafka streams (N...
Real time data processing and model inferncing platform with Kafka streams (N...Real time data processing and model inferncing platform with Kafka streams (N...
Real time data processing and model inferncing platform with Kafka streams (N...
 
Leveraging Data in Motion | Jun Rao, Co-Founder, Confluent | Kafka Summit APA...
Leveraging Data in Motion | Jun Rao, Co-Founder, Confluent | Kafka Summit APA...Leveraging Data in Motion | Jun Rao, Co-Founder, Confluent | Kafka Summit APA...
Leveraging Data in Motion | Jun Rao, Co-Founder, Confluent | Kafka Summit APA...
 
Apache Kafka for Cybersecurity and SIEM / SOAR Modernization
Apache Kafka for Cybersecurity and SIEM / SOAR ModernizationApache Kafka for Cybersecurity and SIEM / SOAR Modernization
Apache Kafka for Cybersecurity and SIEM / SOAR Modernization
 
Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019
Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019
Kafka as an Event Store (Guido Schmutz, Trivadis) Kafka Summit NYC 2019
 
Battle-tested event-driven patterns for your microservices architecture - Sca...
Battle-tested event-driven patterns for your microservices architecture - Sca...Battle-tested event-driven patterns for your microservices architecture - Sca...
Battle-tested event-driven patterns for your microservices architecture - Sca...
 
Event-Driven Microservices with Apache Kafka, Kafka Streams and KSQL
Event-Driven Microservices with Apache Kafka, Kafka Streams and KSQLEvent-Driven Microservices with Apache Kafka, Kafka Streams and KSQL
Event-Driven Microservices with Apache Kafka, Kafka Streams and KSQL
 
Kafka and event driven architecture -apacoug20
Kafka and event driven architecture -apacoug20Kafka and event driven architecture -apacoug20
Kafka and event driven architecture -apacoug20
 
Event-Streaming verstehen in unter 10 Min
Event-Streaming verstehen in unter 10 MinEvent-Streaming verstehen in unter 10 Min
Event-Streaming verstehen in unter 10 Min
 
Battle-tested event-driven patterns for your microservices architecture - Sca...
Battle-tested event-driven patterns for your microservices architecture - Sca...Battle-tested event-driven patterns for your microservices architecture - Sca...
Battle-tested event-driven patterns for your microservices architecture - Sca...
 
Check Out our Rich Python Portfolio: Leaders in Python & Django‎
Check Out our Rich Python Portfolio: Leaders in Python & Django‎Check Out our Rich Python Portfolio: Leaders in Python & Django‎
Check Out our Rich Python Portfolio: Leaders in Python & Django‎
 
Core Banking System on Apache Kafka
Core Banking System on Apache KafkaCore Banking System on Apache Kafka
Core Banking System on Apache Kafka
 
Confluent Cloud for Apache Kafka® | Google Cloud Next ’19
Confluent Cloud for Apache Kafka® | Google Cloud Next ’19Confluent Cloud for Apache Kafka® | Google Cloud Next ’19
Confluent Cloud for Apache Kafka® | Google Cloud Next ’19
 
Real time analytics in Azure IoT
Real time analytics in Azure IoT Real time analytics in Azure IoT
Real time analytics in Azure IoT
 
Kai Waehner [Confluent] | Real-Time Streaming Analytics with 100,000 Cars Usi...
Kai Waehner [Confluent] | Real-Time Streaming Analytics with 100,000 Cars Usi...Kai Waehner [Confluent] | Real-Time Streaming Analytics with 100,000 Cars Usi...
Kai Waehner [Confluent] | Real-Time Streaming Analytics with 100,000 Cars Usi...
 
Serving the Real-Time Data Needs of an Airport with Kafka Streams and KSQL
Serving the Real-Time Data Needs of an Airport with Kafka Streams and KSQL Serving the Real-Time Data Needs of an Airport with Kafka Streams and KSQL
Serving the Real-Time Data Needs of an Airport with Kafka Streams and KSQL
 
Building event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka EcosystemBuilding event-driven Microservices with Kafka Ecosystem
Building event-driven Microservices with Kafka Ecosystem
 
Apache Kafka and Blockchain - Comparison and a Kafka-native Implementation
Apache Kafka and Blockchain - Comparison and a Kafka-native ImplementationApache Kafka and Blockchain - Comparison and a Kafka-native Implementation
Apache Kafka and Blockchain - Comparison and a Kafka-native Implementation
 
Event-Driven Architectures Done Right | Tim Berglund, Confluent
Event-Driven Architectures Done Right | Tim Berglund, ConfluentEvent-Driven Architectures Done Right | Tim Berglund, Confluent
Event-Driven Architectures Done Right | Tim Berglund, Confluent
 

Similar to Seamless Guest Experience with Kafka Streams

Seamless Guest Experience with Kafka Streams (Ramaraju Indukurir and Himani A...
Seamless Guest Experience with Kafka Streams (Ramaraju Indukurir and Himani A...Seamless Guest Experience with Kafka Streams (Ramaraju Indukurir and Himani A...
Seamless Guest Experience with Kafka Streams (Ramaraju Indukurir and Himani A...
confluent
 
NDC London 2017 - The Data Dichotomy- Rethinking Data and Services with Streams
NDC London 2017  - The Data Dichotomy- Rethinking Data and Services with StreamsNDC London 2017  - The Data Dichotomy- Rethinking Data and Services with Streams
NDC London 2017 - The Data Dichotomy- Rethinking Data and Services with Streams
Ben Stopford
 

Similar to Seamless Guest Experience with Kafka Streams (20)

Seamless Guest Experience with Kafka Streams (Ramaraju Indukurir and Himani A...
Seamless Guest Experience with Kafka Streams (Ramaraju Indukurir and Himani A...Seamless Guest Experience with Kafka Streams (Ramaraju Indukurir and Himani A...
Seamless Guest Experience with Kafka Streams (Ramaraju Indukurir and Himani A...
 
Kafka as an Event Store - is it Good Enough?
Kafka as an Event Store - is it Good Enough?Kafka as an Event Store - is it Good Enough?
Kafka as an Event Store - is it Good Enough?
 
SVCC Developing Asynchronous, Message-Driven Microservices
SVCC Developing Asynchronous, Message-Driven Microservices  SVCC Developing Asynchronous, Message-Driven Microservices
SVCC Developing Asynchronous, Message-Driven Microservices
 
Kafka as an event store - is it good enough?
Kafka as an event store - is it good enough?Kafka as an event store - is it good enough?
Kafka as an event store - is it good enough?
 
Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)Microservices in Java and Scala (sfscala)
Microservices in Java and Scala (sfscala)
 
NDC London 2017 - The Data Dichotomy- Rethinking Data and Services with Streams
NDC London 2017  - The Data Dichotomy- Rethinking Data and Services with StreamsNDC London 2017  - The Data Dichotomy- Rethinking Data and Services with Streams
NDC London 2017 - The Data Dichotomy- Rethinking Data and Services with Streams
 
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQL
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQLBuilding a Real-time Streaming ETL Framework Using ksqlDB and NoSQL
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQL
 
Advanced RingCentral API Use Cases
Advanced RingCentral API Use CasesAdvanced RingCentral API Use Cases
Advanced RingCentral API Use Cases
 
Building microservices with Scala, functional domain models and Spring Boot (...
Building microservices with Scala, functional domain models and Spring Boot (...Building microservices with Scala, functional domain models and Spring Boot (...
Building microservices with Scala, functional domain models and Spring Boot (...
 
RBea: Scalable Real-Time Analytics at King
RBea: Scalable Real-Time Analytics at KingRBea: Scalable Real-Time Analytics at King
RBea: Scalable Real-Time Analytics at King
 
Gyula Fóra - RBEA- Scalable Real-Time Analytics at King
Gyula Fóra - RBEA- Scalable Real-Time Analytics at KingGyula Fóra - RBEA- Scalable Real-Time Analytics at King
Gyula Fóra - RBEA- Scalable Real-Time Analytics at King
 
Powering Consistent, High-throughput, Real-time Distributed Calculation Engin...
Powering Consistent, High-throughput, Real-time Distributed Calculation Engin...Powering Consistent, High-throughput, Real-time Distributed Calculation Engin...
Powering Consistent, High-throughput, Real-time Distributed Calculation Engin...
 
Event streaming webinar feb 2020
Event streaming webinar feb 2020Event streaming webinar feb 2020
Event streaming webinar feb 2020
 
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
Building and deploying microservices with event sourcing, CQRS and Docker (Me...Building and deploying microservices with event sourcing, CQRS and Docker (Me...
Building and deploying microservices with event sourcing, CQRS and Docker (Me...
 
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...Building and deploying microservices with event sourcing, CQRS and Docker (QC...
Building and deploying microservices with event sourcing, CQRS and Docker (QC...
 
Introduction to WSO2 Data Analytics Platform
Introduction to  WSO2 Data Analytics PlatformIntroduction to  WSO2 Data Analytics Platform
Introduction to WSO2 Data Analytics Platform
 
LJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java DevelopersLJC Conference 2014 Cassandra for Java Developers
LJC Conference 2014 Cassandra for Java Developers
 
PayPal Real Time Analytics
PayPal  Real Time AnalyticsPayPal  Real Time Analytics
PayPal Real Time Analytics
 
Mucon: Not Just Events: Developing Asynchronous Microservices
Mucon: Not Just Events: Developing Asynchronous MicroservicesMucon: Not Just Events: Developing Asynchronous Microservices
Mucon: Not Just Events: Developing Asynchronous Microservices
 
YOW2018 - Events and Commands: Developing Asynchronous Microservices
YOW2018 - Events and Commands: Developing Asynchronous MicroservicesYOW2018 - Events and Commands: Developing Asynchronous Microservices
YOW2018 - Events and Commands: Developing Asynchronous Microservices
 

More from Knoldus Inc.

More from Knoldus Inc. (20)

Stakeholder Management (Project Management) Presentation
Stakeholder Management (Project Management) PresentationStakeholder Management (Project Management) Presentation
Stakeholder Management (Project Management) Presentation
 
Introduction To Kaniko (DevOps) Presentation
Introduction To Kaniko (DevOps) PresentationIntroduction To Kaniko (DevOps) Presentation
Introduction To Kaniko (DevOps) Presentation
 
Efficient Test Environments with Infrastructure as Code (IaC)
Efficient Test Environments with Infrastructure as Code (IaC)Efficient Test Environments with Infrastructure as Code (IaC)
Efficient Test Environments with Infrastructure as Code (IaC)
 
Exploring Terramate DevOps (Presentation)
Exploring Terramate DevOps (Presentation)Exploring Terramate DevOps (Presentation)
Exploring Terramate DevOps (Presentation)
 
Clean Code in Test Automation Differentiating Between the Good and the Bad
Clean Code in Test Automation  Differentiating Between the Good and the BadClean Code in Test Automation  Differentiating Between the Good and the Bad
Clean Code in Test Automation Differentiating Between the Good and the Bad
 
Integrating AI Capabilities in Test Automation
Integrating AI Capabilities in Test AutomationIntegrating AI Capabilities in Test Automation
Integrating AI Capabilities in Test Automation
 
State Management with NGXS in Angular.pptx
State Management with NGXS in Angular.pptxState Management with NGXS in Angular.pptx
State Management with NGXS in Angular.pptx
 
Authentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptxAuthentication in Svelte using cookies.pptx
Authentication in Svelte using cookies.pptx
 
OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)OAuth2 Implementation Presentation (Java)
OAuth2 Implementation Presentation (Java)
 
Supply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptxSupply chain security with Kubeclarity.pptx
Supply chain security with Kubeclarity.pptx
 
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML ParsingMastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
Mastering Web Scraping with JSoup Unlocking the Secrets of HTML Parsing
 
Akka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On IntroductionAkka gRPC Essentials A Hands-On Introduction
Akka gRPC Essentials A Hands-On Introduction
 
Entity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptxEntity Core with Core Microservices.pptx
Entity Core with Core Microservices.pptx
 
Introduction to Redis and its features.pptx
Introduction to Redis and its features.pptxIntroduction to Redis and its features.pptx
Introduction to Redis and its features.pptx
 
GraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdfGraphQL with .NET Core Microservices.pdf
GraphQL with .NET Core Microservices.pdf
 
NuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptxNuGet Packages Presentation (DoT NeT).pptx
NuGet Packages Presentation (DoT NeT).pptx
 
Data Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable TestingData Quality in Test Automation Navigating the Path to Reliable Testing
Data Quality in Test Automation Navigating the Path to Reliable Testing
 
K8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose KubernetesK8sGPTThe AI​ way to diagnose Kubernetes
K8sGPTThe AI​ way to diagnose Kubernetes
 
Introduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptxIntroduction to Circle Ci Presentation.pptx
Introduction to Circle Ci Presentation.pptx
 
Robusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptxRobusta -Tool Presentation (DevOps).pptx
Robusta -Tool Presentation (DevOps).pptx
 

Recently uploaded

Recently uploaded (20)

10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 

Seamless Guest Experience with Kafka Streams

  • 1. Seamless Guest Experience with Kafka Streams Ram IndukuriHimani Arora Suresh Mulukaladu
  • 2. About Knoldus Technology consulting firm with focus on digital transformation Functional. Reactive. Cloud Native
  • 3. We are global cruise vacation company that controls and operates four global brands. Royal Caribbean International, Azamara club, Celebrity cruises and Silversea Cruises.We are also 50% joint venture owner of German brand TUI Cruises and 49% owner of the spanish brand Pullmantur Cruceros. About Royal Caribbean International
  • 4. Royal Caribbean International - Facts ● World’s second largest global cruise line ● Represents more than 20% of global cruisers ● 9.5 billion in revenues (2018) ● Serving more than 5 Million guests every year around the globe ● 60 ships in service and another 14 ships on the way ● Oasis class(World’s largest) ships carry close to 6000 guests and 2000 crew
  • 5. Guest Journey - touchpoints Discover Book Cruise Excursions Check In Board Ship Cruise Take Excursions Debark Create Memories ● Research vacation options ● Book the cruise & air reservations ● Plan and Book activities on the cruise ● Complete online check-in and get boarding pass ● Pre cruise activities ● Get to the embarkation port ● Check-in to the cruise and board ● Get to your state room ● Book dinner reservations and activities ● Enjoy the cruise and activities ● Excursions at ports of call ● Debarkation ● Post cruise activities ● Fly back ● Get home
  • 7. Digital Vision Discover Book Cruise Pre Cruise Planning Check In Board Ship Cruise Take Excursions Debark Create Memories Sensor Wearable TV API Layer Device Layer One App
  • 8. Architectural Challenges 1 How to Standardize Footprints on all ships and shore ? 3 How do guests have seamless experience on ship(s) and shore if we rely on batch process ? 2 How do we build on what we have today ? Same infrastructure on ship/shore API and Microservices Event driven Architecture with real time synchronization
  • 9. Ship-Shore Highway - Event enabling Fleet System of Record System of Record Ship Shore Highway Event enablement, transmission, processing & Analytics across fleet
  • 10. SoR Ship-Shore Pattern API Gateway Micro Service Data Store System of Record Data Store System of Record Micro Service
  • 11. Change data Capture - Using Kafka Connect Web Call Center Travel Agent SQL Mirror Kafka Connect Kafka Shore Reservation SOR AWS Data Transformer Kafka Ship
  • 12. Broadcasting events - Using Streams Web Call Center Travel Agent IIDR Business Events & Change Data Reservation SOR AWS Kafka Streams Kafka
  • 13. Generating Business Events by Combining Topics Booking ID(pk) Guest ID Guest ID(pk) Name Address State Store State Store JOIN Guest ID Booking ID Name Address
  • 14. Generating Business Events by Combining Topics StreamsBuilder builder = new StreamsBuilder(); KStream<String, BookingDetails> guestBookings = builder.stream(guestBookingTopic) .selectKey((key, value) -> value.getGuestId()); KStream<String, GuestDetails> guestDetails = builder.stream(guestDetailsTopic); KStream<String, GuestBookingDetails> guestBookingAndDetails = guestBookings .join(guestDetails, (guestBooking, guestDetail) -> /* business event message */, JoinWindows.of(Duration.ofHours(10));
  • 15. Guest Bookings Stream Guest Details Stream Transparent Handling of Late Arrival Records SLIDING WINDOW JoinWindows.of(Duration.ofHours(10)) Late Arriving Record Event 1Event 2 Event 1Event 2 Event 12 Event 13 Event 13 Event 14 Event 14 Event 15
  • 16. Transparent Handling of Late Arrival Records Guest Bookings Stream Guest Details Stream SLIDING WINDOW Grace Period set to: JoinWindows.of(Duration.ofHours(10)).grace(Duration.ofHours(24))) Event 1Event 2 Event 1Event 2 Event 12 Event 13 Event 13 Event 14 Event 14 Event 15
  • 17. Transparent Handling of Late Arrival Records StreamsBuilder builder = new StreamsBuilder(); KStream<String, BookingDetails> guestBookings = builder.stream(guestBookingTopic) .selectKey((key, value) -> value.getGuestId()); KStream<String, GuestDetails> guestDetails = builder.stream(guestDetailsTopic); KStream<String, GuestBookingDetails> guestBookingAndDetails = guestBookings .join(guestDetails, (guestBooking, guestDetail) -> /* business event message */, JoinWindows.of(Duration.ofHours(10) .grace(Duration.ofHours(24)) );
  • 18. Consecutive Joins on Multiple Topics Booking ID Guest ID Guest ID Name Address State Store State Store JOIN Guest ID Purchase ID Intermediate State Store
  • 19. Consecutive Joins on Multiple Topics Booking ID Guest ID Guest ID Name Address State Store State Store JOIN Guest ID Purchase ID Intermedia te Store State Store JOIN Guest ID Booking ID Purchase ID Name Address
  • 20. Transparent Handling of Late Arrival Records StreamsBuilder builder = new StreamsBuilder(); KStream<String, BookingDetails> guestBookings = builder.stream(guestBookingTopic) .selectKey((key, value) -> value.getGuestId()); KStream<String, PurchaseDetails> guestPurchases = builder.stream(guestPurchasesTopic); .selectKey((key, value) -> value.getGuestId()); KStream<String, GuestDetails> guestDetails = builder.stream(guestDetailsTopic); KStream<String, GuestBookingDetails> guestBookingAndDetails = guestBookings .join(guestDetails, (guestBooking, guestDetail) -> /* business event message with booking id and guest details */, JoinWindows.of(Duration.ofHours(10) .join(guestPurchases, (guestBookingDetail,guestPurchase) -> /* business event message with guest details, booking and purchase details*/, JoinWindows.of(Duration.ofHours(10)));
  • 21. Ensuring Streaming reliability - Graphite/Grafana Kafka Stream App JMX Graphite Grafana ● Consumer Lag to detect surges ● Idle time threshold to predict Thread health ● Bytes Received in last window indicating Kafka broker issues Lack of activity indicate either broker failure or app failure
  • 22. Ensuring Data Quality - Apache Spark Apache Spark Apache Spark Minio incremental Mirroring 1 2 3 4 5
  • 23. Next Steps - Interactive Queries Instance 1 Instance 2 Instance 3 GUEST API Local Kafka State Store Local Kafka State Store Local Kafka State Store host1:4047 host2:5047 host3:4460 Exposing RPC endpoint and information about its local state store Kafka Cluster
  • 24. Summary ● Real time guest information synchronization across ship and shore was possible with kafka, connect and replicators ● Kafka streams and IIDR helped to reduce the latency in processing the CDC ● Isolate critical connectors into their own connect cluster to reduce risk ● Order guarantee is easier to achieve with streams than connectors. ● Invest in domain driven design ● Include legacy dependencies in critical path for planning feature delivery.
  • 25. More Information Ram Indukuri ram@knoldus.com Himani Arora himani@knoldus.com Suresh Mulukuladu smulukuladu@rccl.com For more information Blog: https://blog.knoldus.com/join-semantics-kafka-streams/ Git Samples: https://github.com/knoldus/