SlideShare a Scribd company logo
1 of 41
Download to read offline
LNUG	
  
                                                 London	
  
                                              January	
  2013	
  




Copyright	
  Push	
  Technology	
  2012	
  
•  Distributed	
  Systems	
  /	
  HPC	
  guy.	
  
                                                 	
  
                                              •  Chief	
  Scien*st	
  :-­‐	
  at	
  Push	
  Technology	
  

                                              •  Responds	
  to:	
  Guinness,	
  Whisky	
  

                                              •  TwiOer:	
  @darachennis	
  




                                                                                 About	
  me?	
  
Copyright	
  Push	
  Technology	
  2012	
  
                                                          Darach@PushTechnology.com	
  
Streamy	
  
                                                Pipy	
  
                                              Analy*cy	
  




Copyright	
  Push	
  Technology	
  2012	
  
EEP	
  +	
  ‘Streams	
  &	
  Pipes’=	
  CEP	
  

                                                                        w w                   S
                                                                                                              C                     Q
                                                                        w w




                                         eep.js:	
  Func*onal	
  Opera*ons	
  on	
  Streaming	
  Data	
  Windows	
  	
  

                                              •    An	
  experiment	
  in	
  Embedded	
  Event	
  Processing	
  
                                              •    Sliding,	
  Tumbling,	
  Monotonic	
  and	
  Periodic	
  windows	
  
                                              •    Separate	
  ‘window’	
  definiYon	
  from	
  operaYon	
  
                                              •    Aggregate	
  funcYons.	
  Window	
  of	
  data	
  produces	
  scalar	
  result	
  

                                              •  But?	
  No	
  filtering,	
  branching	
  or	
  combinators,	
  no	
  flows	
  …	
  

                                              •  That’s	
  a	
  job	
  for	
  Streams	
  &	
  Pipes.	
  Let’s	
  add	
  that.	
  



Copyright	
  Push	
  Technology	
  2012	
  
Windows	
  




Copyright	
  Push	
  Technology	
  2012	
  
Windows	
  +	
  Aggregate	
  FuncYons	
  




What	
  is	
  this?	
                                                                                Example	
  
•  A	
  window	
  of	
  data	
  is	
  a	
  slice	
  of	
  data	
  over	
  Yme,	
  number	
  of	
     •  Average	
  –	
  	
  Aggregate	
  Func*on	
  
   events	
  or	
  some	
  other	
  dimension	
                                                      •  CPU	
  –	
  Data	
  (events)	
  
•  An	
  aggregate	
  funcYon	
  is	
  something	
  you	
  do	
  in	
  the	
  context	
  of	
        •  On	
  a	
  second	
  by	
  second	
  basis	
  
   a	
  window.	
                                                                                       	
  -­‐	
  Periodic	
  Yme	
  window	
  


Copyright	
  Push	
  Technology	
  2012	
  
Tumbling	
  Windows	
  
                         x()             x()           x()         x()
                                                                                         emit()


                                                                                x()       x()        x()       x()                  emit()
                       1                2              3              4
                                                                                                                             x()       x()        x()       x()
                                                                                                                                                                        emit()
                                                                               2          3          4          5
init()


                                                                                                                            2          3          4          5
                                                             init()


                                                                                                           init()


                       t0               t1             t2           t3         t4         t5         t6         t7         t8          t9        t10        t11   ...

                                                             What	
  is	
  a	
  tumbling	
  window?	
  
                                                             •    Every	
  N	
  events,	
  give	
  me	
  an	
  average	
  of	
  the	
  last	
  N	
  events	
  
                                                             •    Does	
  not	
  overlap	
  windows	
  
                                                             •    ‘Closing’	
  a	
  window,	
  ‘Emits’	
  a	
  result	
  (the	
  average)	
  
                                                             •    Closing	
  a	
  window,	
  Opens	
  a	
  new	
  window	
  

         Copyright	
  Push	
  Technology	
  2012	
  
Sliding	
  Windows	
  
init()


                   1                 2                 3           4         5                    ..        ..         ..        ..

            x()                      1                 2           3         4                    ..        ..         ..        ..

                              x()                      1           2         3                    ..        ..         ..        ..

                                                 x()               1         2                    ..        ..         ..        ..


                 t0               t1               t2            t3         t4        t5         t6        t7         t8        t9        t10       t11       ...

                                                           What	
  is	
  a	
  sliding	
  window?	
  
                                                           •    Like	
  tumbling,	
  except	
  can	
  overlap.	
  	
  
                                                           •    But	
  typically	
  O(N2),	
  Keep	
  N	
  small.	
  Except	
  EEP.js.	
  O(N)	
  perf.	
  
                                                           •    Every	
  event	
  opens	
  a	
  new	
  window.	
  
                                                           •    Ader	
  N	
  events,	
  every	
  subsequent	
  event	
  emits	
  a	
  result.	
  
                                                           •    Like	
  all	
  windows,	
  cost	
  of	
  calculaYon	
  amorYzed	
  over	
  events	
  

   Copyright	
  Push	
  Technology	
  2012	
  
Periodic	
  Windows	
  

                         x()             x()     x()        x()
                                                                               emit()


                                                                         x()    x()      x()       x()                  emit()
                       1                 2       3              4
                                                                                                                x()       x()    x()   x()
                                                                                                                                                        emit()
                                                                         2     3          4         5
