2. akabuilt rebuilding onhack atcontribute towork at
3. One More
thing...CoorganizingRESTFest2011w/MikeAmundsenrestfest.org
4. What isWhy NoSQL ^
5. NoSQL is...Not OnlySQLorSQLIvoteforthisone
6. Origins of the
NameCarloStrozziNoSQLappstartedin1998.RDBMSsansSQLappliedtononrelationalDBsaround2008ishno:sql(east)selectfun,profitfromreal_worldwhererelational=false;
7. Origin of the
SpeciesnonrelationaldatabasespredaterelationalonesitssortalikeAJAXbeendoinitforawhilegetsanamenowitscool!!1!
8. Types of NoSQL
DBsgraph(RDF/SemanticWeb/triples)keyvalue(justwhatitsays)document(k/v+queriability)object(biginthe1980s)multivalue(oldtech...like1960s)NewSQL?
28. Ubiquitous/Distributed Data CouchDB serverdesktopmobile
RiakMobile? gotoErlangFactoryinJune
29. FALE
Scenariospoweroutagesdatalossfailedpersistence,nopersistencenetworkunavailability
special thanks to @coats who runs fale.ca for the FALE stamp
30. Solution: CouchDB
31. Howwith CouchDB
32. Time to Relax
33. Time to Relax ThatsDamien.HebuiltCouchDB.
34. ThatstheCouchDB gangsign.Time to Relax
ThatsDamien.HebuiltCouchDB.
35. ThatstheCouchDB gangsign.Time to Relax Learnit!
ThatsDamien.HebuiltCouchDB.
36. and heres why
37. CouchDB has Super
Powers!SchemalessDocumentcentricReplication/SyncFailFastArchitecturestatelessAPIappendonlyfilestorage
43. Get
CouchDBhttp://www.couchbase.com/downloads/couchbaseserver/communityhttp://iriscouch.com/bothhaveGeoCouchbuiltin!https://cloudant.com/(BigCouch/sharded)yoursystemspackageinstaller...http://wiki.apache.org/couchdb/Installation
44. Time to Relax (command line)Apache CouchDB 1.0.2
(LogLevel=info) is starting.Apache CouchDB has started. Time to
relax.[info] [] Apache CouchDB has started on
http://127.0.0.1:5984/
56. JSON to PHP
Object$json={"json":"document","with":["an","array"]};$j=json_decode($json);//$jstdClassObject([json]=>document[with]=>Array([0]=>an[1]=>array))echo$j>with[1];
58. I got tired of having topick -> or [] $j=newArrayObject(
json_decod($json), ArrayObject::ARRAY_AS_PROPS );
print_r($j[with][0]); print_r($j>with[0]);
//ansameresult!noerrors!
59. HTTP / REST basics GETread PUT create or
updateDELETEdeletePOSTbulk operation
62. Create a
Database$PUT/pouch/{ok:true}$GET/pcouch/{"db_name":"pcouch","doc_count":0,"doc_del_count":0,"update_seq":0,"purge_seq":0,"compact_running":false,"disk_size":79,"instance_start_time":"1289923325819422","disk_format_version":5,"committed_update_seq":0}
63. DELETE a
Database$DELETE/pouch/{ok:true}#^^^becarefulwiththatone!#letsrecreateit$PUT/pouch/
65. GET the
DocumentGET/pouch/tek{"_id":"test","_rev":"189af21439a03933bc3fc8c14cbeb496e","php":"tek"}//wellneedthat_revvaluetoupdatethisdoc
66. PUT (failure)on
purpose...PUT/pouch/tek{php:tek}{"error":"conflict","reason":"Documentupdateconflict."}#weneedthat_revvaluenow
67. PUT things
rightPUT/pouch/tek{"_rev":"189af21439a03933bc3fc8c14cbeb496e","php":"tek"}#thatrepresentsanewline#doccouldalsocontaintheid{"ok":true,"id":"tek","rev":"2fff750985c2c2602e859fe38cd1d347e"}
69. A bit
aboutattachmentsEachattachmenttoadochasitsownURL:/pouch/tek/photo/pouch/tek/schedule.pdfeachattachmentshasitsownmimetypeattachmentscanbeadded/updatedviatheirownURLsorinline
70. DELETE (failure) on
purpose...againDELETE/pouch/tek{"error":"conflict","reason":"Documentupdateconflict."}#youalwayshavetosendarevwhenchangingadocinanyway
73. That was just the very basics GET/_stats(serverstats)
GET/_all_dbs(listallDBs) GET/_all_docs(listalldocs)
GET/db/_changes(listrecent changes) superpowers!
74. Map/Reduce Queriessearching the le
draweressentiallystoredqueriesa.k.a.ViewswritteninJavaScript(orPythonorRubyorErlangorPHP?)similartoarray_map()/array_reduce(),butscalablenoadhocqueries
75. Pouchput your media in the Couch starring PHP!
76. i want to
coverschemalessJSONdocs_securityBinaryAttachmentsserversiderenderingstuffMap/Reduce
_show Javascript _list severalexamplesURLRewritingreplication
_rewritesecurity vhosts validate_doc_updates