SlideShare a Scribd company logo
Serverless Stream Processing
Bill Bejeck
@bbejeck
Nice to meet you!
• Member of the DevX team
• Prior to DevX ~3 years as engineer on Kafka Streams team
• Apache Kafka® Committer and PMC member
• Author of “Kafka Streams in Action” - 2nd edition underway!
2
@bbejeck
Agenda
• Meetup Details
• Serverless Vegetable Soup
• ksqlDB Introduction
• AWS Lambda
• Application walkthrough
3
Meetup Details
@bbejeck
Meetup Details
• Clone GitHub repo for the meetup
• https://github.com/confluentinc/CCloud-Serverless-Integration
• https://docs.confluent.io/confluent-cli/current/install.html
• https://aws.amazon.com/cli/
• Get a Confluent Cloud account
• https://confluent.cloud/signup
• Use code CC60COMM
• AWS account
• https://aws.amazon.com/free/
• Create a root account
5
@bbejeck
Meetup Details
• Kick off the application script
• <repo directory>/ccloud-build-app.sh
6
Serverless Vegetable Soup
@bbejeck
Stateful vs Stateless
• Stateless is simpler
• Predicate.apply(T parameter)
• Idempotent functions
• Can’t make decisions based on previous inputs
• Stateful is more complex
• Aggregations
• Keeps state of previous records
• Can make decisions in near-real time when combined with stream
processing
8
@bbejeck
Stream Processing
• Why do we need it?
• Hotel interactions
• Check-in, mini-bar purchases
• Fraud detection
• No good to look at yesterday's transactions
• Supply chain
• Route a truck in real-time
9
@bbejeck
Stream Processing
• Applications can respond immediately to events
• Context-aware decisions in real-time
• Implies the need for state – hard to make decisions in on isolated events
• State needs to be easy to manage
• Needs to be highly available
10
@bbejeck
Serverless
• Not concerned with infrastructure
• Some one else’s issue! *
• Focus is solely on your business problem
• Simplified development process *
• Only pay for what’s used
• Flexible options driven by needs/requirements
11
@bbejeck
Functions as a Service (FaaS)
• Extension of Serverless (my interpretation)
• Discrete chunk of code vs. an application
• Triggered by specific event – typically not long running
• Scales with load
• Sporadic in nature
• Executes when needed
• Only pay for what’s used
12
ksqlDB Introduction
Compute Storage
CREATE TABLE activePromotions AS
SELECT rideId,
qualifyPromotion(distanceToDst) AS promotion
FROM locations
GROUP BY rideId
EMIT CHANGES
ksqlDB Kafka
Build a complete real-time application
with just a few SQL statements
Easily Build
Real- Time Apps
ksqlDB at a Glance
ksqlDB is a database for building real-
time applications that leverage stream
processing
Joins Aggregates
Push & Pull Queries Filters
User-Defined
Functions
Connectors
@bbejeck
ksqlDB and events
• Enables event-based applications
• Using stateful operations are easily and seamless
15
@bbejeck
ksqlDB Input Data
{
”side": ”BUY",
”quantity": 2000,
”symbol": ”CFLT",
”price": 100,
”account": “Vandeley”,
"userid": 100
}
16
@bbejeck
ksqlDB Create Stream
CREATE STREAM stocktrade (side varchar,
quantity int,
symbol varchar,
price int,
account varchar,
userid int)
WITH (kafka_topic = 'stocktrade’,
partitions = 6,
value_format = ‘JSON’);
17
@bbejeck
ksqlDB Create Table
CREATE Table users (userid varchar primary key,
registertime bigint,
regionid varchar)
WITH (kafka_topic = ‘users’,
value_format = ‘JSON’);
18
@bbejeck
ksqlDB Persistent Query (Push)
CREATE TABLE SHARE_PRICE AS
SELECT symbol,
AVG(price) AS AVERAGE_SHARE_PRICE
FROM stocks
WINDOW TUMBLING (SIZE 5 MINUTES)
GROUP BY symbol
EMIT CHANGES;
19
@bbejeck
ksqlDB Pull Query
SELECT * from SHARE_PRICE
WHERE symbol = 'CFLT'
20
@bbejeck
ksqlDB Availablilty
21
@bbejeck
ksqlDB Failover
22
@bbejeck
ksqlDB Failover
23
AWS Lambda
@bbejeck
AWS Lambda
• Exemplifies FaaS
• Key component of AWS Serverless Application Model
• https://docs.aws.amazon.com/serverless-application-
model/latest/developerguide/what-is-sam.html
• Upload code as a zip file
• Configure the trigger
25
Application
@bbejeck
Application overview
27
@bbejeck
Additional Steps
• Create the AWS Lambda
• Set properties in configs.sh
• View Lambda logs
• Execute SQL for processing Lambda output
• View the Stream Lineage on Confluent
28
@bbejeck
Clean Up
• Important to run the clean up steps outlined in repo
• Remove all AWS components
• Remove all Confluent Cloud
29
@bbejeck
For More Details
• Serverless processing whitepaper
• https://www.confluent.io/resources/white-paper/stateful-serverless-
architectures-with-ksqldb-aws-lambda/
• Blog on serverless stream processing
• https://www.confluent.io/blog/serverless-event-stream-processing/
30
@bbejeck
Resources
• Tutorials and ksqlDB use cases – https://developer.confluent.io/tutorials
• ksqlDB Documentation - https://docs.ksqldb.io/en/latest/
• Confluent Developer - developer.confluent.io
• AWS SAM - https://docs.aws.amazon.com/serverless-application-
model/latest/developerguide/what-is-sam.html
31
Thank you!
@bbejeck
bill@confluent.io
cnfl.io/meetups cnfl.io/slack
cnfl.io/blog
Learn Kafka!
Confluent Developer
developer.confluent.io