init()


                                                                                                              2          3       4     5
                                                       init()


                                                                                               init()


                t0                                                  t1                                   t2                                  t3   ...
                                                  What	
  is	
  a	
  periodic	
  window?	
  
                                                  •  Driven	
  by	
  ‘wall	
  clock	
  Yme’	
  in	
  milliseconds	
  
                                                  •  Not	
  monotonic,	
  natch.	
  Beware	
  of	
  NTP	
  

   Copyright	
  Push	
  Technology	
  2012	
  
Monotonic	
  Windows	
  
                                                                          my                                     my                                          my


                         x()             x()           x()        x()
                                                                                      emit()


                                                                                x()    x()       x()       x()                emit()
                       1                2              3              4
                                                                                                                        x()      x()       x()         x()
                                                                                                                                                                        emit()
                                                                                2      3         4          5
init()


                                                                                                                       2         3         4           5
                                                             init()


                                                                                                       init()


                t0                                                         t1                                     t2                                         t3   ...
                                                             What	
  is	
  a	
  monotonic	
  window?	
  
                                                             •  Driven	
  mad	
  by	
  ‘wall	
  clock	
  Yme’?	
  Need	
  a	
  logical	
  clock?	
  
                                                             •  No	
  worries.	
  Provide	
  your	
  own	
  clock!	
  Eg.	
  Vector	
  clock	
  

         Copyright	
  Push	
  Technology	
  2012	
  
Slide	
  beOer	
  with	
  CompensaYng	
  
                                       Aggregates	
  
init()


                    1                 2               3    4    5                                ..    ..     ..     ..

             x()                      1               2    3    4                                ..    ..     ..     ..
                                                                         do {
                               x()                    1    2    3         …                      ..    ..     ..     ..
                                                                         } while (…)
                                                x()        1    2                                ..    ..     ..     ..


                                                               1                  compensate()




                  t0               t1             t2      t3   t4   t5       t6     t7   t8       t9    t10    t11    ...




  Copyright	
  Push	
  Technology	
  2012	
  
Bad	
  Sliding	
  -­‐	
  O(N2)	
  




Copyright	
  Push	
  Technology	
  2012	
  
Good	
  Sliding	
  
•  Takes	
  us	
  from	
  O(N2)	
  to	
  O(N)	
  for	
  Sliding	
  windows	
  




Copyright	
  Push	
  Technology	
  2012	
  
EEP.js	
  is	
  fast	
  




Copyright	
  Push	
  Technology	
  2012	
  
Using	
  Sliding,	
  Tumbling	
  Windows	
  




Copyright	
  Push	
  Technology	
  2012	
  
Using	
  Periodic,	
  Monotonic	
  Windows	
  




Copyright	
  Push	
  Technology	
  2012	
  
Custom	
  clocks	
  (noYon	
  of	
  Yme)	
  




Copyright	
  Push	
  Technology	
  2012	
  
EEP.js	
  v0.1,	
  v0.2	
  were	
  ugly	
  babies.	
  

Sorry!	
  
	
  
Swear,	
  the	
  next	
  version	
  will	
  be	
  just	
  as	
  funcYonal	
  but	
  preOy…	
  




Copyright	
  Push	
  Technology	
  2012	
  
Streams	
  &	
  
                                                 Pipes	
  




Copyright	
  Push	
  Technology	
  2012	
  
What	
  about	
  Streams	
  &	
  Pipes?	
  


     ????                                           S
                                                        C   Q




               +
                                              w w
         eep                                  w w




Copyright	
  Push	
  Technology	
  2012	
  
Streams	
  &	
  Pipes:	
  Origins	
  

        •  Do	
  one	
  thing.	
  Do	
  it	
  well	
  
            •  Compose	
  sophisYcated	
  behaviors	
  
               from	
  simple	
  parts	
  
            •  Maximize	
  reuse	
  
        •  Unix,	
  ‘Chain	
  of	
  Responsibility’	
  (GoF),	
  
           Interceptor	
  (POSA2),	
  XPipe,	
  Builder,	
  …	
  
        •  The	
  ‘Assembly	
  Line	
  Principle’	
  is	
  nothing	
  new	
  

Copyright	
  Push	
  Technology	
  2012	
  
Streams	
  &	
  Pipes:	
  Node.JS	
  

        •  var	
  events	
  =	
  require(‘events’)	
  
                      •  Publish/Subscribe	
  to	
  event	
  (streams)	
  
        •  var	
  stream	
  =	
  require(‘stream’)	
  
                      •          Readable	
  –	
  Consume	
  a	
  (finite)	
  set	
  of	
  events	
  
                      •          Writable	
  –	
  Produce	
  a	
  (finite)	
  set	
  of	
  events	
  
                      •          readable.pipe(writeable)	
  
                      •          writeable.pipe(readable)	
  


Copyright	
  Push	
  Technology	
  2012	
  
Streams	
  &	
  Pipes:	
  streams2	
  

        •  Transform	
  –	
  Compress,	
  Encrypt,	
  Encode,	
  …	
  
        •  Duplex	
  –	
  Readable	
  and	
  Writable	
  
        •  Passthrough	
  –	
  The	
  canonical	
  ‘noop’	
  transform	
  

        •  Node.js	
  Streams	
  history	
  (so	
  far)	
  
           	
  
           hOp://bit.ly/XupqkO	
  -­‐	
  by	
  @izs	
  


Copyright	
  Push	
  Technology	
  2012	
  
