SlideShare una empresa de Scribd logo
1 de 61
Copyright	
  Push	
  Technology	
  2012	
  
QCON	
  
London	
  2013	
  
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/real-time-data-distribution
Presented at QCon London
www.qconlondon.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Copyright	
  Push	
  Technology	
  2012	
  
My	
  ‘number’	
  
#6752	
  
Copyright	
  Push	
  Technology	
  2012	
  
Darach@PushTechnology.com	
  
About	
  me?	
  
•  Distributed	
  Systems	
  /	
  HPC	
  guy.	
  
	
  
•  Chief	
  Scien*st	
  :-­‐	
  at	
  Push	
  Technology	
  
•  Alumnus	
  of	
  :-­‐	
  	
  
	
  
Motorola,	
  IONA,	
  BeTair,	
  JPMC,	
  StreamBase.	
  
•  School:	
  Trinity	
  College	
  Dublin.	
  	
  
-­‐	
  BA	
  (Mod).	
  Comp.	
  Sci.+	
  	
  
-­‐	
  M.Sc.	
  Networks	
  &	
  Distributed	
  Systems	
  	
  
	
  
•  Responds	
  to:	
  Guinness,	
  Whisky	
  
Copyright	
  Push	
  Technology	
  2012	
  
Highly	
  Available	
  
Real-­‐Time	
  
Data	
  Distribu`on	
  
at	
  the	
  network’s	
  
Edge	
  
Copyright	
  Push	
  Technology	
  2012	
  
HA.	
  Black	
  swans	
  &	
  Pigfish!	
  
Copyright	
  Push	
  Technology	
  2012	
  
When	
  this	
  …	
  
Service	
  
esse	
  hic	
  
draconum	
  
Copyright	
  Push	
  Technology	
  2012	
  
…	
  inevitably	
  happens	
  
HA!	
  HA!	
  
W8!!	
  
Copyright	
  Push	
  Technology	
  2012	
  
Over	
  the	
  Edge,	
  where	
  Fallacies	
  roam	
  
- The	
  network	
  is	
  reliable	
  
- Latency	
  is	
  zero	
  	
  
- Bandwidth	
  is	
  infinite	
  
- There	
  is	
  one	
  administrator	
  
- Topology	
  does	
  not	
  change	
  
- The	
  network	
  is	
  secure	
  
- Transport	
  cost	
  is	
  zero	
  
- The	
  network	
  is	
  homogeneous	
  
	
  
hgp://en.wikipedia.org/wiki/Fallacies_of_Distributed_Compu`ng	
  	
  
	
  
Copyright	
  Push	
  Technology	
  2012	
  
&	
  the	
  last	
  mile.	
  Dragons	
  there	
  be.	
  
y	
  =	
  -­‐1.1667x	
  +	
  45703	
  
R²	
  =	
  0.02496	
  
1.00E+00	
  
1.00E+01	
  
1.00E+02	
  
1.00E+03	
  
1.00E+04	
  
sep./06	
   okt./06	
   okt./06	
   nov./06	
   dec./06	
   dec./06	
   jan./07	
   feb./07	
  
Latency	
  
Latency	
  (ms)	
  
Expected	
  (ms)	
  
Linear	
  (Latency	
  (ms))	
  
-­‐10.00	
  
0.00	
  
10.00	
  
20.00	
  
30.00	
  
sep./06	
   okt./06	
   okt./06	
   nov./06	
   dec./06	
   dec./06	
   jan./07	
   feb./07	
  
Download	
  Bandwidth	
  
Expected	
  (Mbps)	
  
Download	
  (Mbps)	
  
Buffer	
  
Bloat	
   Cell	
  
Coverage	
  
Bagery!	
  
Copyright	
  Push	
  Technology	
  2012	
  
Distributed	
  Systems	
  
“A	
  distributed	
  system	
  is	
  one	
  in	
  
which	
  the	
  failure	
  of	
  a	
  computer	
  
you	
  didn’t	
  even	
  know	
  existed	
  
can	
  render	
  your	
  computer	
  
unusable”	
  
-­‐	
  Leslie	
  Lamport	
  
Copyright	
  Push	
  Technology	
  2012	
  
High	
  Availability	
  
“The	
  price	
  of	
  reliability	
  is	
  the	
  
pursuit	
  of	
  the	
  utmost	
  simplicity.”	
  
-­‐  Sir	
  Tony	
  Hoare,	
  Turing	
  Award	
  speech,	
  1980	
  	
  
	
  
“This	
  is	
  the	
  unfortunate	
  truth:	
  
Simplicity	
  is	
  Hard.”	
  
	
   	
   	
   	
   	
   	
  -­‐	
  	
  Mosely	
  &	
  Marks,	
  Out	
  of	
  the	
  Tar	
  Pit,	
  2006	
  
Copyright	
  Push	
  Technology	
  2012	
  
High	
  Experiences	
  ~	
  Man	
  vs	
  Machine	
  
Image:	
  hgp://www.phillymarke`nglabs.com/man-­‐vs-­‐machine/	
  	
  
Copyright	
  Push	
  Technology	
  2012	
  
Machines	
  are	
  ‘Easy’	
  
A	
  more	
  unfortunate	
  truth	
  is:	
  	
  
Humans*	
  are	
  Harder.	
  	
  
	
  
Allegedly	
  Sergey*	
  can	
  be	
  Emasculated	
  
by	
  Glass.	
  But,	
  I	
  bet	
  he	
  owns	
  a	
  god	
  phone.
	
   	
   	
   	
   	
   	
   	
  *	
  Humans	
  are	
  grumpy!	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  *	
  Colors	
  chosen	
  at	
  random	
  
Copyright	
  Push	
  Technology	
  2012	
  
Once	
  Upon	
  a	
  *me	
  …	
  
SPOF
There	
  was	
  a	
  very	
  useful	
  ligle	
  single	
  point	
  of	
  failure.	
  
Copyright	
  Push	
  Technology	
  2012	
  
It	
  was	
  so	
  successful	
  
SPOF
It	
  grew	
  and	
  it	
  grew!	
  So	
  we	
  put	
  it	
  in	
  the	
  cloud.	
  
Copyright	
  Push	
  Technology	
  2012	
  
It	
  grew,	
  and	
  it	
  grew	
  …	
  
SPOF
We	
  touched	
  it	
  with	
  all	
  of	
  our	
  devices.	
  
