Building real-time data products at LinkedIn with Apache Samza

Building real-time data products at LinkedIn with Apache Samza

Presented at Strata+Hadoop World, New York, 16 October 2014 http://strataconf.com/stratany2014/public/schedule/detail/36045

Video: https://www.youtube.com/watch?v=yO3SBU6vVKA&list=PLeKd45zvjcDHJxge6VtYUAbYnvd_VNQCx

Abstract:

The world is going real-time. MapReduce, SQL-on-Hadoop and similar batch processing tools are fine for analyzing and processing data after the fact — but sometimes you need to process data continuously as it comes in, and react to it within a few seconds or less. How do you do that at Hadoop scale?

Apache Samza is an open source stream processing framework designed to solve these kinds of problems. It is built upon YARN/Hadoop 2.0 and Apache Kafka. You can think of Samza as a real-time, continuously running version of MapReduce.

Samza has some unique features that make it powerful. It provides high performance for stateful processing jobs, including aggregation and joins between many input streams. It is designed to support an ecosystem of many different jobs written by different teams, and it isolates them from each other, so that one badly behaved job can’t affect the others.

At LinkedIn, we have been using Samza in production for some time, both for internal analytics purposes and for data products that are served on the live site. In this talk, we’ll discuss our experience of working with Samza. You’ll learn about:

- What kinds of real-time data problems you can solve with Samza
- How Samza reliably scales to millions of messages per second
- How Samza compares to other stream processing frameworks
- How Samza can help collaboration between different data science, product, and engineering teams within an organization
- How to avoid implementing the same data pipeline twice (once for offline/batch processing and once for real-time/stream processing)
- Lessons we learnt on how to structure real-time data pipelines for scale and flexibility

0d4ef9af8e4f0cf5c162b48ba24faea6?s=128

Martin Kleppmann

October 16, 2014
Tweet

Transcript

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.

    {    eventType:    PageViewEvent,    3mestamp:    1413215518,  

     viewerId:      1234,    sessionId:    fa1afe101234deadbeef,    pageKey:      profile-­‐view,    viewedProfileId:  4321,    trackingKey:    invita3on-­‐email,    ...  etc.  metadata  about  what  content  was  displayed...   }  
  12. 12.
  13. 13.
  14. 14.
  15. 15.
  16. 16.
  17. 17.
  18. 18.
  19. 19.
  20. 20.

    {    eventType:    PageViewEvent,    3mestamp:    1413215518,  

     viewerId:      1234,    sessionId:    fa1afe101234deadbeef,    pageKey:      profile-­‐view,    viewedProfileId:  4321,    trackingKey:    invita3on-­‐email,    ...  etc.  metadata  about  what  content  was  displayed...   }  
  21. 21.
  22. 22.
  23. 23.
  24. 24.
  25. 25.
  26. 26.
  27. 27.
  28. 28.

    {    eventType:    ProfileEditEvent,    3mestamp:    1413215518,  

     profileId:      1234,    old:  {      loca3on:    "San  Francisco,  CA",      industry:    "Internet"},    new:  {      loca3on:    "New  York,  NY",      industry:    "Financial  Services"}   }  
  29. 29.
  30. 30.
  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.
  44. 44.
  45. 45.
  46. 46.
  47. 47.
  48. 48.
  49. 49.
  50. 50.
  51. 51.
  52. 52.
  53. 53.
  54. 54.
  55. 55.
  56. 56.
  57. 57.
  58. 58.
  59. 59.
  60. 60.
  61. 61.
  62. 62.
  63. 63.
  64. 64.
  65. 65.
  66. 66.

    References (fun stuff to read) 1.  Martin Kleppmann: “Designing data-intensive

    applications.” O’Reilly Media, to appear in 2015. http://dataintensive.net 2.  Jay Kreps: “Why local state is a fundamental primitive in stream processing.” 31 July 2014. http://radar.oreilly.com/2014/07/why-local- state-is-a-fundamental-primitive-in-stream-processing.html 3.  Jay Kreps: “I ♥︎ Logs.” O'Reilly Media, September 2014. http://shop.oreilly.com/product/0636920034339.do 4.  Nathan Marz and James Warren: “Big Data: Principles and best practices of scalable realtime data systems.” Manning MEAP, to appear January 2015. http://manning.com/marz/ 5.  Jakob Homan: “Real time insights into LinkedIn's performance using Apache Samza.” 18 Aug 2014. http://engineering.linkedin.com/samza/ real-time-insights-linkedins-performance-using-apache-samza 6.  Martin Kleppmann: “Moving faster with data streams: The rise of Samza at LinkedIn.” 14 July 2014. http://engineering.linkedin.com/stream- processing/moving-faster-data-streams-rise-samza-linkedin 7.  Praveen Neppalli Naga: “Real-time Analytics at Massive Scale with Pinot.” 29 Sept 2014. http://engineering.linkedin.com/analytics/real- time-analytics-massive-scale-pinot 8.  David He: “Monitor and Improve Web Performance Using RUM Data Visualization.” 19 Sept 2014. http://engineering.linkedin.com/ performance/monitor-and-improve-web-performance-using-rum-data-visualization 9.  Lili Wu, Sam Shah, Sean Choi, Mitul Tiwari, and Christian Posse: “The Browsemaps: Collaborative Filtering at LinkedIn,” at 6th Workshop on Recommender Systems and the Social Web, Oct 2014. http://ls13-www.cs.uni-dortmund.de/homepage/rsweb2014/papers/ rsweb2014_submission_3.pdf 10.  Shirshanka Das, Chavdar Botev, Kapil Surlaker, et al.: “All Aboard the Databus!,” at ACM Symposium on Cloud Computing (SoCC), October 2012. http://www.socc2012.org/s18-das.pdf 11.  Apache Samza documentation. http://samza.incubator.apache.org
  67. 67.