Streams	
  &	
  Pipes:	
  but	
  …	
  

        •  Oriented	
  for	
  IO,	
  not	
  compute/analy*cs	
  
                      •          Array-­‐like	
  buffers	
  not	
  individual	
  datums	
  
                      •          @dominictarr	
  event-­‐streams?	
  Array	
  based	
  
                      •          ASCII,	
  UTF-­‐8,	
  Binary	
  -­‐	
  not	
  JS	
  types	
  
                      •          Oden	
  require	
  copying,	
  parsing,	
  …	
  (slow)	
  
        •  So,	
  streams	
  &	
  pipes	
  for	
  JS	
  types?	
  Yes!	
  
                      •  Do	
  one	
  thing.	
  Do	
  it	
  well	
  
                      •  Compose	
  sophisYcated	
  simple	
  parts	
  
                      •  Maximize	
  reuse	
  
Copyright	
  Push	
  Technology	
  2012	
  
Introducing	
  
                                                Beam.js	
  




Copyright	
  Push	
  Technology	
  2012	
  
Beams,	
  Pipes	
  

        •  Streams	
  &	
  Pipes	
  for	
  analyYcs	
  
                      •  Not	
  designed	
  for	
  IO.	
  Use	
  Streams	
  for	
  that	
  
        •  Not	
  concerned	
  with	
  CEP.	
  	
  
                      •  …	
  Use	
  EEP	
  for	
  that?	
  J	
  
        •  Not	
  concerned	
  with	
  arrays	
  of	
  things	
  
                      •  …	
  Use	
  Dominic	
  Tarr’s	
  event-­‐stream	
  for	
  that	
  
        •  Beam	
  
                      •  Crunch	
  events	
  
                      •  Pipeline,	
  Branch	
  &	
  Combine	
  
Copyright	
  Push	
  Technology	
  2012	
  
Beams	
  &	
  Pipes.	
  

        •  Streams	
  &	
  Pipes,	
  reconsidered	
  for	
  JS	
  types	
  

        •  var	
  Beam	
  =	
  require(‘beam’);	
  

        •  Beam.Source	
   	
   	
  -­‐-­‐ 	
  Push	
  data	
  in	
  
        •  Beam.Sink	
  	
   	
   	
  -­‐-­‐ 	
  Suck	
  analysis	
  out	
  
        •  Beam.Operator 	
  -­‐-­‐ 	
  OODA	
  /	
  PDCA	
  

        •  Really	
  Simple:	
  ~150	
  LOC	
  
           	
  
Copyright	
  Push	
  Technology	
  2012	
  
Beams	
  &	
  Pipes:	
  Operators	
  

        •  Three	
  types	
  of	
  operator	
  
           	
  
                      •  Transform	
  
                                    •  1	
  in,	
  1	
  out.	
  Output	
  data/type	
  may	
  differ	
  
                                       	
  
                      •  Filter	
  
                                    •  1	
  in,	
  1	
  or	
  none	
  out.	
  Output	
  data/type	
  same	
  as	
  input	
  
                                       	
  
                      •  Custom	
  
                                    •  May	
  transform,	
  filter	
  

Copyright	
  Push	
  Technology	
  2012	
  
Example:	
  Defini*ons	
  




Copyright	
  Push	
  Technology	
  2012	
  
Example:	
  Usage	
  




Copyright	
  Push	
  Technology	
  2012	
  
Example:	
  Easy	
  to	
  debug	
  …	
  




Copyright	
  Push	
  Technology	
  2012	
  
Example:	
  Streams	
  &	
  Beams	
  




Copyright	
  Push	
  Technology	
  2012	
  
Branch	
  

        •         You	
  can	
  define	
  1	
  or	
  many	
  
        •         They	
  can	
  overlap	
  or	
  not	
  as	
  you	
  see	
  fit	
  
        •         It’s	
  just	
  an	
  applicaYon	
  of	
  predicate	
  (boolean)	
  filters	
  
        •         Simple	
  




Copyright	
  Push	
  Technology	
  2012	
  
Combine?	
  
        •         You	
  can	
  combine	
  many	
  sources	
  or	
  branches	
  into	
  one	
  
        •         Works	
  like	
  a	
  union.	
  First	
  in,	
  first	
  out.	
  
        •         You	
  can	
  write	
  your	
  own.	
  It’s	
  just	
  an	
  Operator	
  
        •         You	
  can	
  branch	
  from,	
  combine	
  to	
  …	
  any	
  beam	
  




Copyright	
  Push	
  Technology	
  2012	
  
Streams	
  &	
  Pipes,	
  ++	
  
        •         In	
  Node.js	
  the	
  definiYon	
  and	
  usage	
  of	
  streams	
  in	
  a	
  pipe	
  are	
  entangled.	
  
        •         Typically,	
  with	
  Streams	
  &	
  Pipes	
  for	
  IO,	
  you	
  only	
  ever	
  want	
  one.	
  
        •         In	
  algorithms	
  you	
  may	
  want	
  to	
  reuse.	
  
        •         Think	
  about	
  it	
  …	
  

        •  Event	
  
           EmiOer.	
  
           	
  
           1	
  square	
  …	
  
           	
  
           2	
  branches?	
  




Copyright	
  Push	
  Technology	
  2012	
  
Pipes	
  ++	
  
        •  Beam	
  Pipes	
  are	
  different	
  (&	
  really	
  really	
  really	
  simple)	
  
        •  You	
  can	
  define	
  a	
  filter	
  once	
  
        •  You	
  can	
  store	
  it	
  in	
  a	
  module	
  
        •  Store	
  like	
  opera*ons	
  together	
  
        •  Make	
  libraries	
  
           	
  
        •  Use	
  ‘em.	
  Share	
  ‘em.	
  




Copyright	
  Push	
  Technology	
  2012	
  
EEP	
  based	
  on	
  Beam	
  soon!	
  




Copyright	
  Push	
  Technology	
  2012	
  
Un*l	
  then?	
  

