McGraw Hill Couchbase SF 2013
 

McGraw Hill Couchbase SF 2013

on

  • 1,762 views

 

Statistics

Views

Total Views
1,762
Views on SlideShare
1,278
Embed Views
484

Actions

Likes
1
Downloads
21
Comments
0

3 Embeds 484

http://www.couchbase.com 470
https://twitter.com 10
http://www.redditmedia.com 4

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    McGraw Hill Couchbase SF 2013 McGraw Hill Couchbase SF 2013 Presentation Transcript

    • Ziggrid Processing Data in Near Real-Time Using Couchbase Christopher Tse (Head of R&D, McGraw-HIll Education) Gareth Powell, Ph. D. (Chief Scientist, Ziniki Network)CouchConf SF 2013 - Sep 13, 2013
    • @ McGraw-Hill Education + Research & Development
    • @ McGraw-Hill Education + Research & Development
    • Leveraging EmberJS, a JavaScript MVC framework to rethink the teaching and learning experiences on the Web and on mobile devices HTML
    • Collecting and analyzing multiple streams of student engagement, performance, and demographics for dashboards. Data FACT Dimension DimensionDimension Dimension Dimension
    • Action Collections EdSense: Real-time Reactions Learning Style Engagement User Intents Recommendations ReactionActivity Log Previously Achievements Efficacy
    • Action Collections EdSense: Real-time Reactions Learning Style Engagement User Intents Recommendations Reaction Activity Log Previously Achievements Efficacy
    • Learning Portal • Designed and built as a collaboration between MHE Labs and Couchbase • Serves as proof-of-concept and testing harness for Couchbase + ElasticSearch integration • Available for download and further development as open source code http://github.com/couchbaselabs/learningportal  Unveiled during CouchConf SF 2012
    • SQL Hi!
    • SQL ETL
    • SQL Some-sort-of query language ETL To extract, transform and load in steps We mean: So we can: Declaratively express the logic for the machine to calculate and process But: Processing complex, multi- layered queries upon request can be slow Store the results from the intermediate or final steps of our calculations Stored data gets out-of- sync with reality. And refresh is often expensive When we say:
    • SQL ETL
    • SQL ETL Logic
    • SQL ETL Logic Steps
    • SQL ETL Logic Steps Fresh Data
    • SQL ETL Logic Steps Fresh Data Fast Access
    • SQLETL Logic Stepsin Fresh Data Fast Access&
    • FRP Logic Stepsin Fresh Data Fast Access&
    • Introducing Functional Reactive Programming FRP
    • Functional reactive programming (FRP) is a programming paradigm for reactive programming using the building blocks of functional programming. The key traits of FRP are: • The concept of "behaviors" or "signals" which model values that vary over continuous time. • The concept of "events" which have occurrences at finitely many points in time. • A means to change the FRP system in response to events, generally termed "switching". • The separation of evaluation details such as sampling rate from the reactive model. An additional common but contentious trait is a notion of consistency when ordering events (not just within one stream). Variants include synchrony and glitch freedom. The semantic model of FRP in side-effect free languages is typically in terms of continuous functions, and typically over time. In contrast, integration with a host language that has side- effects is typically given in terms of data flow or dependency graphs by extending the typical operational semantics to manipulate and use them. WTF is FRP?
    • Functional reactive programming (FRP) is a programming paradigm for reactive programming using the building blocks of functional programming. The key traits of FRP are: • The concept of "behaviors" or "signals" which model values that vary over continuous time. • The concept of "events" which have occurrences at finitely many points in time. • A means to change the FRP system in response to events, generally termed "switching". • The separation of evaluation details such as sampling rate from the reactive model. An additional common but contentious trait is a notion of consistency when ordering events (not just within one stream). Variants include synchrony and glitch freedom. The semantic model of FRP in side-effect free languages is typically in terms of continuous functions, and typically over time. In contrast, integration with a host language that has side- effects is typically given in terms of data flow or dependency graphs by extending the typical operational semantics to manipulate and use them. TL;DR WTF is FRP?
    • Hint
    • Excel is FRP
    • Excel is FRP Functional Every cell is either is a value or a f(x) that generates a value
    • Excel is FRP Functional Reactive Every cell is either is a value or a f(x) that generates a value If you change one cell, all the other cells that refer to it changes immediately
    • Excel is FRP Functional Reactive Every cell is either is a value or a f(x) that generates a value If you change one cell, all the other cells that refer to it changes immediately
    • Excel is FRP Functional Reactive Programming Every cell is either is a value or a f(x) that generates a value If you change one cell, all the other cells that refer to it changes immediately Yes, you are programming when you are create a model in an Excel spreadsheet
    • Start with a simple sum() Adding numbers within one worksheet Excel is FRP
    • Start with a simple sum() Add more tabs Adding numbers within one worksheet To reflect higher level aggregates Excel is FRP
    • Start with a simple sum() Add more tabs Draw fancy graphs Adding numbers within one worksheet To reflect higher level aggregates That visualizes the valuable aggregates Excel is FRP
    • The world runs on Excel. :)
    • The world runs on Excel. : )
    • What if... Cells inside Sheets Documents in JSONData Model: Calculating: When you open the file Visualization: Supported chart types All the time in the cloud Anything drawable in HTML5 Instead of... We have... =SUM(A1:B10) function Sum() { ... }Language:
    • What if... Cells inside Sheets Documents in JSONData Model: Calculating: When you open the file Visualization: Supported chart types All the time in the cloud Anything drawable in HTML5 Instead of... We have... =SUM(A1:B10) function Sum() { ... }Language:
    • Ziggrid is FRP
    • f(x) f(x) f(x) Ziggrid is FRP Stores values in JSON Specifies f(x) in JSON Inside a Couchbase cluster Also builds a dependency graph
    • f(x) f(x) f(x) Ziggrid is FRP Stores values in JSON Specifies f(x) in JSON Inside a Couchbase cluster Also builds a dependency graph Push data out via JSON So clients can render data in HTML5, etc
    • Ziggrid is FRP Stores values in JSON Specifies f(x) in JSON Push data out via JSON Inside a Couchbase cluster Also builds a dependency graph So clients can render data in HTML5, etc f(x) f(x) f(x) “The Ziggurat”
    • Ziggrid is FRP Stores values in JSON Specifies f(x) in JSON Push data out via JSON Inside a Couchbase cluster Also builds a dependency graph So clients can render data in HTML5, etc f(x) f(x) f(x) “The Ziggurat” JS N
    • Layers of the Ziggurat Raw Events Enhanced Events Summaries Rankings Correlations Snapshots Composites
    • Gareth Powell, Ph. D. Functional Programming Expert Wrote doctorate thesis on Haskell
    • Gareth Powell, Ph. D. Functional Programming Expert Wrote doctorate thesis on Haskell Baseball Fanatic
    • Example: Baseball Data Analysis Model Raw Events Enhanced Events Summaries Rankings Correlations Snapshots Composites Plate AppearancesPlayer SituationOutcome Player Totals Correlate vs Situation Snapshots of Player Totals Player Profile Snapshots of Correlation Game Results Leaderboards (HR, AVG, PROD) Win / Loss Record
    • LIVE DEMO
    • Beane Counter Architecture HTML5 Data Tables and SVG Visualization Ember.js + D3.js via WebSockets MiddlewareFront-end Model Description, Calculation, and Event Chaining Java via Memcached Protocol Backend Raw and Aggregated Data Storage and Indexing Couchbase JSON Store + Incremental MapReduce
    • Ziggrid Models • Data model described in JSON structure { "name": "plateAppearance", "fields": [ { "name": "team", // The team identifier from the Retrosheet Event file "type": "string", "key": true }, { "name": "player", // The player identifier from the Retrosheet Event file "type": "string", "key": true }, { "name": "season", // Year represented as YYYY "type": "string", "key": true }, { "name": "dayOfYear", // 1-365, proxy for which game it was "type": "number", "key": true }, { "name": "inning", // 1-9 for regular innings "type": "number", "key": true }, ... } JS N
    • { "enhanced": "situation", "from": "plateAppearance", "enhance": { "player": "player", "season": "season", "dayOfYear": "dayOfYear", "atbat": { "op": "+", "args": [{ "op": "*", "args": [ 3, "inning" ] }, "outs", -3 ] }, "bases": "bases", "lead": { "op": "group", "value": { "op": "ifelse", "test": "home", "true": { "op": "-", "lhs": "homeScore", "rhs": "awayScore" }, "false": { "op": "-", "lhs": "awayScore", "rhs": "homeScore" } }, "dividers": [ -3, -1, 0, 2 ], // (-inf, -3], (-3, -1], (-1, 0], (0, 2], "moreThan": 3 // (2,inf) }, Ziggrid Algorithms • Data model described in JSON structure • Define all calculation via communative and associative operators JS N
    • { "composeInto": "profile", "from": "correlate_on_situation_groupedBy_player_and_season", "key": [ "player/", { "field": "player" } ], "fields": { "clutchness": "correlation" } }, { "leaderboard": "hotness", "from": "snapshot_playerSeasonToDate", "groupby": [ [ "season", "dayOfYear" ] ], "sortby": [ "average" ], "order": "desc", "values": [ "player" ] }, { "composeInto": "profile", "from": "snapshot_playerSeasonToDate", "key": [ "player/", { "field": "player" } ], "fields": { "hotness": "average" } } ... ] Ziggrid Composites • Data model described in JSON structure • Define all calculation via communative and associative operators • Projecting data via composite definition JS N
    • https://github.com/Ziniki-Network/Ziggrid Ziggrid is 100% Open Source Let’s work together!
    • Future Improvements Using Couchbase View Engine to do more of the processing in the database via Incremental MapReduce. Currently, only the leaderboards are computed using views. GREATER SCALABILITY Expand the functions support by Ziggrid to perform transformation, statistical calculations typical of Big Data analysis, and even ones for machine learning. Allow in-browser development of new models using a subset of data. We need to finish developing a pure JavaScript-based Ziggrid processing engine. Using UPR protocol to be notified of changes in inside Couchbase to allow more immediate, and thus more real-time propagation of events up the Ziggurat. EASIER MODEL DEVELOPMENT REDUCED LATENCY DEEPER ANALYTICS
    • Hadoop
    • Hadoop Big Data
    • Hadoop Big DataBut Slow
    • Zebras for
    • Thanks to 2 members of the Ember.js Core Team Who helped us design and code the sexy Ember + D3.js + WebSockets front-end @machty @stefanpenner
    • Questions? @christse Follow me on Twitter