Copyright	
  Push	
  Technology	
  2012	
  
See	
  SPOF	
  run!	
  
SPOF
We	
  all	
  touched	
  it	
  except	
  Sergey	
  ‘the	
  emasculated	
  one’	
  
Copyright	
  Push	
  Technology	
  2012	
  
See	
  SPOF	
  spew	
  L	
  
Is	
  there	
  nothing	
  we	
  can	
  do?	
  Esse	
  hic	
  draconum,	
  basically.	
  But,	
  yes	
  we	
  can	
  too	
  …	
  
Wat?
Copyright	
  Push	
  Technology	
  2012	
  
Bad	
  things	
  happen	
  …	
  
RapGenius	
  
vs	
  
Heroku.	
  
	
  
Anyone?	
  
Ferris?	
  
It’s	
  either	
  dyno	
  park	
  this	
  or	
  whale	
  fail	
  in	
  the	
  zoo	
  …	
  
Copyright	
  Push	
  Technology	
  2012	
  
So	
  we	
  spun	
  up	
  another	
  instance	
  
And	
  master	
  /	
  slave	
  dabbled	
  with	
  us	
  
Master Slave
Copyright	
  Push	
  Technology	
  2012	
  
Ac*ve/Passive	
  –	
  Maybe?	
  
MTTR	
  rela`vely	
  high.	
  MTBF	
  rela`vely	
  low.	
  	
  Ok	
  for	
  	
  
‘nice-­‐to-­‐have’	
  or	
  	
  ‘too-­‐late-­‐to-­‐cry-­‐now’	
  	
  facili`es.	
  	
  
Active
(Hot)
Passive
(Cold)
Copyright	
  Push	
  Technology	
  2012	
  
Ac*ve/Passive	
  –	
  Hmm?	
  
MTTR	
  slightly	
  beger.	
  Can	
  replicate	
  state	
  ac`vely	
  for	
  cheaper	
  recovery.	
  
Active
(Hot)
Passive
(Warm)
Copyright	
  Push	
  Technology	
  2012	
  
Ac*ve/Ac*ve	
  –	
  Ugh…	
  
MTTR	
  negligeable.	
  Use	
  2x	
  the	
  bandwidth.	
  Get	
  ‘half’	
  the	
  value.	
  Dups	
  	
  
Master Slave
Active
(Hot)
Active
(Hot)
Copyright	
  Push	
  Technology	
  2012	
  
Ac*ve/Ac*ve	
  –	
  Ugh…	
  
MTTR	
  negligeable.	
  Minify	
  bandwidth	
  usage	
  mostly.	
  	
  Dups	
  	
  
Active
(Hot)
Active
(Warm)
Copyright	
  Push	
  Technology	
  2012	
  
Ac*ve/Ac*ve	
  –	
  Ugh…	
  
MTTR	
  negligeable.	
  Minify	
  bandwidth	
  usage	
  mostly.	
  	
  Dups	
  	
  
Active
(Hot)
Active
(Warm)
Copyright	
  Push	
  Technology	
  2012	
  
Spin	
  up	
  another	
  box?	
  
Failback,	
  Failover,	
  Takeover?	
  Load	
  Balance?	
  This	
  is	
  gesng	
  costly!	
  
Active
(Hot)
Passive
(Cold)
Standby
(Cold)
Speak no evil Hear no evil See no evil
Copyright	
  Push	
  Technology	
  2012	
  
Can	
  implement	
  N-­‐Plex	
  HA	
  with	
  a	
  
‘simple’	
  FSM	
  
Consider	
  roles	
  for	
  Applica`on,	
  Controller,	
  callbacks,	
  …	
  
Initial
Booting
Boot/DoBoot
Sync'ing
Sync/DoSyncStart
Switching
Switching/DoSwitch
Standby
Standby/DoSyncEnd
Active
Active/DoSwtichDone
Swtich/DoStandbyActivate
Stopping
Stop/DoStopStart
Standby/DoStopDone
Copyright	
  Push	
  Technology	
  2012	
  
Spin	
  up	
  a	
  cluster,	
  ring?	
  
Master
Slave
SlaveSlave
SlaveSlave
Slave Slave
A	
  simple	
  implementa`on	
  can	
  be	
  
easier	
  to	
  build	
  than	
  HA	
  pairs.	
  Your	
  
mileage	
  may	
  vary.	
  Can	
  be	
  masterless	
  
too.	
  
	
  	
  
Where	
  possible,	
  use	
  exis`ng	
  
solu`ons	
  such	
  as	
  Akka,	
  riak_core,	
  
doozer,	
  Apache	
  Zookeeper.	
  
	
  
You’ll	
  s`ll	
  need	
  to	
  roll	
  your	
  own	
  
data	
  recovery	
  -­‐	
  mostly.	
  Although	
  
CRDT’s	
  are	
  changing	
  that	
  in	
  the	
  
database	
  community.	
  
Copyright	
  Push	
  Technology	
  2012	
  
One	
  more	
  thing	
  …	
  Real-­‐Time	
  streams	
  
Real-­‐`me	
  data	
  streams	
  are	
  long-­‐lived,	
  conversa`onal,	
  can	
  be	
  stateful.	
  	
  
Meh Meh
Data!	
  
Copyright	
  Push	
  Technology	
  2012	
  
Streaming	
  Data	
  Recovery	
  
hgp://nms.lcs.mit.edu/papers/ha-­‐icde05.pdf	
  -­‐	
  HA	
  algos	
  for	
  DSPs	
  	
  
Type	
   Before	
   A]er	
   Comments	
  
Precise	
   T
1	
  
T
2	
  
T
3	
  
T
4	
  
T
5	
  
T
6	
  
Completely	
  masks	
  
failure.	
  
Gap	
   T
1	
  
T
2	
  
T
3	
  
?	
   T
5	
  
T
6	
  
May	
  result	
  in	
  data	
  loss	
  
Repea*ng	
  Rollback	
   T
1	
  
T
2	
  
T
3	
  
T
2	
  
T
3	
  
T
4	
  
IO	
  preserva`on.	
  P/S	
  
dups	
  are	
  equivalent.	
  
Convergent	
  
Rollback	
  
T
1	
  
T
2	
  
T
3	
  
X
2	
  
X
3	
  
X
4	
  
IO	
  preserva`on.	
  P/S	
  
dups	
  may	
  differ	
  ini`ally	
  
but	
  EC.	
  