•  npm	
  install	
  beam	
  
        •  Filter	
  data	
  events	
  
        •  Transform	
  data	
  events	
  
        •  Analyze,	
  crunch	
  all	
  the	
  things	
  
        •  Branch	
  all	
  the	
  things	
  
        •  Combine	
  all	
  the	
  things	
  

Copyright	
  Push	
  Technology	
  2012	
  
Beam	
  futures?	
  

•  Taps	
  –	
  Convert	
  events	
  into	
  beams	
  
•  Drain	
  –	
  Convert	
  beams	
  into	
  events	
  
•  Beams	
  
   •  Write	
  Beam	
  operators	
  in	
  ‘beam’	
  
   •  Beams	
  ‘inside’	
  beams	
  
   •  Source.pipe(op).compile();	
  //	
  Maybe?	
  

Copyright	
  Push	
  Technology	
  2012	
  
Ques*ons	
  




Copyright	
  Push	
  Technology	
  2012	
  
•  Thank	
  you	
  for	
  listening	
  to,	
  having	
  me	
  
                                              	
  
                                              •  Le	
  twiOer:	
  @darachennis	
  
                                                   	
  
                                              •  hOps://github.com/darach/beam-­‐js	
  
                                                   hOps://github.com/darach/eep-­‐js	
  	
  
                                                   	
  
                                              •  npm	
  install	
  eep	
  
                                                   npm	
  install	
  beam	
  

                                              •  EEP	
  built	
  on	
  beam?	
  EEP	
  in	
  other	
  langs?	
  Soon	
  

                                              •  Fork	
  it,	
  Port	
  it,	
  Enjoy	
  it!	
  



                                                                                        QuesYons?	
  
Copyright	
  Push	
  Technology	
  2012	
  
                                                            Darach@PushTechnology.com	
  

More Related Content

What's hot

openFrameworks 007 - utils
openFrameworks 007 - utilsopenFrameworks 007 - utils
openFrameworks 007 - utilsroxlu
 
Using Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with QtUsing Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with Qtaccount inactive
 
openFrameworks 007 - GL
openFrameworks 007 - GL openFrameworks 007 - GL
openFrameworks 007 - GL roxlu
 
Special Effects with Qt Graphics View
Special Effects with Qt Graphics ViewSpecial Effects with Qt Graphics View
Special Effects with Qt Graphics Viewaccount inactive
 
Prévision de consommation électrique avec adaptive GAM
Prévision de consommation électrique avec adaptive GAMPrévision de consommation électrique avec adaptive GAM
Prévision de consommation électrique avec adaptive GAMCdiscount
 
Deuce STM - CMP'09
Deuce STM - CMP'09Deuce STM - CMP'09
Deuce STM - CMP'09Guy Korland
 
Derivative Free Optimization
Derivative Free OptimizationDerivative Free Optimization
Derivative Free OptimizationOlivier Teytaud
 
Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2NokiaAppForum
 
TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用Mark Chang
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesTobias Lindaaker
 

What's hot (11)

Cross Platform Qt
Cross Platform QtCross Platform Qt
Cross Platform Qt
 
openFrameworks 007 - utils
openFrameworks 007 - utilsopenFrameworks 007 - utils
openFrameworks 007 - utils
 
Using Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with QtUsing Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with Qt
 
openFrameworks 007 - GL
openFrameworks 007 - GL openFrameworks 007 - GL
openFrameworks 007 - GL
 
Special Effects with Qt Graphics View
Special Effects with Qt Graphics ViewSpecial Effects with Qt Graphics View
Special Effects with Qt Graphics View
 
Prévision de consommation électrique avec adaptive GAM
Prévision de consommation électrique avec adaptive GAMPrévision de consommation électrique avec adaptive GAM
Prévision de consommation électrique avec adaptive GAM
 
Deuce STM - CMP'09
Deuce STM - CMP'09Deuce STM - CMP'09
Deuce STM - CMP'09
 
Derivative Free Optimization
Derivative Free OptimizationDerivative Free Optimization
Derivative Free Optimization
 
Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2Petri Niemi Qt Advanced Part 2
Petri Niemi Qt Advanced Part 2
 
TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用TensorFlow 深度學習快速上手班--電腦視覺應用
TensorFlow 深度學習快速上手班--電腦視覺應用
 
Exploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic LanguagesExploiting Concurrency with Dynamic Languages
Exploiting Concurrency with Dynamic Languages
 

Viewers also liked

FunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - StreamsFunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - Streamsdarach
 
Complex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBaseComplex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBasedarach
 
Tech mesh london 2012
Tech mesh london 2012Tech mesh london 2012
Tech mesh london 2012darach
 
成功學與未來學Jpg
成功學與未來學Jpg成功學與未來學Jpg
成功學與未來學Jpgeddy lin
 
EFL Munich - February 2013 - "Conversational Big Data with Erlang"
EFL Munich - February 2013 - "Conversational Big Data with Erlang"EFL Munich - February 2013 - "Conversational Big Data with Erlang"
EFL Munich - February 2013 - "Conversational Big Data with Erlang"darach
 
Erlang/Sapiens
Erlang/SapiensErlang/Sapiens
Erlang/Sapiensdarach
 
Evening At Soulfood Books
Evening At Soulfood BooksEvening At Soulfood Books
Evening At Soulfood BooksCraig Larsen
 
Meta Programming with Streams and Pipes
Meta Programming with Streams and PipesMeta Programming with Streams and Pipes
Meta Programming with Streams and Pipesdarach
 
Streams and Things
Streams and ThingsStreams and Things
Streams and Thingsdarach
 
