SlideShare a Scribd company logo
1 of 38
Download to read offline
28   msec
            XQuery 3 Rocks
            http://www.zorba-xquery.com
            William Candillon - FOSDEM 2012
Harnessing Flexible Data
{
    "photos": {
      "page": 1,
      "pages": 94276,
      "total": "1414129",
      "photo": [{
        "id": "3891667770",
        "owner": "354683133120"

<kml>
  <Placemark>
    <name>Simple placemark</name>
    <Point>
<coordinates>-122.0822035425683,37.422289901
40251,0</coordinates>
{
        "photos": {
          "page": 1,
          "pages": 94276,
          "total": "1414129",
          "photo": [{
            "id": "3891667770",
            "owner": "354683133120"

    <kml>




✔
      <Placemark>
        <name>Simple placemark</name>
        <Point>
    <coordinates>-122.0822035425683,37.422289901
    40251,0</coordinates>
{
        "photos": {
          "page": 1,
          "pages": 94276,
          "total": "1414129",
          "photo": [{
            "id": "3891667770",
            "owner": "354683133120"




                                           ?
    <kml>




✔
      <Placemark>
        <name>Simple placemark</name>
        <Point>
    <coordinates>-122.0822035425683,37.422289901
    40251,0</coordinates>




?                                          ?
Meet XQuery
XQuery



   •   Family of Specification from w3c

   •   Most Complex Complete Data Model

   •   Talks Natively to Web

   •   Query, Store, Index, Update, Full-Text

   •   Unified Framework

   •   Optimization & Parallelization
Meet Zorba

         Open Source XQuery Processor
         Contributors: Oracle, 28msec, FLWOR


   All Flavors Available      Runs Everywhere


   Rich Module Libraries      Developer Tools


   Pluggable Store            Fun & Productive
Zorba
<div id=”entries”>{
  for $entry in $entries
  let $title := string($entry/@title)
  where $entry/@author = “anonymous”
  order by $entry/@datetime
  return <h1>{$title}</h1>
}</div>
insert node <entry>Hello World</entry>
       into $entries
let $x := <m>breakfast of champions</m>
return $x contains text "meal"
  using thesaurus at
    "http://wordnet.princeton.edu"
  relationship "narrower term"
let $handler :=
  function($request){
    let $world := $request/text()
    return
      <h1>Hello {$world}!</h1>
  }
return mongoose:start($handler, 80);

mongoose:cin();
declare
%http:get(“/hello/{$world}”)
function html:hello($world)
{
   <h1>Hello {$world}!</h1>
};
Client                                         Server

<script type="application/xquery">
declare sequential function local:submit($loc,     declare sequential function guestbook:add(
$evtObj)                                              $author as xs:string, $entry as xs:string
{                                                  ){
                                                      let $date   := fn:current-dateTime()
     let $name    := s:id("author")/data(@value)      let $entry := <entry author="{$author}"
     let $text    := s:id("text")/text()                        datetime="{$date}">{$text}</entry>
     return                                           return
       guestbook:add($name, $text);                      xqddf:insert-nodes-last($entries, $entry);
};                                                 };

b:addEventListener(s:id("submit"),                 declare sequential function guestbook:list() {
                  "onclick",                          <entries>{
                   local:submit#2);                     xqddf:collection($entries)
                                                      }</entries>;
guestbook:list();                                  };
</script>
Client                                         Server

<script type="application/xquery">
declare sequential function local:submit($loc,     declare sequential function guestbook:add(
$evtObj)                                              $author as xs:string, $entry as xs:string
{                                                  ){
                                                      let $date   := fn:current-dateTime()
     let $name    := s:id("author")/data(@value)      let $entry := <entry author="{$author}"
     let $text    := s:id("text")/text()                        datetime="{$date}">{$text}</entry>
     return                                           return
       guestbook:add($name, $text);                      xqddf:insert-nodes-last($entries, $entry);
};                                                 };

b:addEventListener(s:id("submit"),                 declare sequential function guestbook:list(){
                  "onclick",                          <entries>{
                   local:submit#2);                     xqddf:collection($entries)
                                                      }</entries>;
guestbook:list();                                  };
</script>




         Seamless Invocations
AWS Libraries (2011)

                                       Java               XQuery

                    8589
    Lines of code




                                          2905
                                                              2309
                                1469

                                                    572                    455


                           S3                 SimpleDB               SNS
AWS Libraries (2011)

                Java            XQuery

                 13803




                                         Lines of Codes
Lines of code




                                             - 80%
                               2496




                         AWS
AWS Libraries (2011)

                PHP             XQuery

                 6531




                                         Lines of Codes
Lines of code




                              2496
                                             - 62%

                        AWS
<html>
  <head>
    <script type='text/javascript'>
    function buy(e) {
       newElement = document.createElement("p");
       elementText = document.createTextNode
                  (e.target.getAttribute(id));
       newElement.appendChild(elementText);
       var res = document.evaluate(
         "//div[@id='shoppingcart']",
         document, null,
         XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
                                                              HTML
         null);
       res.snapshotItem(0).appendChild("newElement");}
    </script>                                               JavaScript
  </head>
  <body>
    <div>Shopping cart</div>
    <div id="shoppingcart"></div>
    <%
                                                             XPath
       // Code establishing connection
       ResultSet results =
       statement.executeQuery ("SELECT * FROM PRODUCTS");
       while (results.next()) {
         out.println("<div>");
                                                               Java
         String prodName = results.getString(1);
         out.println(prodName);

                                                              SQL
         out.println("<input type='button' value='Buy'");
         out.println("id='"+prodName+"'");
         out.println("onclick='buy(event)'/>").
         out.println("</div>");
       }
       results.close();
       // Code closing connection
    %>
  </body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
    <script type='application/xquery'>
declare updating function local:buy($evt, $obj) {
   insert node <p>{$obj/@id}</p> as first
     into //div[@id="shoppingcart"]
};
b:addEventListener(b:dom()//input,
                     "onclick",
                     xs:Qname("local:buy"));
</script>
   </head>
   <body>
     <div>Shopping cart</div>
     <div id="shoppingcart">{
                                                    XQuery Everywhere
       for $p in doc("products.xml")//*:product
       return
          <div>
            {$p/*:name}
            <input type='button'
                   value='Buy'
                   id='{$p/*:name}'/>
          </div>
     }</div>
   </body>
</html>
let $stats := [ { "response_time":
0.05 ... } ...]
for $stat in j:values($stats)
let $url := $stat("http_action")
order by $url
return
{
  "url": $url,
  "avg": avg($stat("response_time"))
}
$zorba -q jsoniq.xq -f
{ "url" : "GET /docs/spec/en-US/html-
single/index.html", "avg" : 0.05 }
Take away


   • Powerful Data Model
   • Flexible Programming Model
   • Productivity
   • Performance
28   msec
            Thank you!

More Related Content

What's hot

Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using RoomNelson Glauber Leal
 
Hd insight programming
Hd insight programmingHd insight programming
Hd insight programmingCasear Chu
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuerydeimos
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutesSimon Willison
 
History of jQuery
History of jQueryHistory of jQuery
History of jQueryjeresig
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Ben Lesh
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkShahar Evron
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for CassandraEdward Capriolo
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015StampedeCon
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuerySudar Muthu
 
Cassandra and materialized views
Cassandra and materialized viewsCassandra and materialized views
Cassandra and materialized viewsGrzegorz Duda
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceAmazon Web Services
 
Aplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackAplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackNelson Glauber Leal
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery FundamentalsGil Fink
 

What's hot (19)

Persisting Data on SQLite using Room
Persisting Data on SQLite using RoomPersisting Data on SQLite using Room
Persisting Data on SQLite using Room
 
Hd insight programming
Hd insight programmingHd insight programming
Hd insight programming
 
Remy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQueryRemy Sharp The DOM scripting toolkit jQuery
Remy Sharp The DOM scripting toolkit jQuery
 
Learning jQuery in 30 minutes
Learning jQuery in 30 minutesLearning jQuery in 30 minutes
Learning jQuery in 30 minutes
 
History of jQuery
History of jQueryHistory of jQuery
History of jQuery
 
jQuery
jQueryjQuery
jQuery
 
Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016Async Redux Actions With RxJS - React Rally 2016
Async Redux Actions With RxJS - React Rally 2016
 
Amazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend FrameworkAmazon Cloud Services and Zend Framework
Amazon Cloud Services and Zend Framework
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
 
Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015Cassandra 3.0 - JSON at scale - StampedeCon 2015
Cassandra 3.0 - JSON at scale - StampedeCon 2015
 
Drupal 8: Fields reborn
Drupal 8: Fields rebornDrupal 8: Fields reborn
Drupal 8: Fields reborn
 
A Short Introduction To jQuery
A Short Introduction To jQueryA Short Introduction To jQuery
A Short Introduction To jQuery
 
Cassandra and materialized views
Cassandra and materialized viewsCassandra and materialized views
Cassandra and materialized views
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line Interface
 
Min-Maxing Software Costs
Min-Maxing Software CostsMin-Maxing Software Costs
Min-Maxing Software Costs
 
Fatc
FatcFatc
Fatc
 
Aplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e JetpackAplicações Assíncronas no Android com Coroutines e Jetpack
Aplicações Assíncronas no Android com Coroutines e Jetpack
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 

Viewers also liked

The Role of Facebook in Everyday Student Life
The Role of Facebook in Everyday Student LifeThe Role of Facebook in Everyday Student Life
The Role of Facebook in Everyday Student LifePhillip Jeffrey
 
Performance and Creativity
Performance and CreativityPerformance and Creativity
Performance and CreativityPhillip Jeffrey
 
The Tao of Sharing: Social Media, Games, Photography
The Tao of Sharing: Social Media, Games, PhotographyThe Tao of Sharing: Social Media, Games, Photography
The Tao of Sharing: Social Media, Games, PhotographyPhillip Jeffrey
 
Amplified Events, Seminars, Conferences, ...: What? Why? How?
Amplified Events, Seminars, Conferences, ...: What? Why? How?Amplified Events, Seminars, Conferences, ...: What? Why? How?
Amplified Events, Seminars, Conferences, ...: What? Why? How?lisbk
 
Thinking The Unthinkable: Introduction
Thinking The Unthinkable: IntroductionThinking The Unthinkable: Introduction
Thinking The Unthinkable: Introductionlisbk
 
7 pragmatic initiatives to improve your CX in 2017
7 pragmatic initiatives to improve your CX in  20177 pragmatic initiatives to improve your CX in  2017
7 pragmatic initiatives to improve your CX in 2017Stefan Kolle
 
Scalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBScalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBWilliam Candillon
 
10 things to make you think
10 things to make you think10 things to make you think
10 things to make you thinkStefan Kolle
 

Viewers also liked (11)

The Role of Facebook in Everyday Student Life
The Role of Facebook in Everyday Student LifeThe Role of Facebook in Everyday Student Life
The Role of Facebook in Everyday Student Life
 
Performance and Creativity
Performance and CreativityPerformance and Creativity
Performance and Creativity
 
My Summer of Code
My Summer of CodeMy Summer of Code
My Summer of Code
 
The Tao of Sharing: Social Media, Games, Photography
The Tao of Sharing: Social Media, Games, PhotographyThe Tao of Sharing: Social Media, Games, Photography
The Tao of Sharing: Social Media, Games, Photography
 
Amplified Events, Seminars, Conferences, ...: What? Why? How?
Amplified Events, Seminars, Conferences, ...: What? Why? How?Amplified Events, Seminars, Conferences, ...: What? Why? How?
Amplified Events, Seminars, Conferences, ...: What? Why? How?
 
Thinking The Unthinkable: Introduction
Thinking The Unthinkable: IntroductionThinking The Unthinkable: Introduction
Thinking The Unthinkable: Introduction
 
Facebook
FacebookFacebook
Facebook
 
Extending and scripting PDT
Extending and scripting PDTExtending and scripting PDT
Extending and scripting PDT
 
7 pragmatic initiatives to improve your CX in 2017
7 pragmatic initiatives to improve your CX in  20177 pragmatic initiatives to improve your CX in  2017
7 pragmatic initiatives to improve your CX in 2017
 
Scalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDBScalable XQuery Processing with Zorba on top of MongoDB
Scalable XQuery Processing with Zorba on top of MongoDB
 
10 things to make you think
10 things to make you think10 things to make you think
10 things to make you think
 

Similar to XQuery Rocks

Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web developmentJohannes Brodwall
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejsNick Lee
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platformsAyush Sharma
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCpootsbook
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012ghnash
 
Spring data iii
Spring data iiiSpring data iii
Spring data iii명철 강
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation FrameworkCaserta
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourPeter Friese
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門Tsuyoshi Yamamoto
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologyDaniel Knell
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETJames Johnson
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkIndicThreads
 

Similar to XQuery Rocks (20)

Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Play!ng with scala
Play!ng with scalaPlay!ng with scala
Play!ng with scala
 
Jquery
JqueryJquery
Jquery
 
Flask and Angular: An approach to build robust platforms
Flask and Angular:  An approach to build robust platformsFlask and Angular:  An approach to build robust platforms
Flask and Angular: An approach to build robust platforms
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012J query b_dotnet_ug_meet_12_may_2012
J query b_dotnet_ug_meet_12_may_2012
 
Spring data iii
Spring data iiiSpring data iii
Spring data iii
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 
Broadleaf Presents Thymeleaf
Broadleaf Presents ThymeleafBroadleaf Presents Thymeleaf
Broadleaf Presents Thymeleaf
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
jQuery
jQueryjQuery
jQuery
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
CouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 HourCouchDB Mobile - From Couch to 5K in 1 Hour
CouchDB Mobile - From Couch to 5K in 1 Hour
 
G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門G*ワークショップ in 仙台 Grails(とことん)入門
G*ワークショップ in 仙台 Grails(とことん)入門
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 
A Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NETA Rich Web Experience with jQuery, Ajax and .NET
A Rich Web Experience with jQuery, Ajax and .NET
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 

XQuery Rocks

  • 1. 28 msec XQuery 3 Rocks http://www.zorba-xquery.com William Candillon - FOSDEM 2012
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 11. { "photos": { "page": 1, "pages": 94276, "total": "1414129", "photo": [{ "id": "3891667770", "owner": "354683133120" <kml> <Placemark> <name>Simple placemark</name> <Point> <coordinates>-122.0822035425683,37.422289901 40251,0</coordinates>
  • 12. { "photos": { "page": 1, "pages": 94276, "total": "1414129", "photo": [{ "id": "3891667770", "owner": "354683133120" <kml> ✔ <Placemark> <name>Simple placemark</name> <Point> <coordinates>-122.0822035425683,37.422289901 40251,0</coordinates>
  • 13. { "photos": { "page": 1, "pages": 94276, "total": "1414129", "photo": [{ "id": "3891667770", "owner": "354683133120" ? <kml> ✔ <Placemark> <name>Simple placemark</name> <Point> <coordinates>-122.0822035425683,37.422289901 40251,0</coordinates> ? ?
  • 15. XQuery • Family of Specification from w3c • Most Complex Complete Data Model • Talks Natively to Web • Query, Store, Index, Update, Full-Text • Unified Framework • Optimization & Parallelization
  • 16. Meet Zorba Open Source XQuery Processor Contributors: Oracle, 28msec, FLWOR All Flavors Available Runs Everywhere Rich Module Libraries Developer Tools Pluggable Store Fun & Productive
  • 17. Zorba
  • 18. <div id=”entries”>{ for $entry in $entries let $title := string($entry/@title) where $entry/@author = “anonymous” order by $entry/@datetime return <h1>{$title}</h1> }</div>
  • 19. insert node <entry>Hello World</entry> into $entries
  • 20. let $x := <m>breakfast of champions</m> return $x contains text "meal" using thesaurus at "http://wordnet.princeton.edu" relationship "narrower term"
  • 21. let $handler := function($request){ let $world := $request/text() return <h1>Hello {$world}!</h1> } return mongoose:start($handler, 80); mongoose:cin();
  • 23.
  • 24. Client Server <script type="application/xquery"> declare sequential function local:submit($loc, declare sequential function guestbook:add( $evtObj) $author as xs:string, $entry as xs:string { ){ let $date := fn:current-dateTime() let $name := s:id("author")/data(@value) let $entry := <entry author="{$author}" let $text := s:id("text")/text() datetime="{$date}">{$text}</entry> return return guestbook:add($name, $text); xqddf:insert-nodes-last($entries, $entry); }; }; b:addEventListener(s:id("submit"), declare sequential function guestbook:list() { "onclick", <entries>{ local:submit#2); xqddf:collection($entries) }</entries>; guestbook:list(); }; </script>
  • 25. Client Server <script type="application/xquery"> declare sequential function local:submit($loc, declare sequential function guestbook:add( $evtObj) $author as xs:string, $entry as xs:string { ){ let $date := fn:current-dateTime() let $name := s:id("author")/data(@value) let $entry := <entry author="{$author}" let $text := s:id("text")/text() datetime="{$date}">{$text}</entry> return return guestbook:add($name, $text); xqddf:insert-nodes-last($entries, $entry); }; }; b:addEventListener(s:id("submit"), declare sequential function guestbook:list(){ "onclick", <entries>{ local:submit#2); xqddf:collection($entries) }</entries>; guestbook:list(); }; </script> Seamless Invocations
  • 26.
  • 27.
  • 28.
  • 29. AWS Libraries (2011) Java XQuery 8589 Lines of code 2905 2309 1469 572 455 S3 SimpleDB SNS
  • 30. AWS Libraries (2011) Java XQuery 13803 Lines of Codes Lines of code - 80% 2496 AWS
  • 31. AWS Libraries (2011) PHP XQuery 6531 Lines of Codes Lines of code 2496 - 62% AWS
  • 32. <html> <head> <script type='text/javascript'> function buy(e) { newElement = document.createElement("p"); elementText = document.createTextNode (e.target.getAttribute(id)); newElement.appendChild(elementText); var res = document.evaluate( "//div[@id='shoppingcart']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, HTML null); res.snapshotItem(0).appendChild("newElement");} </script> JavaScript </head> <body> <div>Shopping cart</div> <div id="shoppingcart"></div> <% XPath // Code establishing connection ResultSet results = statement.executeQuery ("SELECT * FROM PRODUCTS"); while (results.next()) { out.println("<div>"); Java String prodName = results.getString(1); out.println(prodName); SQL out.println("<input type='button' value='Buy'"); out.println("id='"+prodName+"'"); out.println("onclick='buy(event)'/>"). out.println("</div>"); } results.close(); // Code closing connection %> </body> </html>
  • 33. <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type='application/xquery'> declare updating function local:buy($evt, $obj) { insert node <p>{$obj/@id}</p> as first into //div[@id="shoppingcart"] }; b:addEventListener(b:dom()//input, "onclick", xs:Qname("local:buy")); </script> </head> <body> <div>Shopping cart</div> <div id="shoppingcart">{ XQuery Everywhere for $p in doc("products.xml")//*:product return <div> {$p/*:name} <input type='button' value='Buy' id='{$p/*:name}'/> </div> }</div> </body> </html>
  • 34. let $stats := [ { "response_time": 0.05 ... } ...] for $stat in j:values($stats) let $url := $stat("http_action") order by $url return { "url": $url, "avg": avg($stat("response_time")) }
  • 35. $zorba -q jsoniq.xq -f { "url" : "GET /docs/spec/en-US/html- single/index.html", "avg" : 0.05 }
  • 36. Take away • Powerful Data Model • Flexible Programming Model • Productivity • Performance
  • 37.
  • 38. 28 msec Thank you!