$30 off During Our Annual Pro Sale. View Details »

Rethinking Stream Processing with Apache Kafka: Applications vs. Clusters, Streams vs. Databases - Dublin Apache Kafka Meetup 04 July 2017

Rethinking Stream Processing with Apache Kafka: Applications vs. Clusters, Streams vs. Databases - Dublin Apache Kafka Meetup 04 July 2017

My talk at Apache Kafka meetup, Dublin/Ireland, July 04, 2017.

https://www.meetup.com/Dublin-Apache-Kafka-Meetup-by-Confluent/events/240906790/

Abstract:
Modern businesses have data at their core, but this data is changing continuously. How can you harness this torrent of information in real time? The answer: stream processing.

The core platform for streaming data is Apache Kafka, and thousands of companies are using Kafka to transform and reshape their industries, including Netflix, Uber, PayPal, Airbnb, Goldman Sachs, Cisco, and Oracle. Unfortunately, today’s common architectures for real-time data processing at scale suffer from complexity: to succeed, many technologies need to be stitched and operated together, and each individual technology is often complex by itself. This has led to a strong discrepancy between how we engineers would like to work and how we actually end up working in practice.

Michael Noll explains how Apache Kafka helps you radically simplify your data processing architectures by building normal applications to serve your real-time processing needs rather than building clusters or similar special-purpose infrastructure—while still benefiting from properties typically associated exclusively with cluster technologies, like high scalability, distributed computing, and fault tolerance. Michael also covers Kafka’s Streams API, its abstractions for streams and tables, and its recently introduced interactive queries functionality. Along the way, Michael shares common use cases that demonstrate that stream processing in practice often requires database-like functionality and how Kafka allows you to bridge the worlds of streams and databases when implementing your own core business applications (for example, in the form of event-driven, containerized microservices). As you’ll see, Kafka makes such architectures equally viable for small-, medium-, and large-scale use cases.

Michael G. Noll

July 04, 2017
Tweet

More Decks by Michael G. Noll

Other Decks in Programming

Transcript

  1. 1 Rethinking Stream Processing with Apache Kafka: Applications vs. Clusters,

    Streams vs. Databases An introduction to Kafka’s Streams API by Michael G. Noll, Product Manager michael@confluent.io @miguno
  2. 2 0.11 Exactly-once semantics 0.10 Data processing (Streams API) 0.9

    Data integration (Connect API) Intra-cluster replication 0.8 2012 2014 2015 2016 2017 Cluster mirroring 0.7 2013 Apache Kafka: birthed as a messaging system, now a streaming platform
  3. 3

  4. 4

  5. 5

  6. 6

  7. 7

  8. 8

  9. 9 ,

  10. 10

  11. 11

  12. 12

  13. 13

  14. 14 (Does NOT run inside the Kafka brokers!)

  15. 15 (Does NOT run inside the Kafka brokers!)

  16. 16

  17. 17

  18. 18 http://docs.confluent.io/current/cp-docker-images/docs/tutorials/kafka-streams-examples.html

  19. 19

  20. 20 Before

  21. 21 Before With Kafka’s Streams API

  22. 22 KStream<Integer, Integer> input = builder.stream("numbers-topic"); // Stateless computation KStream<Integer,

    Integer> doubled = input.mapValues(v -> v * 2); // Stateful computation KTable<Integer, Integer> sumOfOdds = input .filter((k,v) -> v % 2 != 0) .selectKey((k, v) -> 1) .groupByKey() .reduce((v1, v2) -> v1 + v2, "sum-of-odds"); class PrintToConsoleProcessor implements Processor<K, V> { @Override public void init(ProcessorContext context) {} @Override void process(K key, V value) { System.out.println("Got value " + value); } @Override void punctuate(long timestamp) {} @Override void close() {} }
  23. 23

  24. 24 Linux Windows

  25. 25

  26. 26

  27. 27

  28. 28

  29. 29

  30. 30 http://www.confluent.io/blog/introducing-kafka-streams-stream-processing-made-simple https://kafka.apache.org/documentation/streams#streams_duality

  31. 31

  32. 32

  33. 33

  34. 34

  35. 35

  36. 36

  37. 37

  38. 38

  39. 39

  40. 40

  41. 41

  42. 42

  43. 43 …and many more…

  44. 44 …and many more…

  45. 45

  46. 46

  47. 47 2016 2017 First release of Kafka’s Streams API (0.10.0.0)

    today Kafka Streams API in the wild Kafka 0.10.2.1 In production at LINE Corp., Japan 220+ million active users, processing millions of msg/s “Applying Kafka Streams for internal message delivery pipeline” https://engineering.linecorp.com/en/blog/detail/80
  48. 48

  49. 49 Supported since Apache Kafka 0.11 (June 2017)

  50. 50

  51. 51

  52. 52

  53. 53

  54. 54

  55. 55

  56. 56

  57. 57

  58. 58 …and more…

  59. 59

  60. 60 $ curl -sXGET http://localhost:7070/kafka-music/charts/top-five [ { "artist": "Subhumans", "album":

    "Live In A Dive", "name": "All Gone Dead", "plays": 126 }, { "artist": "Wheres The Pope?", "album": "PSI", "name": "Fear Of God", "plays": 115 }, ... ]
  61. 61

  62. 62

  63. 63

  64. 64 https://kafka.apache.org/documentation/streams http://docs.confluent.io/current/streams/ https://www.confluent.io/downloads/