Divergent	
  Rollback	
   T
1	
  
T
2	
  
T
3	
  
X
2	
  
X
3	
  
X	
  
4	
  
IO	
  preserva`on.	
  P/S	
  
dups	
  will	
  differ	
  
IIBECM
Copyright	
  Push	
  Technology	
  2012	
  
But,	
  problem:	
  The	
  bird,	
  basically.	
  
Immediately	
  Inconsistent.	
  
But,	
  Eventually	
  Consistent	
  
…	
  Maybe.	
  
	
  
	
  
	
  
Humans	
  
Hate	
  
Repea*ng	
  
Rollback	
  
Recovery	
   IIBECM
Copyright	
  Push	
  Technology	
  2012	
  
Ugh,	
  just	
  one	
  more	
  thing	
  …	
  
Data	
  rarely	
  passes	
  through	
  a	
  box	
  without	
  being	
  fiddled	
  with.	
  
State?	
  
Finagle Finagle
Copyright	
  Push	
  Technology	
  2012	
  
Streaming	
  Opera*ons	
  –	
  4	
  types	
  
hgp://nms.lcs.mit.edu/papers/ha-­‐icde05.pdf	
  -­‐	
  HA	
  algos	
  for	
  DSPs	
  	
  
Type	
   Comments	
  
Arbitrary	
   Completely	
  masks	
  failure.	
  
Determinis*c	
   Given	
  Same	
  Input,	
  Same	
  State,	
  produce	
  Same	
  Output	
  
Convergent-­‐capable	
   Given	
  Same	
  Input,	
  Earlier	
  Start,	
  Empty	
  State,	
  converge	
  
to	
  Same	
  Output	
  as	
  Determinis`c	
  case	
  
Repeatable	
   Given	
  Same	
  Input,	
  Earlier	
  State,	
  Empty	
  State,	
  requires	
  
at	
  most	
  one	
  input	
  to	
  product	
  at	
  most	
  one	
  output	
  to	
  be	
  
convergent-­‐capable	
  and	
  same	
  as	
  determinis`c	
  case	
  
Copyright	
  Push	
  Technology	
  2012	
  
DOH?	
  
Data	
  Recovery	
  Type	
  
x	
  Opera*on	
  Type	
  =	
  
The	
  Hard	
  Part	
  
Copyright	
  Push	
  Technology	
  2012	
  
Just	
  one	
  last	
  one	
  more	
  thing	
  …	
  
We	
  are	
  fickle,	
  grumpy,	
  changeable,	
  intolerant	
  …	
  
Human	
  
Expecta*ons	
  
Copyright	
  Push	
  Technology	
  2012	
  
Let’s	
  see.	
  Trading	
  systems?	
  
There	
  are	
  at	
  least	
  26	
  race	
  condi`ons	
  in	
  	
  
FIX	
  4.2	
  Order	
  Cancel/Replace/Reject	
  
Broker
Dealer
Service
Market
Data
Fat Cat
Banker
Orders
Trades
Market
Execution
"Flow"
Prices Prices
Market
Data
Market
Data
Market
Data
Market
Execution
Market
Execution
Market
Execution
Precise Recovery
Gap Recovery
It Depends…
It's Complicated!
And	
  please.	
  No	
  stale	
  data!	
  
Copyright	
  Push	
  Technology	
  2012	
  
A	
  most	
  inconvenient	
  truth	
  
So	
  relax.	
  Let	
  it	
  fail.	
  Let	
  live	
  and	
  let’s	
  learn.	
  
Simple	
  is	
  
Hard	
  
Copyright	
  Push	
  Technology	
  2012	
  
Stop.	
  
- The	
  network	
  is	
  not	
  reliable	
  	
  
nor	
  is	
  it	
  cost	
  free.	
  
- Latency	
  is	
  not	
  zero	
  
nor	
  is	
  it	
  a	
  democracy.	
  
- Bandwidth	
  is	
  not	
  infinite	
  
nor	
  predictable	
  especially	
  the	
  last	
  mile!	
  
- There	
  is	
  not	
  only	
  one	
  administrator	
  
trust,	
  rela`onships	
  are	
  key	
  
- Topology	
  does	
  change	
  
It	
  should,	
  however,	
  converge	
  eventually	
  
- The	
  network	
  is	
  not	
  secure	
  
nor	
  is	
  the	
  data	
  that	
  flows	
  through	
  it	
  
- Transport	
  cost	
  is	
  not	
  zero	
  
but	
  what	
  you	
  don’t	
  do	
  is	
  free	
  
- The	
  network	
  is	
  not	
  homogeneous	
  
nor	
  is	
  it	
  smart	
  
Copyright	
  Push	
  Technology	
  2012	
  
Look.	
  
- 	
  High	
  Availability	
  is	
  not	
  enough	
  for	
  Machine	
  to	
  Human	
  
- 	
  High	
  Experience	
  requires	
  more	
  
Data	
  has	
  a	
  *me	
  value	
  –	
  out	
  of	
  date	
  data	
  is	
  bad.	
  
Data	
  has	
  variable	
  relevance,	
  based	
  on	
  loca*on,	
  device	
  …	
  
Data	
  rates	
  are	
  faster	
  than	
  human	
  percep*on	
  
You	
  cannot	
  send	
  100mb/sec	
  down	
  3G	
  networks	
  
You	
  cannot	
  send	
  100mb/sec	
  down	
  3G	
  networks	
  
You	
  cannot	
  …	
  waste	
  is	
  bad,	
  bloats	
  buffers,	
  and	
  ‘slows’	
  data.	
  
Currency	
  &	
  (Immediate)	
  Consistency	
  are	
  important	
  in	
  M2H.	
  
- 	
  M2H	
  ‘High	
  Available	
  Experience’	
  might	
  work	
  for	
  M2M	
  …	
  
	
  
Copyright	
  Push	
  Technology	
  2012	
  
Listen.	
  
- 	
  Every	
  nuance	
  comes	
  with	
  a	
  set	
  of	
  tradeoffs.	
  
- 	
  Choosing	
  the	
  right	
  ones	
  can	
  be	
  hard,	
  but	
  it	
  pays	
  off.	
  
- 	
  Context,	
  Environment	
  are	
  cri`cal	
  
