Processing over a trillion events a day CASE STUDIES IN SCALING STREAM PROCESSING AT LINKEDIN

Similar documents
Introduction to Stream Processing

Apache Kafka. A distributed publish-subscribe messaging system. Neha Narkhede, 11/11/11

Stateful Services on DC/OS. Santa Clara, California April 23th 25th, 2018

Introducing Amazon Kinesis Managed Service for Real-time Big Data Processing

Why an Open Architecture Is Vital to Security Operations

Keys to Planning Your Microsoft Dynamics SL 2018 Upgrade. Session 512 Kevin Kueny

Integrating MATLAB Analytics into Enterprise Applications The MathWorks, Inc. 1

Intro to Big Data and Hadoop

How In-Memory Computing can Maximize the Performance of Modern Payments

da Platform Stream processing for real-time businesses powered by Apache Flink

Scaling up MATLAB Analytics with Kafka and Cloud Services

2015 The MathWorks, Inc. 1

Scaling up MATLAB Analytics with Kafka and Cloud Services

MapR: Converged Data Pla3orm and Quick Start Solu;ons. Robin Fong Regional Director South East Asia

Cask Data Application Platform (CDAP)

Real-time Streaming Applications on AWS Patterns and Use Cases

Building event-driven Microservices with Kafka Ecosystem

WELCOME TO. Cloud Data Services: The Art of the Possible

Kaseya Traverse Unified Cloud, Network, Server & Application Monitoring

EXECUTIVE BRIEF. Successful Data Warehouse Approaches to Meet Today s Analytics Demands. In this Paper

Virtualizing Big Data/Hadoop Workloads. Update for vsphere 6. Justin Murray VMware VMware Inc. All rights reserved.

Active Analytics Overview

Ampliando MATLAB Analytics con Kafka y Servicios en la Nube

Kx Data Refinery. An Introduction

5th Annual. Cloudera, Inc. All rights reserved.

Berkeley Data Analytics Stack (BDAS) Overview

What s new on Azure? Jan Willem Groenenberg

New Big Data Solutions and Opportunities for DB Workloads

Hortonworks Connected Data Platforms

Killing pigs and saving Danish bacon GOTO Zurich Zurich, Switzerland 11th April Thursday, 11 April 13

Microsoft Azure Essentials

DOWNTIME IS NOT AN OPTION

Processing and Analyzing Streams. CDRs in Real Time

Enterprise-Scale MATLAB Applications

Real-time IoT Big Data-in-Motion Analytics Case Study: Managing Millions of Devices at Country-Scale

Varibill Implementation Plan On-Premise

Deep Learning Acceleration with MATRIX: A Technical White Paper

DELL EMC XTREMIO X2: NEXT-GENERATION ALL-FLASH ARRAY

BIG DATA PROCESSING A DEEP DIVE IN HADOOP/SPARK & AZURE SQL DW

Spark, Hadoop, and Friends

Architecting for Real- Time Big Data Analytics. Robert Winters

Databricks Cloud. A Primer

Datametica. The Modern Data Platform Enterprise Data Hub Implementations. Why is workload moving to Cloud

MapR Pentaho Business Solutions

FLINK IN ZALANDO S WORLD OF MICROSERVICES JAVIER LOPEZ MIHAIL VIERU

Designing and Deploying Internet-Scale Services

Azure Part 2 - Cloud Agility with ZVR. Mike Nelson, Cloud Architect Shannon Snowden, Sr. Technical Architect

AMD and Cloudera : Big Data Analytics for On-Premise, Cloud and Hybrid Deployments

SCALE CLOUD SCALE. Sławomir Skowron BaseCRM

Social Media Analytics Using Greenplum s Data Computing Appliance

BIG DATA AND HADOOP DEVELOPER

Top 10 Compelling Reasons to Adopt Microsoft SharePoint 2013

Spark and Hadoop Perfect Together

20775A: Performing Data Engineering on Microsoft HD Insight


What s New in Microsoft Dynamics CRM 4.0. Bryan Nielson Director, Product Marketing

Real-time Streaming Insight & Time Series Data Analytic For Smart Retail

IBM Spectrum Scale. Advanced storage management of unstructured data for cloud, big data, analytics, objects and more. Highlights

Amsterdam. (technical) Updates & demonstration. Robert Voermans Governance architect

