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
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
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
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