More Related Content

Similar to Serverless Stream Processing with Bill Bejeck (20)

PDF
How to Build Streaming Apps with Confluent II
confluent
 
PPTX
Introduction to ksqlDB and stream processing (Vish Srinivasan - Confluent)
KafkaZone
 
PDF
Concepts and Patterns for Streaming Services with Kafka
QAware GmbH
 
PDF
APAC ksqlDB Workshop
confluent
 
PDF
All Streams Ahead! ksqlDB Workshop ANZ
confluent
 
PDF
ksqlDB Workshop
confluent
 
PDF
KSQL - Stream Processing simplified!
Guido Schmutz
 
PDF
Big, Fast, Easy Data: Distributed Stream Processing for Everyone with KSQL, t...
Michael Noll
 
PDF
Real-Time Stream Processing with KSQL and Apache Kafka
confluent
 
PDF
KSQL Intro
confluent
 
PDF
Rethinking Stream Processing with Apache Kafka: Applications vs. Clusters, St...
Michael Noll
 
PDF
Rethinking Stream Processing with Apache Kafka, Kafka Streams and KSQL
Kai Wähner
 
PDF
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
confluent
 
PDF
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
confluent
 
PDF
Building Real-Time Serverless Data Applications With Joseph Morais and Adam W...
HostedbyConfluent
 
PPTX
Apache kafka
Daan Gerits
 
PPTX
Building real-time serverless data applications with Confluent and AWS - Lond...
Ahmed791434
 
PPTX
Building real-time serverless data applications with Confluent and AWS.pptx
Ahmed791434
 
PPTX
Real Time Stream Processing with KSQL and Kafka
David Peterson
 
PDF
Build a Bridge to Cloud with Apache Kafka® for Data Analytics Cloud Services
confluent
 
How to Build Streaming Apps with Confluent II
confluent
 
Introduction to ksqlDB and stream processing (Vish Srinivasan - Confluent)
KafkaZone
 
Concepts and Patterns for Streaming Services with Kafka
QAware GmbH
 
APAC ksqlDB Workshop
confluent
 
All Streams Ahead! ksqlDB Workshop ANZ
confluent
 
ksqlDB Workshop
confluent
 
KSQL - Stream Processing simplified!
Guido Schmutz
 
Big, Fast, Easy Data: Distributed Stream Processing for Everyone with KSQL, t...
Michael Noll
 
Real-Time Stream Processing with KSQL and Apache Kafka
confluent
 
KSQL Intro
confluent
 
Rethinking Stream Processing with Apache Kafka: Applications vs. Clusters, St...
Michael Noll
 
Rethinking Stream Processing with Apache Kafka, Kafka Streams and KSQL
Kai Wähner
 
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
confluent
 
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
confluent
 
Building Real-Time Serverless Data Applications With Joseph Morais and Adam W...
HostedbyConfluent
 
Apache kafka
Daan Gerits
 
Building real-time serverless data applications with Confluent and AWS - Lond...
Ahmed791434
 
Building real-time serverless data applications with Confluent and AWS.pptx
Ahmed791434
 
