Even when services fail
Trades
Buys
Sells
Fail!
Broker
We retain ordering, but we have to detect & reprovision
Instance 1
Instance 2
Slide 37
Slide 37 text
Filters don’t scale well
Lots of consumers
=> Lots of filters
Slow consumers
Broker
=> Queues are Databases*
*Queues Are Databases - Jim Gray 1995
=> Lots of indexes
=> Random disk access
Option1: Request Response
rate for USD/GBP?
0.71
Exchange
Rate
Service
Slide 65
Slide 65 text
Option 2: Publish Subscribe
Exchange
Rate
Service
Accumulate current state
ETL
Slide 66
Slide 66 text
Option 3: Accumulate in
Compacted Stream
Exchange
Rate
Service
Publish all rate events
Broker keeps latest version
of exchange rates in a compacted stream
Get all exchange
rates
New exchange rates
Slide 67
Slide 67 text
Service Backbone
Scalable, Fault Tolerant, Concurrent, Strongly Ordered
Slide 68
Slide 68 text
… adding in stream
processing
Slide 69
Slide 69 text
Max(price)
From orders
where ccy=‘GBP’
over 1 day window
emitting every second
What is stream processing?
continuous queries.
Slide 70
Slide 70 text
What is stream processing
engine?
Data
Index
Query
Engine
Query
Engine
vs
Database
Finite, well defined source
Stream Processor
Infinite, poorly defined source
Slide 71
Slide 71 text
Windowing
For unordered or unpredictable streams
Sliding
Fixed
Slide 72
Slide 72 text
Features: similar to
database query engine
Join
Filter
Aggr-
egate
View
Window
Slide 73
Slide 73 text
Tables & Streams
stream
Compacted
stream
Join
Streaming Data
Stored Data
KStream
KTable
Slide 74
Slide 74 text
A little example…
Slide 75
Slide 75 text
Buying Lunch Abroad
Payments
Service
Exchange
Rates
Service
Buy
Notification
Service
Amount in ££
$$
$$
Text Message: ££
$$
Slide 76
Slide 76 text
ETL Option
Payments
Service
Exchange
Rates
Service
Buy
Amount in ££
ETL
ETL
Join etc
Slide 77
Slide 77 text
Request-Response Option
Payments
Service
Exchange
Rates
Service
Buy
Amount in ££
Join etc
Slide 78
Slide 78 text
Stream Processor Option
Payments
Service
Exchange
Rates
Service
Buy
Stream
Processor
join
etc
Slide 79
Slide 79 text
Buying Lunch Abroad
Payments
Exchange
Rates
• filter(ccy<>’GBP’)
• join on ccy
• Calculate payment
in GBP
• Send text message
Slide 80
Slide 80 text
Streams & Compacted Streams
Payments
Exchange
Rates
Looks like
a table
(compacted
stream)
Looks like
an infinite
stream
Slide 81
Slide 81 text
In Process DB
Topic
Compacted
Topic
Slide 82
Slide 82 text
Backed by the broker
Topic
Compacted
Topic
Slide 83
Slide 83 text
Scales Out (MPP)
Slide 84
Slide 84 text
These tools are pretty
handy
for managing disconnected services