SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
Using Task Queues and
D3.js to build an
analytics product on
App Engine
Warren Edwards
Founder, Waizee
TODAY
How Do We Handle All The Data?!?
Look at the Product
Why App Engine? Why D3.js?
Task Queues in App Engine
Code Samples
A Quiz!
Wrap Up
All of the data stored in
the world currently
about 4 zettabytes
according to EMC.
At current growth rates,
that data will surpass a
yottabyte in 2030.
If each bit was represented by a grain of
sand, a yottabyte would be about five
percent the mass of the Moon.
Data surpasses human readability.
Software analyzes
the data so humans
can focus on
[ interpretation,
judgement, action ];
[ Show
Product
Demo ]
AWS AE Others
Team Experience
Automated scaling / spin-up
Automated load-balancing
Automated security
Task queue functionality
Why App Engine?
Honorable mention: AppScale path from AE
Google App
Engine builds
on Big Table
Why D3.js?
Canvas
Directly
D3 PolyChart
Math
plotlib
Super-
conductor
Team experience ( NONE )
Development effort
Maturity of library
Developer traction
Honorable mention: xCharts builds on D3.js with prepackaged charts
PHOTO CREDIT: http://www.flickr.com/photos/cusegoyle/
HTTP Request Task Queue
Full access to data store? YES YES
Atomic transactions? YES YES
Write in Python / Java / Go? YES YES
Maximum request lifetime 30-60 sec Up to 10 min
Timing of execution Immediate Up to 30 days
Retry Can be done
manually, no policy
Automatic by policy
Concurrent requests No set limit Limited by policy
TQ build on App Engine's HTTP Request
but liberate server use from user interaction
Introducing Task Queues (TQ)
Appeal of Task Queues
Well suited to number crunching
● Long-lived jobs for running analytics
● Full access to data store and messaging to build
on your existing App Engine knowledge
● Save state back to Data Store and call the next
task
Task Queues allow you to crunch data
"while you wait"
USER
UPLOADS
DATA
Task
#1
Task
#2
. . . Task
#N
RESULT
Save to
Data Store
Pass
Parameters
Cascade Tasks in Queue for Multipass
Processing
Save to
Data Store
Program Flow
Data Flow
DATASTORE
Task
#1
Task
#2
. . .
Task
#N
USER
UPLOADS
DATA
RESULT
Process Tasks in Parallel Queues
Program Flow
Data Flow
Let's Look at a Code Sample
taskqueue.add(queue_name='analyze', url='/work1',
params={'key': keyID})
class WorkerTheFirst(webapp2.RequestHandler):
def post(self):
keyID = self.request.get('key')
app = webapp2.WSGIApplication([('/', StartPage),
('/work1', WorkerTheFirst),
('.*', ErrPage)
])
Add Task into Queue
Define Task with Retrieval of Parameters
Associate Task with Handler
One Task Calls Another
class WorkerTheFirst(webapp2.RequestHandler):
def post(self):
keyID = self.request.get('key')
#
# First pass of work here
#
taskqueue.add(queue_name='analyze', url='/work2',
params={'key': keyID})
class WorkerTheSecond(webapp2.RequestHandler):
def post(self):
keyID = self.request.get('key')
#
# Second pass of work here
#
app = webapp2.WSGIApplication([('/', StartPage),
('/work1', WorkerTheFirst),
('/work2', WorkerTheSecond),
('.*', ErrPage)
])
total_storage_limit: 120G # Max for free apps is 500M
queue:
# Queue for analyzing the incoming data
- name: analyze
rate: 35/s
retry_parameters:
task_retry_limit: 5
task_age_limit: 2h
# Queue for user behavior heuristics
- name: heuristic
rate: 5/s
# Queue for doing maintenance on the data store or site
- name: kickoff
rate: 5/s
Setting up Task Queues in queue.yaml
svg = d3.select('body')
.append('svg')
.attr('class', 'circles')
.attr('width', width)
.attr('height', height)
svg.append('g').selectAll('circle')
.data(data)
.enter()
.append('circle')
.attr('transform', 'translate(' + pan + ', 0)')
# pan allows moving te whole graph slightly
# to account for long text labels
svg.selectAll('circle')
.attr('cx', function(d) {return x(d.v2)})
.attr('cy', function(d) {return y(d.v1)})
.attr('r', dot_out) # dot_out scales the size
.attr('fill', function(d) {return d.v4})
Core of the D3 Code
svg = d3.select('body')
.append('svg')
.attr('class', 'circles')
.attr('width', width)
.attr('height', height)
svg.append('g').selectAll('circle')
.data(data)
.enter()
.append('circle')
.attr('transform', 'translate(' + pan + ', 0)')
# pan allows moving te whole graph slightly
# to account for long text labels
svg.selectAll('circle')
.attr('cx', function(d) {return x(d.v2)})
.attr('cy', function(d) {return y(d.v1)})
.attr('r', dot_out) # dot_out scales the size
.attr('fill', function(d) {return d.v4})
Program Writes Its Own Code !
Axes are set
heuristically by
server software
Titles Are Set By Heuristic Text Analysis
var title = '{{ pagetitle }}'
var subtitle = '{{ pagesubtitle }}'
var title = 'Google+ Rating More Important Metric Than
Star Rating'
var subtitle = 'Survey of Productivity Apps in the
Chrome Web Store, Nov 2012'
In Django template
Rendered in Javascript to the browser
Labels were pulled Heuristically from input - not hard coded!
QUIZ !
Choose the Correct Task Queue Call
taskqueue.add(queue_name='analyze', url='/work2',
param={key: keyID})
queue.add(queue='analyze', url='/work2',
params={'key': keyID})
taskqueue.add(queue='analyze', url='/work2',
param={'key': keyID})
taskqueue.add(queue_name='analyze', url='/work2',
params={'key': keyID})
taskqueue.add(queue='analyze', url='/work2',
params={key: keyID})
A
B
C
D
E
ANSWER IS ...
Choose the Correct Task Queue Call
taskqueue.add(queue_name='analyze', url='/work2',
param={key: keyID})
queue.add(queue='analyze', url='/work2',
params={'key': keyID})
taskqueue.add(queue='analyze', url='/work2',
param={'key': keyID})
taskqueue.add(queue_name='analyze', url='/work2',
params={'key': keyID})
taskqueue.add(queue='analyze', url='/work2',
params={key: keyID})
A
B
C
D
E
Correct Answer is D
TQ Open a World of Possibilities
You can send tasks to different versions
of your app
→ Automated test of new version of app before Go
Live
You can access the queue’s usage data
→ Your app can monitor its own consumption of
tasks through QueueStatistics class
Task Queue + Crowdsource = ???
→ Software application instructing humans !
Task Queues allow "while you wait" processing
● Allow server task to run autonomously
● Cascade tasks for multistep processing
● Flexible functionality to create great products
Task Queues provide a great tool for
automating the understanding of data
D3.js offers flexible, stable tool for viz of data
● Works nicely with automated scripting
● Lush visualizations but not pre-packaged
● Leverage huge traction in San Francisco
D3.js is best platform for visualization
using automated processing of data
Questions?
Do you have a passion for analytics? Let’s talk!
warren@waizee.com
@campbellwarren
We are your number cruncher in
the cloud that understands your
data and shows you only what is
most important.
Data Sources
The Digital Universe in 2020: Big Data, Bigger Digital Shadows, and
Biggest Growth in the Far East. IDC sponsored by EMC. December
2012
diameter and volume of the Moon: Wolfram Alpha
Yottabyte representation: Waizee calculations
2013 Gartner Magic Quadrant for Business Intelligence and Analytics
Platforms
Photo Credits
http://www.flickr.
com/photos/pcoin/2066230078/sizes/m/in/photostream/
http://en.wikipedia.org/wiki/File:Visicalc.png
http://www.todayscampus.com/rememberthis/load.aspx?art=348
http://commons.wikimedia.org/wiki/File:Chocolate_chip_cookie.jpg
http://www.wpclipart.
com/signs_symbol/checkmarks/checkmarks_3/checkmark_Bold_Brush
_Green.png.html
http://www.flickr.com/photos/cusegoyle/