Real Time Stream Processing with KSQL and Kafka
David Peterson
 
Build a Bridge to Cloud with Apache Kafka® for Data Analytics Cloud Services
confluent
 

More from confluent (20)

PDF
Stream Processing Handson Workshop - Flink SQL Hands-on Workshop (Korean)
confluent
 
PPTX
Webinar Think Right - Shift Left - 19-03-2025.pptx
confluent
 
PDF
Migration, backup and restore made easy using Kannika
confluent
 
PDF
Five Things You Need to Know About Data Streaming in 2025
confluent
 
PDF
Data in Motion Tour Seoul 2024 - Keynote
confluent
 
PDF
Data in Motion Tour Seoul 2024 - Roadmap Demo
confluent
 
PDF
From Stream to Screen: Real-Time Data Streaming to Web Frontends with Conflue...
confluent
 
PDF
Confluent per il settore FSI: Accelerare l'Innovazione con il Data Streaming...
confluent
 
PDF
Data in Motion Tour 2024 Riyadh, Saudi Arabia
confluent
 
PDF
Build a Real-Time Decision Support Application for Financial Market Traders w...
confluent
 
PDF
Strumenti e Strategie di Stream Governance con Confluent Platform
confluent
 
PDF
Compose Gen-AI Apps With Real-Time Data - In Minutes, Not Weeks
confluent
 
PDF
Building Real-Time Gen AI Applications with SingleStore and Confluent
confluent
 
PDF
Unlocking value with event-driven architecture by Confluent
confluent
 
PDF
Il Data Streaming per un’AI real-time di nuova generazione
confluent
 
PDF
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
confluent
 
PDF
Break data silos with real-time connectivity using Confluent Cloud Connectors
confluent
 
PDF
Building API data products on top of your real-time data infrastructure
confluent
 
PDF
Speed Wins: From Kafka to APIs in Minutes
confluent
 
PDF
Evolving Data Governance for the Real-time Streaming and AI Era
confluent
 
Stream Processing Handson Workshop - Flink SQL Hands-on Workshop (Korean)
confluent
 
Webinar Think Right - Shift Left - 19-03-2025.pptx
confluent
 
Migration, backup and restore made easy using Kannika
confluent
 
Five Things You Need to Know About Data Streaming in 2025
confluent
 
Data in Motion Tour Seoul 2024 - Keynote
confluent
 
Data in Motion Tour Seoul 2024 - Roadmap Demo
confluent
 
From Stream to Screen: Real-Time Data Streaming to Web Frontends with Conflue...
confluent
 
Confluent per il settore FSI: Accelerare l'Innovazione con il Data Streaming...
confluent
 
Data in Motion Tour 2024 Riyadh, Saudi Arabia
confluent
 
Build a Real-Time Decision Support Application for Financial Market Traders w...
confluent
 
Strumenti e Strategie di Stream Governance con Confluent Platform
confluent
 
Compose Gen-AI Apps With Real-Time Data - In Minutes, Not Weeks
confluent
 
Building Real-Time Gen AI Applications with SingleStore and Confluent
confluent
 
Unlocking value with event-driven architecture by Confluent
confluent
 
Il Data Streaming per un’AI real-time di nuova generazione
confluent
 
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
confluent
 
Break data silos with real-time connectivity using Confluent Cloud Connectors
confluent
 
Building API data products on top of your real-time data infrastructure
confluent
 
Speed Wins: From Kafka to APIs in Minutes
confluent
 
Evolving Data Governance for the Real-time Streaming and AI Era
confluent
 
Ad

Recently uploaded (20)

PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
July Patch Tuesday
Ivanti
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
July Patch Tuesday
Ivanti
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Ad