Thing. An unexpected journey. Devoxx UK 2014
Thing. An unexpected journey. Devoxx UK 2014Thing. An unexpected journey. Devoxx UK 2014
Thing. An unexpected journey. Devoxx UK 2014darach
 
QCON London 2013
QCON London 2013QCON London 2013
QCON London 2013darach
 
Deconstructing Lambda
Deconstructing LambdaDeconstructing Lambda
Deconstructing Lambdadarach
 
Big Data, Mob Scale.
Big Data, Mob Scale.Big Data, Mob Scale.
Big Data, Mob Scale.darach
 
Data distribution in the cloud with Node.js
Data distribution in the cloud with Node.jsData distribution in the cloud with Node.js
Data distribution in the cloud with Node.jsdarach
 
StreamBase - Embedded Erjang - Erlang User Group London - 20th April 2011
StreamBase - Embedded Erjang - Erlang User Group London - 20th April 2011StreamBase - Embedded Erjang - Erlang User Group London - 20th April 2011
StreamBase - Embedded Erjang - Erlang User Group London - 20th April 2011darach
 
KAJIAN TERHADAP AMALAN DAN TINGKAHLAKU PENGGUNA TERHADAP PENGGUNAAN LESTARI D...
KAJIAN TERHADAP AMALAN DAN TINGKAHLAKU PENGGUNA TERHADAP PENGGUNAAN LESTARI D...KAJIAN TERHADAP AMALAN DAN TINGKAHLAKU PENGGUNA TERHADAP PENGGUNAAN LESTARI D...
KAJIAN TERHADAP AMALAN DAN TINGKAHLAKU PENGGUNA TERHADAP PENGGUNAAN LESTARI D...mandalina landy
 
The Normal Probability Distribution
The Normal Probability DistributionThe Normal Probability Distribution
The Normal Probability Distributionmandalina landy
 

Viewers also liked (19)

FunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - StreamsFunctionalJS - May 2014 - Streams
FunctionalJS - May 2014 - Streams
 
Bianco O Colore
Bianco O ColoreBianco O Colore
Bianco O Colore
 
Complex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBaseComplex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBase
 
Tech mesh london 2012
Tech mesh london 2012Tech mesh london 2012
Tech mesh london 2012
 
成功學與未來學Jpg
成功學與未來學Jpg成功學與未來學Jpg
成功學與未來學Jpg
 
EFL Munich - February 2013 - "Conversational Big Data with Erlang"
EFL Munich - February 2013 - "Conversational Big Data with Erlang"EFL Munich - February 2013 - "Conversational Big Data with Erlang"
EFL Munich - February 2013 - "Conversational Big Data with Erlang"
 
Erlang/Sapiens
Erlang/SapiensErlang/Sapiens
Erlang/Sapiens
 
Angeline
AngelineAngeline
Angeline
 
Evening At Soulfood Books
Evening At Soulfood BooksEvening At Soulfood Books
Evening At Soulfood Books
 
Meta Programming with Streams and Pipes
Meta Programming with Streams and PipesMeta Programming with Streams and Pipes
Meta Programming with Streams and Pipes
 
Streams and Things
Streams and ThingsStreams and Things
Streams and Things
 
Thing. An unexpected journey. Devoxx UK 2014
Thing. An unexpected journey. Devoxx UK 2014Thing. An unexpected journey. Devoxx UK 2014
Thing. An unexpected journey. Devoxx UK 2014
 
QCON London 2013
QCON London 2013QCON London 2013
QCON London 2013
 
Deconstructing Lambda
Deconstructing LambdaDeconstructing Lambda
Deconstructing Lambda
 
Big Data, Mob Scale.
Big Data, Mob Scale.Big Data, Mob Scale.
Big Data, Mob Scale.
 
Data distribution in the cloud with Node.js
Data distribution in the cloud with Node.jsData distribution in the cloud with Node.js
Data distribution in the cloud with Node.js
 
StreamBase - Embedded Erjang - Erlang User Group London - 20th April 2011
StreamBase - Embedded Erjang - Erlang User Group London - 20th April 2011StreamBase - Embedded Erjang - Erlang User Group London - 20th April 2011
StreamBase - Embedded Erjang - Erlang User Group London - 20th April 2011
 
KAJIAN TERHADAP AMALAN DAN TINGKAHLAKU PENGGUNA TERHADAP PENGGUNAAN LESTARI D...
KAJIAN TERHADAP AMALAN DAN TINGKAHLAKU PENGGUNA TERHADAP PENGGUNAAN LESTARI D...KAJIAN TERHADAP AMALAN DAN TINGKAHLAKU PENGGUNA TERHADAP PENGGUNAAN LESTARI D...
KAJIAN TERHADAP AMALAN DAN TINGKAHLAKU PENGGUNA TERHADAP PENGGUNAAN LESTARI D...
 
The Normal Probability Distribution
The Normal Probability DistributionThe Normal Probability Distribution
The Normal Probability Distribution
 

Similar to LNUG January 2013 Streaming Data Windows

