Upgrade to Pro — share decks privately, control downloads, hide ads and more …

In progress v1

benstopford
March 02, 2016
37

In progress v1

benstopford

March 02, 2016
Tweet

Transcript

  1. Event Driven Architecture Services listen for interesting events, do something

    useful, announce their results, the process continues
  2. Even when services fail Trades Buys Sells Fail! Broker We

    retain ordering, but we have to detect & reprovision Instance 1 Instance 2
  3. 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
  4. Each consuming service is assigned a “personal set” of queues

    each little queue is sent to only one consumer in a group
  5. • Strong partition-based ordering • Scalable data retention • Scalable

    multiprocessing • Always on • Dynamic Consumer Rebalancing
  6. Retain data in “table-like” compacted streams Older K1 K1 K1

    K2 K2 K2 K1 V1 V1 V2 V3 V2 V4 V3 K1 V4 K2 V3 Log file Exchange Rates Exchange Rates Keep all versions of key Only keep latest key Just a simple journal Compacted Stream
  7. Exchange Rate Service Exchange Rate Service USD/GBP = 0.71 EUR/GBP

    = 0.77 USD/INR = 67.7 USD/AUD = 1.38 EUR/JPY = 114.41 …
  8. 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
  9. Max(price) From orders where ccy=‘GBP’ over 1 day window emitting

    every second What is stream processing? continuous queries.
  10. What is stream processing engine? Data Index Query Engine Query

    Engine vs Database Finite, well defined source Stream Processor Infinite, poorly defined source
  11. Buying Lunch Abroad Payments Service Exchange Rates Service Buy Notification

    Service Amount in ££ $$ $$ Text Message: ££ $$
  12. Buying Lunch Abroad Payments Exchange Rates • filter(ccy<>’GBP’) • join

    on ccy • Calculate payment in GBP • Send text message
  13. Streams & Compacted Streams Payments Exchange Rates Looks like a

    table (compacted stream) Looks like an infinite stream
  14. Idempotent Topics Idempotent Topic write many times (against key) emit

    only once one part of a wider, and ongoing, ‘Exactly Once’ effort
  15. There is much more to stream processing it is grounded

    in the world of big-data analytics
  16. Sure, you can collect it all copy copy copy copy

    copy copy copy ETL ETL ETL ETL ETL ETL