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

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


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

Martin Kleppmann

October 16, 2014

More Decks by Martin Kleppmann

Other Decks in Programming


  1. None
  2. None
  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  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. None
  13. None
  14. None
  15. None
  16. None
  17. None
  18. None
  19. None
  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. None
  22. None
  23. None
  24. None
  25. None
  26. None
  27. None
  28. {    eventType:    ProfileEditEvent,    3mestamp:    1413215518,  

     profileId:      1234,    old:  {      loca3on:    "San  Francisco,  CA",      industry:    "Internet"},    new:  {      loca3on:    "New  York,  NY",      industry:    "Financial  Services"}   }  
  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. None
  36. None
  37. None
  38. None
  39. None
  40. None
  41. None
  42. None
  43. None
  44. None
  45. None
  46. None
  47. None
  48. None
  49. None
  50. None
  51. None
  52. None
  53. None
  54. None
  55. None
  56. None
  57. None
  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. None
  65. None
  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. None