INTRODUCTION AUX APPLICATIONS CLOUD NATIVE AVEC PIVOTAL READY SYSTEM

Introduction to Big Data(Hadoop) Eco-System The Modern Data Platform for Innovation and Business Transformation

Bluemix Overview. Last Updated: October 10th, 2017

Apache Mesos. Delivering mixed batch & real-time data infrastructure , Galway, Ireland

20775: Performing Data Engineering on Microsoft HD Insight

Chat Module Feature List

BACSOFT IOT PLATFORM: A COMPLETE SOLUTION FOR ADVANCED IOT AND M2M APPLICATIONS

What Do You Need to Ensure a Successful Transition to IoT?

HADOOP SOLUTION USING EMC ISILON AND CLOUDERA ENTERPRISE Efficient, Flexible In-Place Hadoop Analytics

CTI planning. CTI Server

On Cloud Computational Models and the Heterogeneity Challenge

ORACLE COMMUNICATIONS SELFRELIANT

Complex Event Processing: Power your middleware with StreamInsight. Mahesh Patel (Microsoft) Amit Bansal (PeoplewareIndia.com)

Building a Data Lake with Spark and Cassandra Brendon Smith & Mayur Ladwa

<Insert Picture Here> Oracle Exalogic Elastic Cloud: Revolutionizing the Datacenter

20775A: Performing Data Engineering on Microsoft HD Insight

Oracle Communications Billing and Revenue Management Elastic Charging Engine Performance. Oracle VM Server for SPARC

IBM Message Hub. James Bennett Offering Manager, IBM Cloud Integration IBM Corporation

Building a Multi-Tenant Infrastructure for Diverse Application Workloads

Got Hadoop? Whitepaper: Hadoop and EXASOL - a perfect combination for processing, storing and analyzing big data volumes

MQ on Cloud (AWS) Suganya Rane Digital Automation, Integration & Cloud Solutions. MQ Technical Conference v

The Sysprog s Guide to the Customer Facing Mainframe: Cloud / Mobile / Social / Big Data

Our Success Stories 1

20775 Performing Data Engineering on Microsoft HD Insight

Building Real-time and Responsive Applications on Azure. Girish Phadke & Maneesha Marathe Tata Consultancy Services Ltd.

Redefine Big Data: EMC Data Lake in Action. Andrea Prosperi Systems Engineer

Hadoop fundamentals. Big Data Consulting. Robert Gibbon

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Business is being transformed by three trends

Triage: Balancing Energy and Quality of Service in a Microserver

Big Data Cloud. Simple, Secure, Integrated and Performant Big Data Platform for the Cloud

Kaseya Traverse Predictive SLA Management and Monitoring

Oracle's Cloud Strategie für den Geschäftserfolg Alles Neue von der OOW

Outline of Hadoop. Background, Core Services, and Components. David Schwab Synchronic Analytics Nov.

Data Center Operating System (DCOS) IBM Platform Solutions

Accelerating Your Big Data Analytics. Jeff Healey, Director Product Marketing, HPE Vertica

Deep Learning Acceleration with

Copyright 2018 Dell Inc.

Course 20535A: Architecting Microsoft Azure Solutions

IBM Data Management Services Softek Replicator UNIX technical overview Data protection with replication for increased availability

Transcription:

Processing over a trillion events a day CASE STUDIES IN SCALING STREAM PROCESSING AT LINKEDIN

Processing over a trillion events a day CASE STUDIES IN SCALING STREAM PROCESSING AT LINKEDIN Jagadish Venkatraman Sr. Software Engineer, LinkedIn Apache Samza committer jagadish@apache.org

1 Stream processing scenarios Today s Agenda 2 Hard problems in stream processing 3 Case Study 1: LinkedIn s communications platform 4 Case Study 2: Activity tracking in the News feed

Data processing latencies 0 millis Response latency Synchronous Later. Possibly much later.

Data processing latencies 0 millis Response latency Milliseconds to minutes Synchronous Later. Possibly much later.

Some stream processing scenarios at LinkedIn Security Real-time DDoS protection for members

Some stream processing scenarios at LinkedIn Security Notifications Real-time DDoS protection for members Notifications to members

Some stream processing scenarios at LinkedIn Security Notifications News classification Real-time DDoS protection for members Notifications to members Real-time topic tagging of articles