- 	
  Break	
  all	
  the	
  rules,	
  one	
  benchmark	
  at	
  a	
  `me.	
  
	
  
- 	
  Benchmark	
  Driven	
  Development	
  
Copyright	
  Push	
  Technology	
  2012	
  
Ac`on:	
  Data	
  Distribu`on	
  
Messaging	
  remixed	
  around:	
  
	
  
Relevance 	
  -­‐ 	
  Queue	
  depth	
  for	
  conflatable	
  data	
  should	
  be	
  0	
  or	
  1.	
  No	
  more	
  
	
  
Responsiveness	
  -­‐	
  Use	
  HTTP/REST	
  for	
  things.	
  Stream	
  the	
  ligle	
  things	
  
	
  
Timeliness 	
  -­‐ 	
  It’s	
  rela`ve.	
  M2M	
  !=	
  M2H.	
  
	
  
Context	
   	
  -­‐ 	
  Packed	
  binary,	
  deltas	
  mostly,	
  snapshot	
  on	
  subscribe.	
  
	
  
Environment	
  -­‐ 	
  Don’t	
  send	
  1M	
  1K	
  events	
  to	
  a	
  mobile	
  phone	
  with	
  0.5mbps.	
  
Copyright	
  Push	
  Technology	
  2012	
  
Ac`on.	
  Virtualize	
  Client	
  Queues	
  
Buffer
Bloat
Producers Consumers
A
B
ba
bb
Nuance:	
  Client	
  telemetry.	
  Tradeoff:	
  Durable	
  subscrip`ons	
  harder	
  
Copyright	
  Push	
  Technology	
  2012	
  
Ac`on.	
  Add	
  data	
  caching	
  
One	
  hop	
  closer	
  to	
  the	
  edge	
  …	
  
Is it a
cache?
Producers Consumers
A
B
ba
bb x
x
Copyright	
  Push	
  Technology	
  2012	
  
Ac`on.	
  Exploit	
  data	
  structure	
  
Snapshot	
  recovery.	
  Deltas	
  or	
  Changes	
  mostly.	
  Conserves	
  bandwidth	
  
State!Producers Consumers
A
B
ba
bb x
x
Snapshot Delta
Copyright	
  Push	
  Technology	
  2012	
  
Ac`on.	
  Behaviors	
  
Extensible.	
  Nuance?	
  Roll	
  your	
  own	
  protocols.	
  Tradeoff?	
  3rd	
  party	
  code	
  in	
  the	
  engine	
  :/	
  
The
topic is
the
cloud!
Producers Consumers
A
B
ba
bb x
x
X
Copyright	
  Push	
  Technology	
  2012	
  
3rd	
  Party	
  Code	
  in	
  the	
  Engine?	
  
•  A	
  bug	
  in	
  3rd	
  party	
  code	
  can	
  take	
  out	
  the	
  system.	
  
•  Is	
  necessary	
  in	
  many	
  environments.	
  
•  Can	
  force	
  low	
  density	
  deployments.	
  
•  Solu`ons	
  are	
  appearing,	
  such	
  as	
  Waratek	
  for	
  the	
  JVM.	
  
•  You	
  can	
  hive	
  out	
  3rd	
  party	
  code	
  into	
  a	
  lightweight	
  
fully	
  isolated	
  container.	
  
•  You	
  can	
  manage	
  the	
  container	
  lifecycle.	
  
•  You	
  can	
  reallocate	
  memory,	
  CPU,	
  network.	
  
•  It’s	
  language	
  level	
  virtualiza`on.	
  
Copyright	
  Push	
  Technology	
  2012	
  
Ac`on.	
  Structural	
  Confla`on	
  
Ensures	
  only	
  current	
  +	
  consistent	
  data	
  is	
  distributed.	
  Ac`vely	
  soaks	
  up	
  bloat.	
  Extensible!	
  
Current
data!
Producers Consumers
A
B
ba
bb x
x
X
+
Copyright	
  Push	
  Technology	
  2012	
  
Ac`on.	
  Structural	
  Confla`on	
  [EEP]	
  
•  Replace/Overwrite	
  ‘A1’	
  with	
  ‘A2’	
  
•  ‘Current	
  data	
  right	
  now’	
  
•  Fast	
  
•  Merge	
  A1,	
  A2	
  under	
  some	
  opera`on.	
  
•  Opera`on	
  is	
  pluggable	
  
•  Tunable	
  consistency	
  
•  Performance	
  f(opera`on)	
  
Replace	
   Merge	
  
Cop Bop Aop ... ...C2 A2 C1 B1 A1 'op'
C2 B1 A2C2 A2 C1 B1 A1 R
C2 B1 A+C2 A2 C1 B1 A1 M+
12345 5
=
A2 + A1
=
4 + 1
1
12345 415
8
=
C2 + C1
=
5 + 3
Current	
  
Current	
  
+	
  	
  
Consistent	
  
Copyright	
  Push	
  Technology	
  2012	
  
Client?	
  Connec`on	
  &	
  Transport	
  
Cascading	
  
WebSockets Flash
diffusion.js
native
out of the box on the web and mobile web
}
Bespoke cascading -
Have your cake and eat it
Copyright	
  Push	
  Technology	
  2012	
  
An	
  extreme	
  example.	
  
Box A Box B
•  Ramp	
  clients	
  con`nuously	
  
•  100	
  messages	
  per	
  second	
  per	
  client	
  
•  Payload:	
  125	
  ..	
  2000	
  bytes	
  
•  Message	
  style	
  vs	
  with	
  confla`on	
  
•  Really	
  simple.	
  1	
  client	
  
•  Ping	
  –	
  Pong.	
  Measure	
  RTT	
  `me.	
  
•  Payload:	
  125	
  ..	
  2000	
  bytes	
  
Throughput	
  (Worst	
  case)	
   Latency	
  (Best	
  case)	
  
Copyright	
  Push	
  Technology	
  2012	
  
Latency	
  in	
  perspec`ve	
  
•  2.4	
  us.	
  A	
  tuned	
  benchmark	
  in	
  C	
  with	
  low	
  latency	
  10Ge	
  NIC,	
  with	
  kernel	
  