Serverless Stream Processing with Bill Bejeck

  • 2. @bbejeck Nice to meet you! • Member of the DevX team • Prior to DevX ~3 years as engineer on Kafka Streams team • Apache Kafka® Committer and PMC member • Author of “Kafka Streams in Action” - 2nd edition underway! 2
  • 3. @bbejeck Agenda • Meetup Details • Serverless Vegetable Soup • ksqlDB Introduction • AWS Lambda • Application walkthrough 3
  • 5. @bbejeck Meetup Details • Clone GitHub repo for the meetup • https://github.com/confluentinc/CCloud-Serverless-Integration • https://docs.confluent.io/confluent-cli/current/install.html • https://aws.amazon.com/cli/ • Get a Confluent Cloud account • https://confluent.cloud/signup • Use code CC60COMM • AWS account • https://aws.amazon.com/free/ • Create a root account 5
  • 6. @bbejeck Meetup Details • Kick off the application script • <repo directory>/ccloud-build-app.sh 6
  • 8. @bbejeck Stateful vs Stateless • Stateless is simpler • Predicate.apply(T parameter) • Idempotent functions • Can’t make decisions based on previous inputs • Stateful is more complex • Aggregations • Keeps state of previous records • Can make decisions in near-real time when combined with stream processing 8
  • 9. @bbejeck Stream Processing • Why do we need it? • Hotel interactions • Check-in, mini-bar purchases • Fraud detection • No good to look at yesterday's transactions • Supply chain • Route a truck in real-time 9
  • 10. @bbejeck Stream Processing • Applications can respond immediately to events • Context-aware decisions in real-time • Implies the need for state – hard to make decisions in on isolated events • State needs to be easy to manage • Needs to be highly available 10
  • 11. @bbejeck Serverless • Not concerned with infrastructure • Some one else’s issue! * • Focus is solely on your business problem • Simplified development process * • Only pay for what’s used • Flexible options driven by needs/requirements 11
  • 12. @bbejeck Functions as a Service (FaaS) • Extension of Serverless (my interpretation) • Discrete chunk of code vs. an application • Triggered by specific event – typically not long running • Scales with load • Sporadic in nature • Executes when needed • Only pay for what’s used 12
  • 14. Compute Storage CREATE TABLE activePromotions AS SELECT rideId, qualifyPromotion(distanceToDst) AS promotion FROM locations GROUP BY rideId EMIT CHANGES ksqlDB Kafka Build a complete real-time application with just a few SQL statements Easily Build Real- Time Apps ksqlDB at a Glance ksqlDB is a database for building real- time applications that leverage stream processing Joins Aggregates Push & Pull Queries Filters User-Defined Functions Connectors
  • 15. @bbejeck ksqlDB and events • Enables event-based applications • Using stateful operations are easily and seamless 15
  • 16. @bbejeck ksqlDB Input Data { ”side": ”BUY", ”quantity": 2000, ”symbol": ”CFLT", ”price": 100, ”account": “Vandeley”, "userid": 100 } 16
  • 17. @bbejeck ksqlDB Create Stream CREATE STREAM stocktrade (side varchar, quantity int, symbol varchar, price int, account varchar, userid int) WITH (kafka_topic = 'stocktrade’, partitions = 6, value_format = ‘JSON’); 17
  • 18. @bbejeck ksqlDB Create Table CREATE Table users (userid varchar primary key, registertime bigint, regionid varchar) WITH (kafka_topic = ‘users’, value_format = ‘JSON’); 18
  • 19. @bbejeck ksqlDB Persistent Query (Push) CREATE TABLE SHARE_PRICE AS SELECT symbol, AVG(price) AS AVERAGE_SHARE_PRICE FROM stocks WINDOW TUMBLING (SIZE 5 MINUTES) GROUP BY symbol EMIT CHANGES; 19
  • 20. @bbejeck ksqlDB Pull Query SELECT * from SHARE_PRICE WHERE symbol = 'CFLT' 20
  • 25. @bbejeck AWS Lambda • Exemplifies FaaS • Key component of AWS Serverless Application Model • https://docs.aws.amazon.com/serverless-application- model/latest/developerguide/what-is-sam.html • Upload code as a zip file • Configure the trigger 25
  • 28. @bbejeck Additional Steps • Create the AWS Lambda • Set properties in configs.sh • View Lambda logs • Execute SQL for processing Lambda output • View the Stream Lineage on Confluent 28
  • 29. @bbejeck Clean Up • Important to run the clean up steps outlined in repo • Remove all AWS components • Remove all Confluent Cloud 29
  • 30. @bbejeck For More Details • Serverless processing whitepaper • https://www.confluent.io/resources/white-paper/stateful-serverless- architectures-with-ksqldb-aws-lambda/ • Blog on serverless stream processing • https://www.confluent.io/blog/serverless-event-stream-processing/ 30
  • 31. @bbejeck Resources • Tutorials and ksqlDB use cases – https://developer.confluent.io/tutorials • ksqlDB Documentation - https://docs.ksqldb.io/en/latest/ • Confluent Developer - developer.confluent.io • AWS SAM - https://docs.aws.amazon.com/serverless-application- model/latest/developerguide/what-is-sam.html 31