Some stream processing scenarios at LinkedIn Security Notifications News Performance classification monitoring Real-time DDoS protection for members Notifications to members Real-time topic tagging of articles Real-time site-speed profiling by facets

Some stream processing scenarios at LinkedIn Security Notifications News Performance Call-graph classification monitoring computation Real-time DDoS protection for members Notifications to members Real-time topic tagging of articles Real-time site-speed profiling by facets Analysis of service calls

Some stream processing scenarios at LinkedIn Ad relevance Tracking ads that were clicked

Some stream processing scenarios at LinkedIn Ad relevance Aggregates Tracking ads that were clicked Aggregated, realtime counts by dimensions

Some stream processing scenarios at LinkedIn Ad relevance Aggregates View-port tracking Tracking ads that were clicked Aggregated, realtime counts by dimensions Tracking session duration

Some stream processing scenarios at LinkedIn Ad relevance Aggregates View-port Profile. tracking standardization Tracking ads that were clicked Aggregated, realtime counts by dimensions Tracking session duration Standardizing titles, gender, education

AND MANY MORE SCENARIOS IN PRODUCTION 200+ Applications

AND MANY MORE SCENARIOS IN PRODUCTION 200+ Applications Powered By

A distributed stream processing framework 2012: Development at LinkedIn Used at Netflix, Uber, Tripadvisor and several large Samza overview companies. 2013: Apache incubator 2015 (Jan): Apache Top Level Project

1 Stream processing scenarios Today s agenda 2 Hard problems in stream processing 3 Case Study 1: LinkedIn s communications platform 4 Case Study 2: Activity tracking in the news feed

Hard problems in stream processing Scaling processing State management High performance Heterogeneous remote I/O deployment models Partitioned streams Distribute processing among all workers Hardware failures are inevitable Efficient check-pointing Instant recovery Need primitives for supporting remote I/O Running on a multi-tenant cluster Running as an embedded library Unified API for batch and real-time data

Partitioned processing model Hadoop Hadoop Kafka Kafka Samza application Serving stores DB change capture Elastic Search

Partitioned processing model Samza application Hadoop Container-1 Task-1 Each task processes one or more Task-2 partitions Kafka Container-2 Task-3 The Samza master assigns partitions to tasks and monitors container liveness Heartbeat Scaling by increasing # of containers DB change capture Samza master

Hard problems in stream processing Partitioned State Management Efficient remote data Heterogeneous processing access deployment models Partitioned streams Distribute processing among all workers Hardware failures are inevitable Instant recovery Efficient Check-pointing Provides primitives for supporting efficient remote I/O. Samza supports running on a multi-tenant cluster Samza can also run as a light-weight embedded library Unified API for batch and streaming

Why local state matters? Stateless versus Stateful operations Use cases of Local state Temporary data storage Adjunct data lookups Advantages Richer access patterns, faster than remote state

Architecture for Temporary data Querying the remote DB from your app versus local embedded DB access Samza VERSUS Samza Samza provides an embedded faulttolerant, persistent database.

Architecture for Adjunct lookups Samza Querying the remote DB from your app versus change capture from Samza VERSUS database. Turn remote I/O to local I/O Bootstrap streams

Architecture for Adjunct lookups Samza VERSUS Samza Querying the remote DB from your app versus change capture from database. Bootstrap and partition the remote DB from the stream 100X Faster 1.1M TPS

Key optimizations for scaling local state Container-1 Task-1 Changelog 1. Fault tolerant, replicated into Kafka. 2. Ability to catch up from arbitrary point in the log. Container-2 Task-2 3. State restore from Kafka during host failures

Speed thrills but can also KILL.

Key optimizations for scaling local state Incremental state check-pointing Container-1 Task-1 1. Re-use on-disk state snapshot (host affinity) 2. Write on-disk file on host at Container-2 Task-2 checkpoint 3. Catch-up on only delta from the Kafka change-log Heartbeat Samza master Durable task host mapping

Key optimizations for scaling local state Incremental state check-pointing Container-1 Task-1 1. Re-use on-disk state snapshot (host affinity) 2. Write on-disk file on host at Container-2 Task-2 checkpoint 3. Catch-up on only delta from the Kafka change-log Heartbeat Samza master Durable task host mapping 1.2TB State 60X Faster than full checkpointing 0 Downtime during restarts and recovery