Weitere Àhnliche Inhalte

Was ist angesagt?

Tips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applicationsTips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applications
Tim Cull
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
drewz lin
 

Was ist angesagt? (20)

Firebase ng2 zurich
Firebase ng2 zurichFirebase ng2 zurich
Firebase ng2 zurich
 
Geotalk presentation
Geotalk presentationGeotalk presentation
Geotalk presentation
 
Implement react pagination with react hooks and react paginate
Implement react pagination with react hooks and react paginateImplement react pagination with react hooks and react paginate
Implement react pagination with react hooks and react paginate
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Creating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with googleCreating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with google
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 
Take My Logs. Please!
Take My Logs. Please!Take My Logs. Please!
Take My Logs. Please!
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
 
React lecture
React lectureReact lecture
React lecture
 
Oracle APEX Performance
Oracle APEX PerformanceOracle APEX Performance
Oracle APEX Performance
 
Graphql, REST and Apollo
Graphql, REST and ApolloGraphql, REST and Apollo
Graphql, REST and Apollo
 
Synchronize applications with akeneo/batch
Synchronize applications with akeneo/batchSynchronize applications with akeneo/batch
Synchronize applications with akeneo/batch
 
Tips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applicationsTips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applications
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
Advanced Django
Advanced DjangoAdvanced Django
Advanced Django
 