bypass,	
  with	
  FPGA	
  accelera`on	
  
•  5.0	
  us.	
  A	
  basic	
  java	
  benchmark	
  –	
  as	
  good	
  as	
  it	
  gets	
  in	
  java	
  
•  Diffusion	
  is	
  measurably	
  ‘moving	
  to	
  the	
  le•’	
  release	
  on	
  release	
  
•  We’ve	
  been	
  ac`vely	
  tracking	
  and	
  con`nuously	
  improving	
  since	
  4.0	
  
2.4 us 5.0 us 8.0 us 50.0 us
~
1000
bytes
(avg)
~
125
bytes
(avg)
Copyright	
  Push	
  Technology	
  2012	
  
Throughput.	
  Server	
  view.	
  Non-­‐
conflated	
  data	
  
•  Cold	
  start	
  server	
  
•  Ramp	
  750	
  clients	
  ‘simultaneously’	
  at	
  5	
  
second	
  intervals	
  
	
  
•  5	
  minute	
  benchmark	
  dura`on	
  
•  Clients	
  onboarded	
  linearly	
  un`l	
  IO	
  
(here)	
  or	
  compute	
  satura`on	
  occurs.	
  
	
  
•  What	
  the	
  ‘server’	
  sees	
  
Copyright	
  Push	
  Technology	
  2012	
  
Throughput.	
  Client	
  view.	
  Non-­‐
conflated	
  data.	
  
•  What	
  the	
  ‘client’	
  sees	
  
	
  
•  At	
  and	
  beyond	
  satura`on	
  of	
  some	
  
resource?	
  
•  Things	
  break!	
  
	
  
•  New	
  connec`ons	
  fail.	
  Good.	
  
•  Long	
  established	
  connec`ons	
  ok.	
  
•  Recent	
  connec`ons	
  `meout	
  and	
  client	
  
connec`ons	
  are	
  dropped.	
  Good.	
  
•  Diffusion	
  handles	
  smaller	
  message	
  
sizes	
  more	
  gracefully	
  
	
  
•  Back-­‐pressure	
  ‘waveform’	
  can	
  be	
  
tuned	
  out.	
  Or,	
  you	
  could	
  use	
  structural	
  
confla`on!	
  
Copyright	
  Push	
  Technology	
  2012	
  
Throughput.	
  Server	
  view.	
  Replace-­‐
conflated	
  
•  Cold	
  start	
  server	
  
	
  
•  Ramp	
  750	
  clients	
  ‘simultaneously’	
  at	
  5	
  
second	
  intervals	
  
	
  
•  5	
  minute	
  benchmark	
  dura`on	
  
•  Clients	
  onboarded	
  linearly	
  un`l	
  IO	
  
(here)	
  or	
  compute	
  satura`on	
  occurs.	
  
	
  
•  Takes	
  longer	
  to	
  saturate	
  than	
  non-­‐
conflated	
  case	
  
	
  
•  Handles	
  more	
  concurrent	
  connec`ons	
  
	
  
•  Again,	
  ‘server’	
  view	
  
Copyright	
  Push	
  Technology	
  2012	
  
Throughput.	
  Client	
  view.	
  Replace-­‐
Conflated	
  
•  What	
  the	
  ‘client’	
  sees	
  
	
  
•  Once	
  satura`on	
  occurs	
  Diffusion	
  
adapts	
  ac`vely	
  by	
  degrading	
  messages	
  
per	
  second	
  per	
  client	
  
	
  
•  This	
  is	
  good.	
  Soak	
  up	
  the	
  peaks	
  
through	
  fairer	
  distribu`on	
  of	
  data.	
  
	
  
•  Handles	
  spikes	
  in	
  number	
  of	
  
connec`ons,	
  volume	
  of	
  data	
  or	
  
satura`on	
  of	
  other	
  resources	
  using	
  a	
  
single	
  load	
  adap`ve	
  mechanism	
  
Copyright	
  Push	
  Technology	
  2012	
  
Can	
  failure	
  be	
  fun?	
  
•  Where	
  do	
  HA	
  algorithms	
  fail	
  
humans?	
  
•  Can	
  consistent	
  experiences	
  be	
  
delivered	
  elapsing	
  short,	
  medium	
  
and	
  longer	
  term	
  failures?	
  
•  Does	
  an	
  M2H	
  eye	
  for	
  an	
  M2M	
  guy	
  
even	
  work?	
  	
  
Copyright	
  Push	
  Technology	
  2012	
  
Who	
  knows.	
  Let’s	
  figure	
  it	
  out!	
  J	
  
HA!	
  HA!	
  
W8!!	
  
Copyright	
  Push	
  Technology	
  2012	
  
My	
  ‘number’	
  
#6752	
  
Copyright	
  Push	
  Technology	
  2012	
  
Darach@PushTechnology.com	
  
Ques`ons?	
  
•  Thank	
  you	
  for	
  listening	
  to,	
  having	
  me	
  
	
  
•  Le	
  twiger:	
  @darachennis	
  
	
  
•  Work.	
  hgp://www.pushtechnology.com/	
  
•  Fun.	
  hgp://github.com/darach/	
  
•  Grab	
  me	
  any	
  `me	
  on	
  Weds/Thurs.	
  
	
  
•  Like	
  Erlang?	
  Big	
  Data?	
  
London	
  User	
  Group	
  meetup.	
  
Thurs	
  March	
  7th,	
  QE2	
  18:30	
  –	
  20:00.	
  
(Google	
  for	
  registra`on	
  details).	
  
	
  	
  

Más contenido relacionado

Más de C4Media

Más de C4Media (20)

Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery Teams
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in Adtech
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaOpportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven Utopia
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
 
