-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
309 lines (284 loc) · 8.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=1024, user-scalable=no">
<title>Kafka, Storm, node.js and D3</title>
<!-- Required stylesheet -->
<link rel="stylesheet" href="core/deck.core.css">
<!-- Extension CSS files go here. Remove or add as needed. -->
<link rel="stylesheet" href="extensions/goto/deck.goto.css">
<link rel="stylesheet" href="extensions/menu/deck.menu.css">
<!-- <link rel="stylesheet" href="extensions/navigation/deck.navigation.css"> -->
<link rel="stylesheet" href="extensions/status/deck.status.css">
<link rel="stylesheet" href="extensions/hash/deck.hash.css">
<link rel="stylesheet" href="extensions/scale/deck.scale.css">
<!-- Style theme. More available in /themes/style/ or create your own. -->
<link rel="stylesheet" href="themes/style/swiss.css">
<!-- Transition theme. More available in /themes/transition/ or create your own. -->
<link rel="stylesheet" href="themes/transition/fade.css">
<!-- Code snippets -->
<link rel="stylesheet" href="prettify.css">
<link rel="stylesheet" href="presentation.css">
</head>
<body class="deck-container">
<section class="slide">
<h2>LivePerson</h2>
<h3>Real-time Customer Engagement Platform</h3>
<ul>
<li><strong>High Touch</strong> Video, Voice, Chat</li>
<li><strong>Low Touch</strong> Offers, Knowledge Base</li>
<li><strong>Choosing the best engagement is the name of the game</strong></li>
</ul>
<h3>Highly varied data to support decisioning</h3>
<ul>
<li>Web analytics (page flow, on-page time, etc)</li>
<li>Survey Data</li>
<li>Chat Transcripts</li>
<li>Transient Customer Data</li>
</ul>
</section>
<section class="slide">
<h2>For a bunch of customers</h2>
<h3>Roughly 9,000 customers</h3>
<ul>
<li>From household names to small business.</li>
<li>1.8 billion sessions/month</li>
<li>20 million chats/month.</li>
</ul>
<h3>Who want to know about things in real-time</h3>
<ul>
<li>Work-force management (people hate being on hold)</li>
<li>Anomaly detection (people hate surprises)</li>
</ul>
<h3>Historically available, but tightly coupled.</h3>
<h3>Using these technologies to distribute and isolate systems</h3>
</section>
<section class="slide">
<h2>Processing Stack</h2>
<h3>Serving/Visualization: node.js + jQuery/D3</h3>
<ul>
<li>Using Server-Sent Events (SSE) and WebSockets for transport</li>
<li>Also supports XHR and (soon) JSONP</li>
</ul>
<h3>Real-Time Processing: Storm</h3>
<ul>
<li>Hosting both internal and ZoomData projects</li>
<li>Using Redis and MongoDB as intermediate data stores</li>
</ul>
<h3>Data Motion: Kafka</h3>
<ul>
<li>Single DC with replication to disaster recovery.</li>
<li>Feeds Hadoop and Storm</li>
</ul>
</section>
<section class="slide">
<h1>D3 + Server Sent Events = Awesome</h1>
</section>
<section class="slide">
<h2>Rendering Streaming Data</h2>
<div style="clear:both;">
<div class="left">
<h3>Data Dispatch</h3>
<pre class="prettyprint">
var source = new EventSource('/ticker');
source.addEventListener('message',function(e) {
if(e.data) {
var payload = JSON.parse(e.data);
for(var observer in payload)
$(document).trigger('data:'+observer,
[payload[observer]]);
}
});
</pre>
</div><div class="right">
<h3>Simple Rendering</h3>
<pre class="prettyprint">
$(document).bind('data:history',
function(e,data) {
var r = svg.selectAll("rect.timer").data(d3.entries(data),function(d) { return d.key; });
r.enter().append("rect").attr({
class:"timer",
width:w,
})
.call(position).style({opacity:0})
.transition().style({opacity:1});
r.transition().call(position);
});
</pre>
</div></div>
<div style="clear:both;width: 100%;">
<div id="graph-1" class="left"></div>
<div style="class"><pre id="payload"></pre></div>
</div>
</section>
<section class="slide">
<h1>Add a Dash of Redis</h1>
</section>
<section class="slide">
<h3>node.js + Redis PubSub</h3>
<pre class="prettyprint">
, pubsub = require('redis').createClient();
var subscribers = {};
pubsub.on('message',function(channel,payload) {
if(subscribers[channel]) subscribers[channel](channel,payload);
});
function ticker2(req,res) {
req.socket.setTimeout(Infinity);
res.writeHead(200,{
'Content-Type':'text/event-stream',
'Cache-Control':'no-cache',
'Connection':'keepalive'
});
res.json = function(obj) { res.write("data: "+msg+"\n\n"); }
res.on('close',function() { pubsub.unsubscribe(channel); });
subscribers['ticker'] = function(channel,payload) {
var second = Math.floor((new Date().getTime())/1000) % 60;
var x = {};
x[second] = 1*payload;
res.json({history:x});
}
pubsub.subscribe('ticker');
}
</pre>
<div style="clear:both;width: 100%;">
<pre id="payload-2"></pre>
</div>
</section>
<section class="slide">
<h1>Driven by Storm</h1>
</section>
<section class="slide">
<h2>Storm Topology Recipe</h2>
<ul>
<li><strong>Kafka Spout</strong> pulls data in from Kafka</li>
<li>Drives into a parser Bolt</li>
<li>Parser Bolts produces streams per-Event Type</li>
<li>Bolts aggregate into redis (5 minute, hourly, daily)</li>
<li>Update thread publishes asynchronously.<ul>
<li>Timers</li>
<li>Tick Events</li>
</ul></li>
</section>
<section class="slide">
<h2>Background Updater</h2>
<pre class="prettyprint">
updateTimer = new Timer("Word Tokenizer Updater");
updateTimer.schedule(new TimerTask() {
@Override
public void run() {
HashSet<String> toUpdate;
synchronized(updated) {
toUpdate = updated;
updated = new HashSet<String>();
}
for(String word : toUpdate)
conn.zadd("WordCount", conn.zcard("Word:"+word), word);
conn.publish("WordCount",""+toUpdate.size());
}
}, 1000, 1000);
</pre>
</section>
<section class="slide">
<h2>Driver Bolt</h2>
<pre class="prettyprint">
public void execute(Tuple input) {
try {
String line = input.getStringByField("line");
long timestamp = input.getLongByField("timestamp");
for(String word : line.replaceAll("\\p{Punct}|\\d"," ").toLowerCase().split("\\s+")) {
conn.zadd("Word:"+word, timestamp,""+timestamp);
synchronized(updated) {
updated.add(word);
}
}
} catch(Exception e) {
collector.reportError(e);
} finally {
collector.ack(input);
}
}
</pre>
</section>
<section class="slide">
<h2>Topology Construction</h2>
<pre class="prettyprint">
public TopologyBuilder configure(TopologyBuilder builder) {
builder.setBolt("events", new EventParserBolt())
.shuffleGrouping("spout");
builder.setBolt("tokenize", new WordTokenBolt().redis(redisUrl))
.shuffleGrouping("events","lines");
return builder;
}
</pre>
</section>
<section class="slide">
<h1>Driven By Kafka</h1>
</section>
<section class="slide" id="kafka">
<h2>Simple Producer</h2>
<pre class="prettyprint lang-js">
var X = require('node-xml')
, kafka = require('kafka');
var producer = new kafka.Producer({topic:'hamlet'}).connect(function() {
function send(i,line) {
setTimeout(function() {
line.TIMESTAMP = (new Date().getTime());
producer.send(JSON.stringify(line));
},1000*i + Math.floor(300*Math.random()));
}
var parser = new X.SaxParser(function(c) {
var i = 0;
var line = {};
var field = [];
c.onStartElementNS(function(e) {
field.push(e);
switch(e) {
case 'SPEECH':
line = {};
break;
}
});
c.onEndElementNS(function(e) {
field.pop();
switch(e) {
case 'SPEECH':
delete line['SPEECH'];
delete line['SCENE'];
send(i++,line);
break;
}
});
c.onCharacters(function(e) {
line[field[field.length-1]] = (line[field[field.length-1]]||"") + e;
});
});
parser.parseFile("hamlet.xml");
});
</pre>
</section>
<section class="slide">
<h2>http://github.com/byronellis/strata2013</h2>
</section>
<!-- Required Modernizr file -->
<script src="modernizr.custom.js"></script>
<script src="prettify.js"></script>
<!-- Required JS files. -->
<script src="jquery-1.7.2.min.js"></script>
<script src="core/deck.core.js"></script>
<!-- Extension JS files. Add or remove as needed. -->
<script src="core/deck.core.js"></script>
<script src="extensions/hash/deck.hash.js"></script>
<script src="extensions/menu/deck.menu.js"></script>
<script src="extensions/goto/deck.goto.js"></script>
<script src="extensions/status/deck.status.js"></script>
<script src="extensions/navigation/deck.navigation.js"></script>
<script src="extensions/scale/deck.scale.js"></script>
<script src="d3.v3.js"></script>
<script src="d3.layout.cloud.js"></script>
<!-- <script src="consumer.js"></script> -->
<!-- <script src="wordcloud.js"></script> -->
<script src="presentation.js"></script>
</body>
</html>