Frontin like-a-backer
Frontin like-a-backerFrontin like-a-backer
Frontin like-a-backer
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
Hidden Docs in Angular
Hidden Docs in AngularHidden Docs in Angular
Hidden Docs in Angular
 

Ähnlich wie Using Task Queues and D3.js to build an analytics product on App Engine

09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
Michelangelo van Dam
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
yangdj
 
æ··æ­ç§»ćŠšćŒ€ć‘ïŒšPhoneGap+JQurey+Dreamweaver
æ··æ­ç§»ćŠšćŒ€ć‘ïŒšPhoneGap+JQurey+Dreamweaveræ··æ­ç§»ćŠšćŒ€ć‘ïŒšPhoneGap+JQurey+Dreamweaver
æ··æ­ç§»ćŠšćŒ€ć‘ïŒšPhoneGap+JQurey+Dreamweaver
yangdj
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
Andy Peterson
 

Ähnlich wie Using Task Queues and D3.js to build an analytics product on App Engine (20)

09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
 
Practical Celery
Practical CeleryPractical Celery
Practical Celery
 
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
 
Heroku pop-behind-the-sense
Heroku pop-behind-the-senseHeroku pop-behind-the-sense
Heroku pop-behind-the-sense
 
"Scala in Goozy", Alexey Zlobin
"Scala in Goozy", Alexey Zlobin "Scala in Goozy", Alexey Zlobin
"Scala in Goozy", Alexey Zlobin
 
Testing ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
 
huhu
huhuhuhu
huhu
 
Viktor Tsykunov: Azure Machine Learning Service
Viktor Tsykunov: Azure Machine Learning ServiceViktor Tsykunov: Azure Machine Learning Service
Viktor Tsykunov: Azure Machine Learning Service
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Future Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETFuture Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NET
 
After max+phonegap
After max+phonegapAfter max+phonegap
After max+phonegap
 
æ··æ­ç§»ćŠšćŒ€ć‘ïŒšPhoneGap+JQurey+Dreamweaver
æ··æ­ç§»ćŠšćŒ€ć‘ïŒšPhoneGap+JQurey+Dreamweaveræ··æ­ç§»ćŠšćŒ€ć‘ïŒšPhoneGap+JQurey+Dreamweaver
æ··æ­ç§»ćŠšćŒ€ć‘ïŒšPhoneGap+JQurey+Dreamweaver
 