Key optimizations for scaling local state Container-1 Task-1 Drawbacks of local state 1. Size is bounded 2. Some data is not partitionable Container-2 Task-2 3. Repartitioning the stream messes up local state Heartbeat 4. Not useful for serving results Samza master Durable task host mapping

Hard problems in stream processing Scaling processing State management High performance Heterogeneous remote I/O deployment models Partitioned streams Distribute processing among all workers Hardware failures are inevitable Efficient check-pointing Instant recovery Need primitives for supporting remote I/O Running on a multi-tenant cluster Running as an embedded library Unified API for batch and real-time data

Why remote I/O matters? 1. Writing to a remote data store (eg: CouchDB) for serving 2. Some data is available only in the remote store or through REST 3. Invoking down-stream services from your processor

Scaling remote I/O Samza Hard problems 1. Parallelism need not be tied to number of partitions 2. Complexity of programming model 3. Application has to worry about synchronization and check-pointing

Scaling remote I/O Samza Hard problems How we solved them? 1. Parallelism need not be tied to number of partitions 2. Complexity of programming model 1. Support out-of-order processing within a partition 2. Simple callback-based async API. Built-in support for both multithreading and async processing 3. Application has to worry about synchronization and check-pointing 3. Samza handles checkpointing internally

Performance results Samza Experiment setup PageViewEvent topic - 10 partitions For each event, remote lookup of the member s inbox information (latency: 1ms to 200ms) Single node Yarn cluster, 1 container (1 CPU core), 1GB memory.

Performance results Samza Experiment setup PageViewEvent topic - 10 partitions For each event, remote lookup of the member s inbox information (latency: 1ms to 200ms) 10X Faster With In-order processing 40X Faster Out-of-order processing Single node Yarn cluster, 1 container (1 CPU core), 1GB memory. At our scale this is HUGE!

Hard problems in stream processing Scaling processing State management High performance Heterogeneous remote I/O deployment models Partitioned streams Distribute processing among all workers Hardware failures are inevitable Efficient checkpointing Need primitives for supporting remote I/O Running on a multi-tenant cluster Running as an embedded library Instant recovery Unified API for batch and real-time data

