RESTful JSON web databases

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    5 Favorites

    RESTful JSON web databases - Presentation Transcript

    1. JSON Web Databases
      • Applied JSON: HTTP REST, Ajax databases and beyond
      • Kris Zyp
    2.  
    3. HTTP/REST + JSON = Database interaction for the web
    4. Overview
      • Interoperability Basics
      • Tools/Frameworks
      • Beyond simple CRUD
    5. Interoperability Basics
      • HTTP REST
          • GET - query and get by id
          • PUT - update an object
          • POST - create an object
          • DELETE - delete an object
    6. Tools/Frameworks
      • Client Side
        • Persevere
        • Jester
        • Dojo
      • Server Side
        • ActiveResource
        • CouchDB
        • Persevere
        • GrassyKnoll
        • ...
    7. Standard Conventions
      • Objects/records accessible by /table/id
        • /Product/12
        • GET, PUT, and DELETE this resource
      • Sub object URLs determined by object identity properties
        • GET /Product/ [{“id”:”11”, “name”:”Dérailleur”}, {“id”:”12”, “name”:”Handle Bar”}]
    8. The post-ORM realm
    9. Schemas
      • DB defined schema - ActiveRecord
      • Schema free - CouchDB
    10. Evolutionary Schema: Persevere
    11. JSON Schema based evolutionary schema Start without a schema Add constraints as application evolves
    12. JSON Schema schema: {"description":"A person", "type":"object", "properties": {"name": {"type":"string"}, "age" : {"type":"integer", "maximum":125}} } instance: {“name”:”Kris”, “ age”:30}
    13. JSON Schema driven UI Start with schema and simple form
    14. Querying
      • Web-safe portability important
      • SQL extremely hard to make secure and too complicated in the browser
      • JSONPath
        • JavaScript-style syntax
        • Language agnostic
        • Easy to secure
      http://goessner.net/articles/JsonPath/
    15. JSONPath http://goessner.net/articles/JsonPath/ XPath like query language for JSON Filters - [?expr] Properties/paths (like JS) - .prop Recursive descent - ..prop Slice operator – [3:10:2] Union operator - [3,4,5]
    16. JSONPath querying in requests REST URLs + JSONPath = Web querying /Table/ - All the objects in a table /Table/[?@.price < 10] – all items with a price under $10 /Table/..name – A list of the name property values /Table/.length – A count of the items in the table
    17. JSONQuery http://www.sitepen.com/blog/2008/07/16/jsonquery-data-querying-beyond-jsonpath/ Lenient Syntax - ?price<10 Sorting - [/price, ating] Mapping - [=firstName+' '+lastName] Wildcarding [?description='*fun*'] Recursive object filter - ..[?name='Bar'] Example URL: /Table/[?price<10] [={name:name, rating: rating}] [ ating]
    18. JSON Referencing
      • Hyperlinking + JSON
        • Cyclic
        • Multiple references
        • Cross-message references
        • Cross-site references
      http://www.sitepen.com/blog/2008/06/17/json-referencing-in-dojo/
    19. JSON Referencing http://www.sitepen.com/blog/2008/07/16/jsonquery-data-querying-beyond-jsonpath/
      • {
        • “ name”:”Kris Zyp”,
        • “ id”:”kriszyp”, “children”:[{“id”:”jennikazyp”,“name”:”Jennika Zyp”}],
        • “ spouse”:{
          • “ name”:”Nicole Zyp”, “spouse”:{“$ref”:”kriszyp”},
          • “ children”:[{“$ref”:”jennikazyp”}]
        • }
      • }
    20. JSON Referencing http://www.sitepen.com/blog/2008/07/16/jsonquery-data-querying-beyond-jsonpath/
      • {
        • “ name”:”Kris Zyp”, “children”:[{“name”:”Jennika Zyp”}],
        • “ spouse”:{
          • “ name”:”Nicole Zyp”, “spouse”:{“$ref”:”#”},
          • “ children”:{“$ref”:”#.children”}
        • }
      • }
    21. JSON Referencing http://www.sitepen.com/blog/2008/07/16/jsonquery-data-querying-beyond-jsonpath/
      • {
        • “ name”:”Kris Zyp”,
        • “ id”:”kriszyp”, “children”:[{“name”:”Jennika Zyp”}],
        • “ friends”:[{“$ref”:”jesse#.spouse”}]
      • }
    22. Server side JavaScript + web storage http://sitepen.com/labs/persevere.php
        • &quot;schema&quot;:{
          • “ name”:”Friend”,
          • “ properties”:{
            • “ firstName”:{“type”:”string”}, “age”:{“type”:”integer”},
          • }
        • &quot;staticCreateMethod&quot;:function(arg1){
            • var friend = new Friend;
            • friend.age = 0;
          • },
        • &quot;prototype&quot;:{
            • “ myMethod”:function(){
              • return this.firstName + ‘ ‘ + this.lastName;
        • }
          • }
        • &quot;extends&quot;:{&quot;$ref&quot;:&quot;../Person&quot;}
        • }
    23. Security with web accessible data storage
      • Typical databases behind the application
      • Web DBs are directly accessible
        • User authorization becomes integrated with data
      • Allows separation of application and security concerns
    24. Security with Persevere
      • Data-centric
      • Capability-based
      • Logic/code based security possible as well
    25. Transactions
    26. Live Data Notifications with REST Channels http://cometdaily.com/2008/05/13/http-channels-2/
    27. Other Features
      • File storage/alternate resource representations
      • Utilize existing SQL tables
      • SMD support
      • Class/Table Inheritance
    28. Persevere
      • JSONQuery/JSONPath
      • JSON Referencing
      • Comet Live Data Notifications
      • JSON Schema with evolutionary constraints
      • JSON-RPC
      • Built-in Security
      • Standards based REST interface
      http://sitepen.com/labs/persevere.php
    29. REST/ Ajax databases Develop for the future
    30.  

    + kriszypkriszyp, 2 years ago

    custom

    1652 views, 5 favs, 2 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1652
      • 1623 on SlideShare
      • 29 from embeds
    • Comments 0
    • Favorites 5
    • Downloads 66
    Most viewed embeds
    • 27 views on http://www.sitepen.com
    • 2 views on https://www.sitepen.com

    more

    All embeds
    • 27 views on http://www.sitepen.com
    • 2 views on https://www.sitepen.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories