+ All Categories
Home > Documents > Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... ·...

Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... ·...

Date post: 23-Aug-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
37
Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special guest Brian McCallister)
Transcript
Page 1: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Event Streams at Groupon Storm, Mesos and Griddle

AJ & Erik Weathers

(with special guest Brian McCallister)

Page 2: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Storm

Page 3: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Spout PBolt A

Bolt X

Bolt B

Page 4: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

@Override public void execute(final Tuple tuple) { Span span = (Span) tuple.getValueByField("span");

Trace trace = cache.getUnchecked(span.trace_id); trace.addSpan(span);

collector.emit(new Values(trace.getId(), trace)); }

Page 5: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Spout PBolt A

Bolt X

Bolt B

Page 6: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Supervisor

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

ServerNimbus Supervisor

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

SupervisorServer

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

Page 7: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Spout PBolt A

Bolt X

Bolt B

Page 8: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

SupervisorServer

WorkerExecutor

Spout P

Executor

Bolt A

Executor

Bolt A

Executor

Bolt X

Executor

Spout P

Executor

Bolt X

SupervisorServer

WorkerExecutor

Bolt X

Executor

Bolt B

Executor

Bolt B

Executor

Bolt X

Executor

Spout P

Executor

Bolt ASpout P

Spout P Spout P

Bolt A

Bolt A

Bolt A

Bolt X

Bolt X Bolt X

Bolt X

Bolt B

Bolt B

Page 9: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Storm on Mesos

Page 10: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Mesos

Page 11: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Supervisor

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

ServerNimbus Supervisor

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

SupervisorServer

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

WorkerExecutor

Task

Executor

Task

Executor

Task

Executor

Task

Page 12: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Worker Host

Supervisor = Mesos Executor

Worker = Mesos Task

Storm Executor

Terminology Clarity

Storm Task

Page 13: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Storm Mesos Framework

• Bridges Storm & Mesos • Implements interfaces from each

• Storm’s INimbus • Mesos’s Executor and Scheduler

• Storm nimbus & supervisor daemons run within the Framework processes

Page 14: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Resource Model: Storm

• Worker Slots • {host, port} • CPU, Mem ?? • static set of Slots in

native Storm

Page 15: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Resource Model: Mesos

• Schedulers receive Offers of CPU, Mem, etc.

• Executors • Launch Tasks

Page 16: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Worker Host

Supervisor

WorkerTopo A

WorkerTopo B

WorkerTopo C

Worker Host

Supervisor

WorkerTopo AWorker

Topo C

Supervisor

Supervisor

WorkerTopo B

WorkerTopo C

WorkerTopo C

Native Storm Storm on Mesos

More Supervisors

Page 17: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

nimbus core

MesosNimbusClass

Mesos

getAvailableSlots

resourceOffers

OO

OOOO

mes

os S

ched

uler

stor

m IN

imbu

sS2S1

S2 = TpWpS1 = TnWn

assignSlotslaunchTasks

MesosNimbus process

Calculates Assignments

MesosNimbus

Page 18: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Groupon Storm-as-a-Service• Mesos cluster dedicated to Storm

• Submitter application for gatekeeping

• Rsync Nimbus local state

• Logging library for sending to Splunk & Kafka

• Metrics library for sending to Monitoring

• implements Storm’s IMetricsConsumer interface

Page 19: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Pros vs. Native Storm• isolation for multi-tenancy

• Storm's isolation scheduler is static

• flexibility for number & size of worker processes

• avoid a bunch of separate under-utilized clusters

• team acts as centralized resource for Storm usage and debugging

• consistent operational visibility

Page 20: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special
Page 21: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Griddle

Page 22: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

• DSP-like workflow • Adjacency Graph

Syntax • Mechanical Sympathy

Page 23: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Website

OOB

Postcode Phone NumberGeocodeCountry

Code

Page 24: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Website

OOB

Postcode

Phone Number

Country Code

Conditional

Post Condition

Conditional End

Geocode

Page 25: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Active Edge Chooser

Website

OOB

Postcode

Country Code

Conditional

Post Condition

Geocode

Conditional End

Phone Number

Page 26: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

class_alias TRIGGER com.groupon.griddle.lib.Trigger# other aliases elided

# Let's get startedvertex start of COUNTRY_CODE_INFERRER

# Vertices active only for certain countriesvertex begin_country_dependent of TRIGGERvertex geocoder of GEOCODERvertex website of WEBSITE_NORMALIZERvertex postcode of POSTCODE_NORMALIZERvertex end_country_dependent of TRIGGER aggregates_inputs

# Signal end of conditional processingvertex country_dependence_done of TRIGGER

# Active for all countriesvertex oo_business of OUT_OF_BUSINESS# Depends on country which can be mutated by geocodervertex phone_number of PHONE_NUM_NORMALIZER aggregates_inputs

# If country deactivated, start will emit to {oo_business, country_dependence_done}# else will emit to {begin_country_dependent, oo_business}emit_to {oo_business, begin_country_dependent, country_dependence_done} from start with_chooser ACTIVE_EDGE_CHOOSER

# Country dependent adjacenciesemit_to {postcode, website} from begin_country_dependentemit_to {geocoder} from postcodeemit_to {end_country_dependent} from geocoderemit_to {end_country_dependent} from websiteemit_to {country_dependence_done} from end_country_dependent

# phone number normalizer due to aggregates_inputs will act as post# deactive branch joining vertexemit_to {phone_number} from oo_businessemit_to {phone_number} from country_dependence_done

Page 27: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

# Let's get startedvertex start of COUNTRY_CODE_INFERRER

# Vertices active only for certain countriesvertex begin_country_dependent of TRIGGERvertex geocoder of GEOCODERvertex website of WEBSITE_NORMALIZERvertex postcode of POSTCODE_NORMALIZER

Page 28: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

# Let's get startedvertex start of COUNTRY_CODE_INFERRER

# Vertices active only for certain countriesvertex begin_country_dependent of TRIGGERvertex geocoder of GEOCODERvertex website of WEBSITE_NORMALIZERvertex postcode of POSTCODE_NORMALIZER

Page 29: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

# Country dependent adjacenciesemit_to {postcode, website} from begin_country_dependentemit_to {geocoder} from postcodeemit_to {end_country_dependent} from geocoderemit_to {end_country_dependent} from websiteemit_to {country_dependence_done} from end_country_dependent

Page 30: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

emit_to {geocoder} from postcode

Page 31: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

emit_to {oo_business, begin_country_dependent, country_dependence_done} from start with_chooser ACTIVE_EDGE_CHOOSER

Page 32: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

emit_to {oo_business, begin_country_dependent, country_dependence_done} from start with_chooser ACTIVE_EDGE_CHOOSER

Page 33: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Active Edge Chooser

Website

OOB

Postcode

Country Code

Conditional

Post Condition

Geocode

Conditional End

Phone Number

Page 34: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

What does the DSL give you • Griddle compiler creates a binary graph

• Binary graph processed with runtime that provides optimal concurrency

Page 35: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special
Page 36: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

The End

Page 37: Event Streams at Groupon - GOTO Conferencegotocon.com/dl/goto-chicago-2015/slides/BrianMcCa... · Event Streams at Groupon Storm, Mesos and Griddle AJ & Erik Weathers (with special

Future Work: Storm

• make parallelism configurable at runtime

• debuggability (stderr/out logging, history)

• metrics scalability

• replacement IScheduler to avoid big topologies starving small topologies


Recommended