[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basicsnpinto
 
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...ICSM 2011
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow규영 허
 
TinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionTinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionRazvan Musaloiu-E.
 
The business case for automated software engineering
The business case for automated software engineering The business case for automated software engineering
The business case for automated software engineering CS, NcState
 
Lecture: Vaadin Overview
Lecture: Vaadin OverviewLecture: Vaadin Overview
Lecture: Vaadin OverviewJoonas Lehtinen
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns ReconsideredAlex Miller
 
The hangover: A "modern" (?) high performance approach to build an offensive ...
The hangover: A "modern" (?) high performance approach to build an offensive ...The hangover: A "modern" (?) high performance approach to build an offensive ...
The hangover: A "modern" (?) high performance approach to build an offensive ...Nelson Brito
 
Machine Learning - What, Where and How
Machine Learning - What, Where and HowMachine Learning - What, Where and How
Machine Learning - What, Where and Hownarinderk
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers TrainingJan Gregersen
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers TrainingJan Gregersen
 
Concurrency And Erlang
Concurrency And ErlangConcurrency And Erlang
Concurrency And Erlangl xf
 
Verilator: Fast, Free, But for Me?
Verilator: Fast, Free, But for Me? Verilator: Fast, Free, But for Me?
Verilator: Fast, Free, But for Me? DVClub
 
CG OpneGL 2D viewing & simple animation-course 6
CG OpneGL 2D viewing & simple animation-course 6CG OpneGL 2D viewing & simple animation-course 6
CG OpneGL 2D viewing & simple animation-course 6fungfung Chen
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effectsSergey Kuksenko
 
Java cơ bản java co ban
Java cơ bản java co ban Java cơ bản java co ban
Java cơ bản java co ban ifis
 
Concurrency in Programming Languages
Concurrency in Programming LanguagesConcurrency in Programming Languages
Concurrency in Programming LanguagesYudong Li
 
Eclipse Code Recommenders @ cross-event Deutsche Telekom Developer Garden Tec...
Eclipse Code Recommenders @ cross-event Deutsche Telekom Developer Garden Tec...Eclipse Code Recommenders @ cross-event Deutsche Telekom Developer Garden Tec...
Eclipse Code Recommenders @ cross-event Deutsche Telekom Developer Garden Tec...Marcel Bruch
 
6th OA Conference - Apr 2005 - Into the Depths of OpenAccess - Timing Constra...
6th OA Conference - Apr 2005 - Into the Depths of OpenAccess - Timing Constra...6th OA Conference - Apr 2005 - Into the Depths of OpenAccess - Timing Constra...
6th OA Conference - Apr 2005 - Into the Depths of OpenAccess - Timing Constra...Tim55Ehrler
 
A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...Daniele Gianni
 

Similar to LNUG January 2013 Streaming Data Windows (20)

[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
[Harvard CS264] 03 - Introduction to GPU Computing, CUDA Basics
 
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
Components - Crossing the Boundaries while Analyzing Heterogeneous Component-...
 
Swift for tensorflow
Swift for tensorflowSwift for tensorflow
Swift for tensorflow
 
TinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on SessionTinyOS 2.1 Tutorial: Hands-on Session
TinyOS 2.1 Tutorial: Hands-on Session
 
The business case for automated software engineering
The business case for automated software engineering The business case for automated software engineering
The business case for automated software engineering
 
Lecture: Vaadin Overview
Lecture: Vaadin OverviewLecture: Vaadin Overview
Lecture: Vaadin Overview
 
Design Patterns Reconsidered
Design Patterns ReconsideredDesign Patterns Reconsidered
Design Patterns Reconsidered
 
The hangover: A "modern" (?) high performance approach to build an offensive ...
The hangover: A "modern" (?) high performance approach to build an offensive ...The hangover: A "modern" (?) high performance approach to build an offensive ...
The hangover: A "modern" (?) high performance approach to build an offensive ...
 
Machine Learning - What, Where and How
Machine Learning - What, Where and HowMachine Learning - What, Where and How
Machine Learning - What, Where and How
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers Training
 
OpenMI Developers Training
OpenMI Developers TrainingOpenMI Developers Training
OpenMI Developers Training
 
Concurrency And Erlang
Concurrency And ErlangConcurrency And Erlang
Concurrency And Erlang
 
Verilator: Fast, Free, But for Me?
Verilator: Fast, Free, But for Me? Verilator: Fast, Free, But for Me?
Verilator: Fast, Free, But for Me?
 
CG OpneGL 2D viewing & simple animation-course 6
CG OpneGL 2D viewing & simple animation-course 6CG OpneGL 2D viewing & simple animation-course 6
CG OpneGL 2D viewing & simple animation-course 6
 
"Quantum" performance effects
"Quantum" performance effects"Quantum" performance effects
"Quantum" performance effects
 
Java cơ bản java co ban
Java cơ bản java co ban Java cơ bản java co ban
Java cơ bản java co ban
 
Concurrency in Programming Languages
Concurrency in Programming LanguagesConcurrency in Programming Languages
Concurrency in Programming Languages
 
Eclipse Code Recommenders @ cross-event Deutsche Telekom Developer Garden Tec...
Eclipse Code Recommenders @ cross-event Deutsche Telekom Developer Garden Tec...Eclipse Code Recommenders @ cross-event Deutsche Telekom Developer Garden Tec...
Eclipse Code Recommenders @ cross-event Deutsche Telekom Developer Garden Tec...
 
6th OA Conference - Apr 2005 - Into the Depths of OpenAccess - Timing Constra...
6th OA Conference - Apr 2005 - Into the Depths of OpenAccess - Timing Constra...6th OA Conference - Apr 2005 - Into the Depths of OpenAccess - Timing Constra...
6th OA Conference - Apr 2005 - Into the Depths of OpenAccess - Timing Constra...
 
A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...A Layered Architecture for the Model-driven Development of Distributed Simula...
A Layered Architecture for the Model-driven Development of Distributed Simula...
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

LNUG January 2013 Streaming Data Windows

  • 1. LNUG   London   January  2013   Copyright  Push  Technology  2012  
  • 2. •  Distributed  Systems  /  HPC  guy.     •  Chief  Scien*st  :-­‐  at  Push  Technology   •  Responds  to:  Guinness,  Whisky   •  TwiOer:  @darachennis   About  me?   Copyright  Push  Technology  2012   Darach@PushTechnology.com  
  • 3. Streamy   Pipy   Analy*cy   Copyright  Push  Technology  2012  
  • 4. EEP  +  ‘Streams  &  Pipes’=  CEP   w w S C Q w w eep.js:  Func*onal  Opera*ons  on  Streaming  Data  Windows     •  An  experiment  in  Embedded  Event  Processing   •  Sliding,  Tumbling,  Monotonic  and  Periodic  windows   •  Separate  ‘window’  definiYon  from  operaYon   •  Aggregate  funcYons.  Window  of  data  produces  scalar  result   •  But?  No  filtering,  branching  or  combinators,  no  flows  …   •  That’s  a  job  for  Streams  &  Pipes.  Let’s  add  that.   Copyright  Push  Technology  2012  
  • 5. Windows   Copyright  Push  Technology  2012  
  • 6. Windows  +  Aggregate  FuncYons   What  is  this?   Example   •  A  window  of  data  is  a  slice  of  data  over  Yme,  number  of   •  Average  –    Aggregate  Func*on   events  or  some  other  dimension   •  CPU  –  Data  (events)   •  An  aggregate  funcYon  is  something  you  do  in  the  context  of   •  On  a  second  by  second  basis   a  window.    -­‐  Periodic  Yme  window   Copyright  Push  Technology  2012  
  • 7. Tumbling  Windows   x() x() x() x() emit() x() x() x() x() emit() 1 2 3 4 x() x() x() x() emit() 2 3 4 5 init() 2 3 4 5 init() init() t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 ... What  is  a  tumbling  window?   •  Every  N  events,  give  me  an  average  of  the  last  N  events   •  Does  not  overlap  windows   •  ‘Closing’  a  window,  ‘Emits’  a  result  (the  average)   •  Closing  a  window,  Opens  a  new  window   Copyright  Push  Technology  2012  
  • 8. Sliding  Windows   init() 1 2 3 4 5 .. .. .. .. x() 1 2 3 4 .. .. .. .. x() 1 2 3 .. .. .. .. x() 1 2 .. .. .. .. t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 ... What  is  a  sliding  window?   •  Like  tumbling,  except  can  overlap.     •  But  typically  O(N2),  Keep  N  small.  Except  EEP.js.  O(N)  perf.   •  Every  event  opens  a  new  window.   •  Ader  N  events,  every  subsequent  event  emits  a  result.   •  Like  all  windows,  cost  of  calculaYon  amorYzed  over  events   Copyright  Push  Technology  2012  
  • 9. Periodic  Windows   x() x() x() x() emit() x() x() x() x() emit() 1 2 3 4 x() x() x() x() emit() 2 3 4 5 init() 2 3 4 5 init() init() t0 t1 t2 t3 ... What  is  a  periodic  window?   •  Driven  by  ‘wall  clock  Yme’  in  milliseconds   •  Not  monotonic,  natch.  Beware  of  NTP   Copyright  Push  Technology  2012  
  • 10. Monotonic  Windows   my my my x() x() x() x() emit() x() x() x() x() emit() 1 2 3 4 x() x() x() x() emit() 2 3 4 5 init() 2 3 4 5 init() init() t0 t1 t2 t3 ... What  is  a  monotonic  window?   •  Driven  mad  by  ‘wall  clock  Yme’?  Need  a  logical  clock?   •  No  worries.  Provide  your  own  clock!  Eg.  Vector  clock   Copyright  Push  Technology  2012  
  • 11. Slide  beOer  with  CompensaYng   Aggregates   init() 1 2 3 4 5 .. .. .. .. x() 1 2 3 4 .. .. .. .. do { x() 1 2 3 … .. .. .. .. } while (…) x() 1 2 .. .. .. .. 1 compensate() t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 ... Copyright  Push  Technology  2012  
  • 12. Bad  Sliding  -­‐  O(N2)   Copyright  Push  Technology  2012  
  • 13. Good  Sliding   •  Takes  us  from  O(N2)  to  O(N)  for  Sliding  windows   Copyright  Push  Technology  2012  
  • 14. EEP.js  is  fast   Copyright  Push  Technology  2012  
  • 15. Using  Sliding,  Tumbling  Windows   Copyright  Push  Technology  2012  
  • 16. Using  Periodic,  Monotonic  Windows   Copyright  Push  Technology  2012  
  • 17. Custom  clocks  (noYon  of  Yme)   Copyright  Push  Technology  2012  
  • 18. EEP.js  v0.1,  v0.2  were  ugly  babies.   Sorry!     Swear,  the  next  version  will  be  just  as  funcYonal  but  preOy…   Copyright  Push  Technology  2012  
  • 19. Streams  &   Pipes   Copyright  Push  Technology  2012  
  • 20. What  about  Streams  &  Pipes?   ???? S C Q + w w eep w w Copyright  Push  Technology  2012  
  • 21. Streams  &  Pipes:  Origins   •  Do  one  thing.  Do  it  well   •  Compose  sophisYcated  behaviors   from  simple  parts   •  Maximize  reuse   •  Unix,  ‘Chain  of  Responsibility’  (GoF),   Interceptor  (POSA2),  XPipe,  Builder,  …   •  The  ‘Assembly  Line  Principle’  is  nothing  new   Copyright  Push  Technology  2012  
  • 22. Streams  &  Pipes:  Node.JS   •  var  events  =  require(‘events’)   •  Publish/Subscribe  to  event  (streams)   •  var  stream  =  require(‘stream’)   •  Readable  –  Consume  a  (finite)  set  of  events   •  Writable  –  Produce  a  (finite)  set  of  events   •  readable.pipe(writeable)   •  writeable.pipe(readable)   Copyright  Push  Technology  2012  
  • 23. Streams  &  Pipes:  streams2   •  Transform  –  Compress,  Encrypt,  Encode,  …   •  Duplex  –  Readable  and  Writable   •  Passthrough  –  The  canonical  ‘noop’  transform   •  Node.js  Streams  history  (so  far)     hOp://bit.ly/XupqkO  -­‐  by  @izs   Copyright  Push  Technology  2012  
  • 24. Streams  &  Pipes:  but  …   •  Oriented  for  IO,  not  compute/analy*cs   •  Array-­‐like  buffers  not  individual  datums   •  @dominictarr  event-­‐streams?  Array  based   •  ASCII,  UTF-­‐8,  Binary  -­‐  not  JS  types   •  Oden  require  copying,  parsing,  …  (slow)   •  So,  streams  &  pipes  for  JS  types?  Yes!   •  Do  one  thing.  Do  it  well   •  Compose  sophisYcated  simple  parts   •  Maximize  reuse   Copyright  Push  Technology  2012  
  • 25. Introducing   Beam.js   Copyright  Push  Technology  2012  
  • 26. Beams,  Pipes   •  Streams  &  Pipes  for  analyYcs   •  Not  designed  for  IO.  Use  Streams  for  that   •  Not  concerned  with  CEP.     •  …  Use  EEP  for  that?  J   •  Not  concerned  with  arrays  of  things   •  …  Use  Dominic  Tarr’s  event-­‐stream  for  that   •  Beam   •  Crunch  events   •  Pipeline,  Branch  &  Combine   Copyright  Push  Technology  2012  
  • 27. Beams  &  Pipes.   •  Streams  &  Pipes,  reconsidered  for  JS  types   •  var  Beam  =  require(‘beam’);   •  Beam.Source      -­‐-­‐  Push  data  in   •  Beam.Sink        -­‐-­‐  Suck  analysis  out   •  Beam.Operator  -­‐-­‐  OODA  /  PDCA   •  Really  Simple:  ~150  LOC     Copyright  Push  Technology  2012  
  • 28. Beams  &  Pipes:  Operators   •  Three  types  of  operator     •  Transform   •  1  in,  1  out.  Output  data/type  may  differ     •  Filter   •  1  in,  1  or  none  out.  Output  data/type  same  as  input     •  Custom   •  May  transform,  filter   Copyright  Push  Technology  2012  
  • 29. Example:  Defini*ons   Copyright  Push  Technology  2012  
  • 30. Example:  Usage   Copyright  Push  Technology  2012  
  • 31. Example:  Easy  to  debug  …   Copyright  Push  Technology  2012  
  • 32. Example:  Streams  &  Beams   Copyright  Push  Technology  2012  
  • 33. Branch   •  You  can  define  1  or  many   •  They  can  overlap  or  not  as  you  see  fit   •  It’s  just  an  applicaYon  of  predicate  (boolean)  filters   •  Simple   Copyright  Push  Technology  2012  
  • 34. Combine?   •  You  can  combine  many  sources  or  branches  into  one   •  Works  like  a  union.  First  in,  first  out.   •  You  can  write  your  own.  It’s  just  an  Operator   •  You  can  branch  from,  combine  to  …  any  beam   Copyright  Push  Technology  2012  
  • 35. Streams  &  Pipes,  ++   •  In  Node.js  the  definiYon  and  usage  of  streams  in  a  pipe  are  entangled.   •  Typically,  with  Streams  &  Pipes  for  IO,  you  only  ever  want  one.   •  In  algorithms  you  may  want  to  reuse.   •  Think  about  it  …   •  Event   EmiOer.     1  square  …     2  branches?   Copyright  Push  Technology  2012  
  • 36. Pipes  ++   •  Beam  Pipes  are  different  (&  really  really  really  simple)   •  You  can  define  a  filter  once   •  You  can  store  it  in  a  module   •  Store  like  opera*ons  together   •  Make  libraries     •  Use  ‘em.  Share  ‘em.   Copyright  Push  Technology  2012  
  • 37. EEP  based  on  Beam  soon!   Copyright  Push  Technology  2012  
  • 38. Un*l  then?   •  npm  install  beam   •  Filter  data  events   •  Transform  data  events   •  Analyze,  crunch  all  the  things   •  Branch  all  the  things   •  Combine  all  the  things   Copyright  Push  Technology  2012  
  • 39. Beam  futures?   •  Taps  –  Convert  events  into  beams   •  Drain  –  Convert  beams  into  events   •  Beams   •  Write  Beam  operators  in  ‘beam’   •  Beams  ‘inside’  beams   •  Source.pipe(op).compile();  //  Maybe?   Copyright  Push  Technology  2012  
  • 40. Ques*ons   Copyright  Push  Technology  2012  
  • 41. •  Thank  you  for  listening  to,  having  me     •  Le  twiOer:  @darachennis     •  hOps://github.com/darach/beam-­‐js   hOps://github.com/darach/eep-­‐js       •  npm  install  eep   npm  install  beam   •  EEP  built  on  beam?  EEP  in  other  langs?  Soon   •  Fork  it,  Port  it,  Enjoy  it!   QuesYons?   Copyright  Push  Technology  2012   Darach@PushTechnology.com