Your SlideShare is downloading. ×
0
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
RESTful JSON web databases
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

RESTful JSON web databases

13,589

Published on

Published in: Technology
1 Comment
9 Likes
Statistics
Notes
No Downloads
Views
Total Views
13,589
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
362
Comments
1
Likes
9
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

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

    ×