How to perform debounce in react
How to perform debounce in reactHow to perform debounce in react
How to perform debounce in react
 
Cross Domain Web‹Mashups with JQuery and Google App Engine
Cross Domain Web‹Mashups with JQuery and Google App EngineCross Domain Web‹Mashups with JQuery and Google App Engine
Cross Domain Web‹Mashups with JQuery and Google App Engine
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

KĂŒrzlich hochgeladen (20)

Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 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
 
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
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Using Task Queues and D3.js to build an analytics product on App Engine

  • 1. Using Task Queues and D3.js to build an analytics product on App Engine Warren Edwards Founder, Waizee
  • 2. TODAY How Do We Handle All The Data?!? Look at the Product Why App Engine? Why D3.js? Task Queues in App Engine Code Samples A Quiz! Wrap Up
  • 3. All of the data stored in the world currently about 4 zettabytes according to EMC. At current growth rates, that data will surpass a yottabyte in 2030. If each bit was represented by a grain of sand, a yottabyte would be about five percent the mass of the Moon. Data surpasses human readability.
  • 4. Software analyzes the data so humans can focus on [ interpretation, judgement, action ];
  • 6. AWS AE Others Team Experience Automated scaling / spin-up Automated load-balancing Automated security Task queue functionality Why App Engine? Honorable mention: AppScale path from AE
  • 8. Why D3.js? Canvas Directly D3 PolyChart Math plotlib Super- conductor Team experience ( NONE ) Development effort Maturity of library Developer traction Honorable mention: xCharts builds on D3.js with prepackaged charts PHOTO CREDIT: http://www.flickr.com/photos/cusegoyle/
  • 9. HTTP Request Task Queue Full access to data store? YES YES Atomic transactions? YES YES Write in Python / Java / Go? YES YES Maximum request lifetime 30-60 sec Up to 10 min Timing of execution Immediate Up to 30 days Retry Can be done manually, no policy Automatic by policy Concurrent requests No set limit Limited by policy TQ build on App Engine's HTTP Request but liberate server use from user interaction Introducing Task Queues (TQ)
  • 10. Appeal of Task Queues Well suited to number crunching ● Long-lived jobs for running analytics ● Full access to data store and messaging to build on your existing App Engine knowledge ● Save state back to Data Store and call the next task Task Queues allow you to crunch data "while you wait"
  • 11. USER UPLOADS DATA Task #1 Task #2 . . . Task #N RESULT Save to Data Store Pass Parameters Cascade Tasks in Queue for Multipass Processing Save to Data Store Program Flow Data Flow
  • 12. DATASTORE Task #1 Task #2 . . . Task #N USER UPLOADS DATA RESULT Process Tasks in Parallel Queues Program Flow Data Flow
  • 13. Let's Look at a Code Sample taskqueue.add(queue_name='analyze', url='/work1', params={'key': keyID}) class WorkerTheFirst(webapp2.RequestHandler): def post(self): keyID = self.request.get('key') app = webapp2.WSGIApplication([('/', StartPage), ('/work1', WorkerTheFirst), ('.*', ErrPage) ]) Add Task into Queue Define Task with Retrieval of Parameters Associate Task with Handler
  • 14. One Task Calls Another class WorkerTheFirst(webapp2.RequestHandler): def post(self): keyID = self.request.get('key') # # First pass of work here # taskqueue.add(queue_name='analyze', url='/work2', params={'key': keyID}) class WorkerTheSecond(webapp2.RequestHandler): def post(self): keyID = self.request.get('key') # # Second pass of work here # app = webapp2.WSGIApplication([('/', StartPage), ('/work1', WorkerTheFirst), ('/work2', WorkerTheSecond), ('.*', ErrPage) ])
  • 15. total_storage_limit: 120G # Max for free apps is 500M queue: # Queue for analyzing the incoming data - name: analyze rate: 35/s retry_parameters: task_retry_limit: 5 task_age_limit: 2h # Queue for user behavior heuristics - name: heuristic rate: 5/s # Queue for doing maintenance on the data store or site - name: kickoff rate: 5/s Setting up Task Queues in queue.yaml
  • 16. svg = d3.select('body') .append('svg') .attr('class', 'circles') .attr('width', width) .attr('height', height) svg.append('g').selectAll('circle') .data(data) .enter() .append('circle') .attr('transform', 'translate(' + pan + ', 0)') # pan allows moving te whole graph slightly # to account for long text labels svg.selectAll('circle') .attr('cx', function(d) {return x(d.v2)}) .attr('cy', function(d) {return y(d.v1)}) .attr('r', dot_out) # dot_out scales the size .attr('fill', function(d) {return d.v4}) Core of the D3 Code
  • 17. svg = d3.select('body') .append('svg') .attr('class', 'circles') .attr('width', width) .attr('height', height) svg.append('g').selectAll('circle') .data(data) .enter() .append('circle') .attr('transform', 'translate(' + pan + ', 0)') # pan allows moving te whole graph slightly # to account for long text labels svg.selectAll('circle') .attr('cx', function(d) {return x(d.v2)}) .attr('cy', function(d) {return y(d.v1)}) .attr('r', dot_out) # dot_out scales the size .attr('fill', function(d) {return d.v4}) Program Writes Its Own Code ! Axes are set heuristically by server software
  • 18. Titles Are Set By Heuristic Text Analysis var title = '{{ pagetitle }}' var subtitle = '{{ pagesubtitle }}' var title = 'Google+ Rating More Important Metric Than Star Rating' var subtitle = 'Survey of Productivity Apps in the Chrome Web Store, Nov 2012' In Django template Rendered in Javascript to the browser Labels were pulled Heuristically from input - not hard coded!
  • 20. Choose the Correct Task Queue Call taskqueue.add(queue_name='analyze', url='/work2', param={key: keyID}) queue.add(queue='analyze', url='/work2', params={'key': keyID}) taskqueue.add(queue='analyze', url='/work2', param={'key': keyID}) taskqueue.add(queue_name='analyze', url='/work2', params={'key': keyID}) taskqueue.add(queue='analyze', url='/work2', params={key: keyID}) A B C D E
  • 22. Choose the Correct Task Queue Call taskqueue.add(queue_name='analyze', url='/work2', param={key: keyID}) queue.add(queue='analyze', url='/work2', params={'key': keyID}) taskqueue.add(queue='analyze', url='/work2', param={'key': keyID}) taskqueue.add(queue_name='analyze', url='/work2', params={'key': keyID}) taskqueue.add(queue='analyze', url='/work2', params={key: keyID}) A B C D E Correct Answer is D
  • 23. TQ Open a World of Possibilities You can send tasks to different versions of your app → Automated test of new version of app before Go Live You can access the queue’s usage data → Your app can monitor its own consumption of tasks through QueueStatistics class Task Queue + Crowdsource = ??? → Software application instructing humans !
  • 24. Task Queues allow "while you wait" processing ● Allow server task to run autonomously ● Cascade tasks for multistep processing ● Flexible functionality to create great products Task Queues provide a great tool for automating the understanding of data D3.js offers flexible, stable tool for viz of data ● Works nicely with automated scripting ● Lush visualizations but not pre-packaged ● Leverage huge traction in San Francisco D3.js is best platform for visualization using automated processing of data
  • 25. Questions? Do you have a passion for analytics? Let’s talk! warren@waizee.com @campbellwarren
  • 26. We are your number cruncher in the cloud that understands your data and shows you only what is most important.
  • 27. Data Sources The Digital Universe in 2020: Big Data, Bigger Digital Shadows, and Biggest Growth in the Far East. IDC sponsored by EMC. December 2012 diameter and volume of the Moon: Wolfram Alpha Yottabyte representation: Waizee calculations 2013 Gartner Magic Quadrant for Business Intelligence and Analytics Platforms