Samza - Write once, Run anywhere NEW public interface StreamTask { void process(incomingmessageenvelope envelope, MessageCollector collector, TaskCoordinator coordinator) { // process message } } public class MyApp implements StreamApplication { void init(streamgraph streamgraph, Config config) { MessageStream<PageView> pageviews =..; pageviews.filter(mykeyfn).map(pageview -> new ProjectedPageView()).window(Windows.keyedTumblingWindow(keyFn, Duration.ofSeconds(30)).sink(outputTopic); } }

Heterogeneity Different deployment models Samza on multi-tenant clusters Samza as a light-weight library Uses Yarn for coordination, liveness monitoring Better resource sharing Scale by increasing the number of containers Purely embedded library: No Yarn dependency Use zoo-keeper for coordination, liveness and partition distribution Seamless auto-scale by increasing the number of instances EXACT SAME CODE StreamApplication app = new MyApp(); ApplicationRunner localrunner = ApplicationRunner.getLocalRunner(config); localrunner.runapplication(app);

Heterogeneity Support streaming and batch jobs Samza on Hadoop Samza on streaming Supports re-processing and experimentation Process data on hadoop instead of copying over to Kafka ($$) World-class support for streaming inputs Job automatically shuts-down when end-ofstream is reached EXACT SAME CODE

1 Stream processing scenarios Today s agenda 2 Hard problems in stream processing 3 Case Study 1: LinkedIn s communications platform 4 Case Study 2: Activity tracking in the news feed 5 Conclusion

ATC GOAL: Craft a clear, consistent conversation between our members and their professional world

Features Channel selection Don t blast me on all channels Route through Inmail, email or notification in app

Features Channel selection Aggregation / Capping Don t blast me on all channels Route through Inmail, email or notification in app Don t flood me, Consolidate if you have too much to say! Here s a weekly summary of who invited you to connect

Features Channel selection Aggregation / Capping Delivery time optimization Don t blast me on all channels Route through Inmail, email or notification in app Don t flood me, Consolidate if you have too much to say! Here s a weekly summary of who invited you to connect Send me when I will engage and don t buzz me at 2AM

Features Channel selection Aggregation / Capping Delivery time optimization Filter Don t blast me on all channels Route through Inmail, email or notification in app Don t flood me, Consolidate if you have too much to say! Here s a weekly summary of who invited you to connect Send me when I will engage and don t buzz me at 2AM Filter out spam, duplicates, stuff I have seen or know about

Why Apache Samza? Requirements How Samza fits in? 1. Samza partitions streams and provides 1. Highly Scalable and distributed 2. Multiple sources of email 3. Fault tolerant state (notifications to be scheduled later) 4. Efficient remote calls to several services fault-tolerant processing 2. Pluggable connector API (Kafka, Hadoop, change capture) 3. Instant recovery and incremental checkpointing 4. Async I/O support

Why Apache Samza? Requirements 1. Highly Scalable and distributed 2. Multiple stream joins 3. Fault tolerant state (notifications to be scheduled later) 4. Efficient remote calls to several services

ATC Architecture ATC Email Service Relevance Scores from Offline processing Container-1 Task-1 Task-2 User events / Feed Activity/ Network Activity Container-2 Task-3 Notifications Service DB change capture of User Profiles Social graph

Inside each ATC Task Channel selector Aggregator Scheduler Delivery time optimizer Filter

1 Stream Processing Scenarios Today s agenda 2 Hard Problems in Stream Processing 3 Case Study 1: LinkedIn s communications platform 4 Case Study 2: Activity tracking in the news feed

Activity tracking in News feed HOW WE USE SAMZA TO IMPROVE YOUR NEWS FEED..

ACTIVITY TRACKING: GOAL Power relevant, fresh content for the LinkedIn Feed

Server-side tracking event Feed Server

Server-side tracking event Feed Server

Server-side tracking event { paginationid : feedupdates : [{ updateurn : update1 Feed Server trackingid : position : creationtime : numlikes : numcomments : comments : [ { commentid : } ] }, { updateurn : update2 trackingid :.. Rich payload }

Client-side tracking event

Client-side tracking event Track user activity in the app Fire timer during a scroll or a viewport change

Client-side tracking event feedimpression : { urn : trackingid : duration : height : }, { urn : trackingid : },] Light pay load Bandwidth friendly Battery friendly

Join client-side event with server-side event FEED_SERVED : { FEED_IMPRESSION : { trackingid : abc duration : 100 height : 50 }, { trackingid : },] paginationid : feedupdates : [{ updateurn : update1 trackingid : abc position : creationtime : numlikes : numcomments : comments : [ { commentid : } ] }, { updateurn : update2 trackingid : def creationtime :

Samza Joins client-side event with server-side event JOINED_EVENT :{ FEED_IMPRESSION : { trackingid : abc duration : 100 height : 50 }, { trackingid : },] FEED_SERVED : { paginationid : feedupdates : [{ updateurn : update1 trackingid : abc position : creationtime : numlikes : numcomments : comments : [ { commentid : } paginationid : feedupdates : [{ updateurn : update1 trackingid : abc duration : 100 height : 50 position : creationtime : numlikes : numcomments : comments : [ ] }, { ] { commentid : } updateurn : update2 } trackingid : def } creationtime :

Architecture CLIENT EVENT FEED JOINER Container-1 Task-1 Feed Server Container-2 Task-2 To Downstream Ranking Systems SERVER EVENT 1.2 Billion Processed per-day 90 Containers Distributed, Partitioned

1 Stream processing scenarios Recap 2 Hard problems in stream processing 3 Case Study 1: LinkedIn s communications platform 4 Case Study 2: Activity tracking in the news feed

Recap SUMMARY OF WHAT WE LEARNT IN THIS TALK

Key differentiators for Apache Samza

Key differentiators for Apache Samza Stream Processing both as a multi-tenant service and a light-weight embedded library No micro batching (first class streaming) Unified processing of batch and streaming data Efficient remote calls I/O using built-in async mode World-class support for scalable local state Incremental check-pointing Instant restore with zero down-time Low level API and Stream based high level API (DSL)

Coming soon Event time, and out of order arrival handling Beam API integration SQL on streams

Powered by STABLE, MATURE STREAM PROCESSING FRAMEWORK 200+ Applications at LinkedIn

Q & A + http://samza.apache.org