Are We Really Cloud-Native?
Are We Really Cloud-Native?Are We Really Cloud-Native?
Are We Really Cloud-Native?
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Highly Available Near Real-time Data Distribution Beyond the Network Edge

  • 1. Copyright  Push  Technology  2012   QCON   London  2013  
  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /real-time-data-distribution
  • 3. Presented at QCon London www.qconlondon.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. Copyright  Push  Technology  2012   My  ‘number’   #6752  
  • 5. Copyright  Push  Technology  2012   Darach@PushTechnology.com   About  me?   •  Distributed  Systems  /  HPC  guy.     •  Chief  Scien*st  :-­‐  at  Push  Technology   •  Alumnus  of  :-­‐       Motorola,  IONA,  BeTair,  JPMC,  StreamBase.   •  School:  Trinity  College  Dublin.     -­‐  BA  (Mod).  Comp.  Sci.+     -­‐  M.Sc.  Networks  &  Distributed  Systems       •  Responds  to:  Guinness,  Whisky  
  • 6. Copyright  Push  Technology  2012   Highly  Available   Real-­‐Time   Data  Distribu`on   at  the  network’s   Edge  
  • 7. Copyright  Push  Technology  2012   HA.  Black  swans  &  Pigfish!  
  • 8. Copyright  Push  Technology  2012   When  this  …   Service   esse  hic   draconum  
  • 9. Copyright  Push  Technology  2012   …  inevitably  happens   HA!  HA!   W8!!  
  • 10. Copyright  Push  Technology  2012   Over  the  Edge,  where  Fallacies  roam   - The  network  is  reliable   - Latency  is  zero     - Bandwidth  is  infinite   - There  is  one  administrator   - Topology  does  not  change   - The  network  is  secure   - Transport  cost  is  zero   - The  network  is  homogeneous     hgp://en.wikipedia.org/wiki/Fallacies_of_Distributed_Compu`ng      
  • 11. Copyright  Push  Technology  2012   &  the  last  mile.  Dragons  there  be.   y  =  -­‐1.1667x  +  45703   R²  =  0.02496   1.00E+00   1.00E+01   1.00E+02   1.00E+03   1.00E+04   sep./06   okt./06   okt./06   nov./06   dec./06   dec./06   jan./07   feb./07   Latency   Latency  (ms)   Expected  (ms)   Linear  (Latency  (ms))   -­‐10.00   0.00   10.00   20.00   30.00   sep./06   okt./06   okt./06   nov./06   dec./06   dec./06   jan./07   feb./07   Download  Bandwidth   Expected  (Mbps)   Download  (Mbps)   Buffer   Bloat   Cell   Coverage   Bagery!  
  • 12. Copyright  Push  Technology  2012   Distributed  Systems   “A  distributed  system  is  one  in   which  the  failure  of  a  computer   you  didn’t  even  know  existed   can  render  your  computer   unusable”   -­‐  Leslie  Lamport  
  • 13. Copyright  Push  Technology  2012   High  Availability   “The  price  of  reliability  is  the   pursuit  of  the  utmost  simplicity.”   -­‐  Sir  Tony  Hoare,  Turing  Award  speech,  1980       “This  is  the  unfortunate  truth:   Simplicity  is  Hard.”              -­‐    Mosely  &  Marks,  Out  of  the  Tar  Pit,  2006  
  • 14. Copyright  Push  Technology  2012   High  Experiences  ~  Man  vs  Machine   Image:  hgp://www.phillymarke`nglabs.com/man-­‐vs-­‐machine/    
  • 15. Copyright  Push  Technology  2012   Machines  are  ‘Easy’   A  more  unfortunate  truth  is:     Humans*  are  Harder.       Allegedly  Sergey*  can  be  Emasculated   by  Glass.  But,  I  bet  he  owns  a  god  phone.              *  Humans  are  grumpy!                                  *  Colors  chosen  at  random  
  • 16. Copyright  Push  Technology  2012   Once  Upon  a  *me  …   SPOF There  was  a  very  useful  ligle  single  point  of  failure.  
  • 17. Copyright  Push  Technology  2012   It  was  so  successful   SPOF It  grew  and  it  grew!  So  we  put  it  in  the  cloud.  
  • 18. Copyright  Push  Technology  2012   It  grew,  and  it  grew  …   SPOF We  touched  it  with  all  of  our  devices.  
  • 19. Copyright  Push  Technology  2012   See  SPOF  run!   SPOF We  all  touched  it  except  Sergey  ‘the  emasculated  one’  
  • 20. Copyright  Push  Technology  2012   See  SPOF  spew  L   Is  there  nothing  we  can  do?  Esse  hic  draconum,  basically.  But,  yes  we  can  too  …   Wat?
  • 21. Copyright  Push  Technology  2012   Bad  things  happen  …   RapGenius   vs   Heroku.     Anyone?   Ferris?   It’s  either  dyno  park  this  or  whale  fail  in  the  zoo  …  
  • 22. Copyright  Push  Technology  2012   So  we  spun  up  another  instance   And  master  /  slave  dabbled  with  us   Master Slave
  • 23. Copyright  Push  Technology  2012   Ac*ve/Passive  –  Maybe?   MTTR  rela`vely  high.  MTBF  rela`vely  low.    Ok  for     ‘nice-­‐to-­‐have’  or    ‘too-­‐late-­‐to-­‐cry-­‐now’    facili`es.     Active (Hot) Passive (Cold)
  • 24. Copyright  Push  Technology  2012   Ac*ve/Passive  –  Hmm?   MTTR  slightly  beger.  Can  replicate  state  ac`vely  for  cheaper  recovery.   Active (Hot) Passive (Warm)
  • 25. Copyright  Push  Technology  2012   Ac*ve/Ac*ve  –  Ugh…   MTTR  negligeable.  Use  2x  the  bandwidth.  Get  ‘half’  the  value.  Dups     Master Slave Active (Hot) Active (Hot)
  • 26. Copyright  Push  Technology  2012   Ac*ve/Ac*ve  –  Ugh…   MTTR  negligeable.  Minify  bandwidth  usage  mostly.    Dups     Active (Hot) Active (Warm)
  • 27. Copyright  Push  Technology  2012   Ac*ve/Ac*ve  –  Ugh…   MTTR  negligeable.  Minify  bandwidth  usage  mostly.    Dups     Active (Hot) Active (Warm)
  • 28. Copyright  Push  Technology  2012   Spin  up  another  box?   Failback,  Failover,  Takeover?  Load  Balance?  This  is  gesng  costly!   Active (Hot) Passive (Cold) Standby (Cold) Speak no evil Hear no evil See no evil
  • 29. Copyright  Push  Technology  2012   Can  implement  N-­‐Plex  HA  with  a   ‘simple’  FSM   Consider  roles  for  Applica`on,  Controller,  callbacks,  …   Initial Booting Boot/DoBoot Sync'ing Sync/DoSyncStart Switching Switching/DoSwitch Standby Standby/DoSyncEnd Active Active/DoSwtichDone Swtich/DoStandbyActivate Stopping Stop/DoStopStart Standby/DoStopDone
  • 30. Copyright  Push  Technology  2012   Spin  up  a  cluster,  ring?   Master Slave SlaveSlave SlaveSlave Slave Slave A  simple  implementa`on  can  be   easier  to  build  than  HA  pairs.  Your   mileage  may  vary.  Can  be  masterless   too.       Where  possible,  use  exis`ng   solu`ons  such  as  Akka,  riak_core,   doozer,  Apache  Zookeeper.     You’ll  s`ll  need  to  roll  your  own   data  recovery  -­‐  mostly.  Although   CRDT’s  are  changing  that  in  the   database  community.  
  • 31. Copyright  Push  Technology  2012   One  more  thing  …  Real-­‐Time  streams   Real-­‐`me  data  streams  are  long-­‐lived,  conversa`onal,  can  be  stateful.     Meh Meh Data!  
  • 32. Copyright  Push  Technology  2012   Streaming  Data  Recovery   hgp://nms.lcs.mit.edu/papers/ha-­‐icde05.pdf  -­‐  HA  algos  for  DSPs     Type   Before   A]er   Comments   Precise   T 1   T 2   T 3   T 4   T 5   T 6   Completely  masks   failure.   Gap   T 1   T 2   T 3   ?   T 5   T 6   May  result  in  data  loss   Repea*ng  Rollback   T 1   T 2   T 3   T 2   T 3   T 4   IO  preserva`on.  P/S   dups  are  equivalent.   Convergent   Rollback   T 1   T 2   T 3   X 2   X 3   X 4   IO  preserva`on.  P/S   dups  may  differ  ini`ally   but  EC.   Divergent  Rollback   T 1   T 2   T 3   X 2   X 3   X   4   IO  preserva`on.  P/S   dups  will  differ   IIBECM
  • 33. Copyright  Push  Technology  2012   But,  problem:  The  bird,  basically.   Immediately  Inconsistent.   But,  Eventually  Consistent   …  Maybe.         Humans   Hate   Repea*ng   Rollback   Recovery   IIBECM
  • 34. Copyright  Push  Technology  2012   Ugh,  just  one  more  thing  …   Data  rarely  passes  through  a  box  without  being  fiddled  with.   State?   Finagle Finagle
  • 35. Copyright  Push  Technology  2012   Streaming  Opera*ons  –  4  types   hgp://nms.lcs.mit.edu/papers/ha-­‐icde05.pdf  -­‐  HA  algos  for  DSPs     Type   Comments   Arbitrary   Completely  masks  failure.   Determinis*c   Given  Same  Input,  Same  State,  produce  Same  Output   Convergent-­‐capable   Given  Same  Input,  Earlier  Start,  Empty  State,  converge   to  Same  Output  as  Determinis`c  case   Repeatable   Given  Same  Input,  Earlier  State,  Empty  State,  requires   at  most  one  input  to  product  at  most  one  output  to  be   convergent-­‐capable  and  same  as  determinis`c  case  
  • 36. Copyright  Push  Technology  2012   DOH?   Data  Recovery  Type   x  Opera*on  Type  =   The  Hard  Part  
  • 37. Copyright  Push  Technology  2012   Just  one  last  one  more  thing  …   We  are  fickle,  grumpy,  changeable,  intolerant  …   Human   Expecta*ons  
  • 38. Copyright  Push  Technology  2012   Let’s  see.  Trading  systems?   There  are  at  least  26  race  condi`ons  in     FIX  4.2  Order  Cancel/Replace/Reject   Broker Dealer Service Market Data Fat Cat Banker Orders Trades Market Execution "Flow" Prices Prices Market Data Market Data Market Data Market Execution Market Execution Market Execution Precise Recovery Gap Recovery It Depends… It's Complicated! And  please.  No  stale  data!  
  • 39. Copyright  Push  Technology  2012   A  most  inconvenient  truth   So  relax.  Let  it  fail.  Let  live  and  let’s  learn.   Simple  is   Hard  
  • 40. Copyright  Push  Technology  2012   Stop.   - The  network  is  not  reliable     nor  is  it  cost  free.   - Latency  is  not  zero   nor  is  it  a  democracy.   - Bandwidth  is  not  infinite   nor  predictable  especially  the  last  mile!   - There  is  not  only  one  administrator   trust,  rela`onships  are  key   - Topology  does  change   It  should,  however,  converge  eventually   - The  network  is  not  secure   nor  is  the  data  that  flows  through  it   - Transport  cost  is  not  zero   but  what  you  don’t  do  is  free   - The  network  is  not  homogeneous   nor  is  it  smart  
  • 41. Copyright  Push  Technology  2012   Look.   -   High  Availability  is  not  enough  for  Machine  to  Human   -   High  Experience  requires  more   Data  has  a  *me  value  –  out  of  date  data  is  bad.   Data  has  variable  relevance,  based  on  loca*on,  device  …   Data  rates  are  faster  than  human  percep*on   You  cannot  send  100mb/sec  down  3G  networks   You  cannot  send  100mb/sec  down  3G  networks   You  cannot  …  waste  is  bad,  bloats  buffers,  and  ‘slows’  data.   Currency  &  (Immediate)  Consistency  are  important  in  M2H.   -   M2H  ‘High  Available  Experience’  might  work  for  M2M  …    
  • 42. Copyright  Push  Technology  2012   Listen.   -   Every  nuance  comes  with  a  set  of  tradeoffs.   -   Choosing  the  right  ones  can  be  hard,  but  it  pays  off.   -   Context,  Environment  are  cri`cal   -   Break  all  the  rules,  one  benchmark  at  a  `me.     -   Benchmark  Driven  Development  
  • 43. Copyright  Push  Technology  2012   Ac`on:  Data  Distribu`on   Messaging  remixed  around:     Relevance  -­‐  Queue  depth  for  conflatable  data  should  be  0  or  1.  No  more     Responsiveness  -­‐  Use  HTTP/REST  for  things.  Stream  the  ligle  things     Timeliness  -­‐  It’s  rela`ve.  M2M  !=  M2H.     Context    -­‐  Packed  binary,  deltas  mostly,  snapshot  on  subscribe.     Environment  -­‐  Don’t  send  1M  1K  events  to  a  mobile  phone  with  0.5mbps.  
  • 44. Copyright  Push  Technology  2012   Ac`on.  Virtualize  Client  Queues   Buffer Bloat Producers Consumers A B ba bb Nuance:  Client  telemetry.  Tradeoff:  Durable  subscrip`ons  harder  
  • 45. Copyright  Push  Technology  2012   Ac`on.  Add  data  caching   One  hop  closer  to  the  edge  …   Is it a cache? Producers Consumers A B ba bb x x
  • 46. Copyright  Push  Technology  2012   Ac`on.  Exploit  data  structure   Snapshot  recovery.  Deltas  or  Changes  mostly.  Conserves  bandwidth   State!Producers Consumers A B ba bb x x Snapshot Delta
  • 47. Copyright  Push  Technology  2012   Ac`on.  Behaviors   Extensible.  Nuance?  Roll  your  own  protocols.  Tradeoff?  3rd  party  code  in  the  engine  :/   The topic is the cloud! Producers Consumers A B ba bb x x X
  • 48. Copyright  Push  Technology  2012   3rd  Party  Code  in  the  Engine?   •  A  bug  in  3rd  party  code  can  take  out  the  system.   •  Is  necessary  in  many  environments.   •  Can  force  low  density  deployments.   •  Solu`ons  are  appearing,  such  as  Waratek  for  the  JVM.   •  You  can  hive  out  3rd  party  code  into  a  lightweight   fully  isolated  container.   •  You  can  manage  the  container  lifecycle.   •  You  can  reallocate  memory,  CPU,  network.   •  It’s  language  level  virtualiza`on.  
  • 49. Copyright  Push  Technology  2012   Ac`on.  Structural  Confla`on   Ensures  only  current  +  consistent  data  is  distributed.  Ac`vely  soaks  up  bloat.  Extensible!   Current data! Producers Consumers A B ba bb x x X +
  • 50. Copyright  Push  Technology  2012   Ac`on.  Structural  Confla`on  [EEP]   •  Replace/Overwrite  ‘A1’  with  ‘A2’   •  ‘Current  data  right  now’   •  Fast   •  Merge  A1,  A2  under  some  opera`on.   •  Opera`on  is  pluggable   •  Tunable  consistency   •  Performance  f(opera`on)   Replace   Merge   Cop Bop Aop ... ...C2 A2 C1 B1 A1 'op' C2 B1 A2C2 A2 C1 B1 A1 R C2 B1 A+C2 A2 C1 B1 A1 M+ 12345 5 = A2 + A1 = 4 + 1 1 12345 415 8 = C2 + C1 = 5 + 3 Current   Current   +     Consistent  
  • 51. Copyright  Push  Technology  2012   Client?  Connec`on  &  Transport   Cascading   WebSockets Flash diffusion.js native out of the box on the web and mobile web } Bespoke cascading - Have your cake and eat it
  • 52. Copyright  Push  Technology  2012   An  extreme  example.   Box A Box B •  Ramp  clients  con`nuously   •  100  messages  per  second  per  client   •  Payload:  125  ..  2000  bytes   •  Message  style  vs  with  confla`on   •  Really  simple.  1  client   •  Ping  –  Pong.  Measure  RTT  `me.   •  Payload:  125  ..  2000  bytes   Throughput  (Worst  case)   Latency  (Best  case)  
  • 53. Copyright  Push  Technology  2012   Latency  in  perspec`ve   •  2.4  us.  A  tuned  benchmark  in  C  with  low  latency  10Ge  NIC,  with  kernel   bypass,  with  FPGA  accelera`on   •  5.0  us.  A  basic  java  benchmark  –  as  good  as  it  gets  in  java   •  Diffusion  is  measurably  ‘moving  to  the  le•’  release  on  release   •  We’ve  been  ac`vely  tracking  and  con`nuously  improving  since  4.0   2.4 us 5.0 us 8.0 us 50.0 us ~ 1000 bytes (avg) ~ 125 bytes (avg)
  • 54. Copyright  Push  Technology  2012   Throughput.  Server  view.  Non-­‐ conflated  data   •  Cold  start  server   •  Ramp  750  clients  ‘simultaneously’  at  5   second  intervals     •  5  minute  benchmark  dura`on   •  Clients  onboarded  linearly  un`l  IO   (here)  or  compute  satura`on  occurs.     •  What  the  ‘server’  sees  
  • 55. Copyright  Push  Technology  2012   Throughput.  Client  view.  Non-­‐ conflated  data.   •  What  the  ‘client’  sees     •  At  and  beyond  satura`on  of  some   resource?   •  Things  break!     •  New  connec`ons  fail.  Good.   •  Long  established  connec`ons  ok.   •  Recent  connec`ons  `meout  and  client   connec`ons  are  dropped.  Good.   •  Diffusion  handles  smaller  message   sizes  more  gracefully     •  Back-­‐pressure  ‘waveform’  can  be   tuned  out.  Or,  you  could  use  structural   confla`on!  
  • 56. Copyright  Push  Technology  2012   Throughput.  Server  view.  Replace-­‐ conflated   •  Cold  start  server     •  Ramp  750  clients  ‘simultaneously’  at  5   second  intervals     •  5  minute  benchmark  dura`on   •  Clients  onboarded  linearly  un`l  IO   (here)  or  compute  satura`on  occurs.     •  Takes  longer  to  saturate  than  non-­‐ conflated  case     •  Handles  more  concurrent  connec`ons     •  Again,  ‘server’  view  
  • 57. Copyright  Push  Technology  2012   Throughput.  Client  view.  Replace-­‐ Conflated   •  What  the  ‘client’  sees     •  Once  satura`on  occurs  Diffusion   adapts  ac`vely  by  degrading  messages   per  second  per  client     •  This  is  good.  Soak  up  the  peaks   through  fairer  distribu`on  of  data.     •  Handles  spikes  in  number  of   connec`ons,  volume  of  data  or   satura`on  of  other  resources  using  a   single  load  adap`ve  mechanism  
  • 58. Copyright  Push  Technology  2012   Can  failure  be  fun?   •  Where  do  HA  algorithms  fail   humans?   •  Can  consistent  experiences  be   delivered  elapsing  short,  medium   and  longer  term  failures?   •  Does  an  M2H  eye  for  an  M2M  guy   even  work?    
  • 59. Copyright  Push  Technology  2012   Who  knows.  Let’s  figure  it  out!  J   HA!  HA!   W8!!  
  • 60. Copyright  Push  Technology  2012   My  ‘number’   #6752  
  • 61. Copyright  Push  Technology  2012   Darach@PushTechnology.com   Ques`ons?   •  Thank  you  for  listening  to,  having  me     •  Le  twiger:  @darachennis     •  Work.  hgp://www.pushtechnology.com/   •  Fun.  hgp://github.com/darach/   •  Grab  me  any  `me  on  Weds/Thurs.     •  Like  Erlang?  Big  Data?   London  User  Group  meetup.   Thurs  March  7th,  QE2  18:30  –  20:00.   (Google  for  registra`on  details).