Your SlideShare is downloading. ×
0
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
CouchConf-SF-Developing-with-Couchbase
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

CouchConf-SF-Developing-with-Couchbase

2,933

Published on

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,933
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
32
Comments
0
Likes
1
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. Developing  with  Couchbase  Server Ma7  Ingenthron,  Jan  Lehnardt,  Jason  Sirota 1Friday, August 5, 2011
  • 2. LOWERING  THE  BAR 2Friday, August 5, 2011
  • 3. LOWERING  THE  BAR 2Friday, August 5, 2011
  • 4. LOWERING  THE  BAR Easy  to  Install Easy  to  get  Started (building  on)  Open  Source 3Friday, August 5, 2011
  • 5. LANGUAGE  SUPPORT Java,  C#,  PHP,  Ruby,  Python*,  Node.js* More  soon! Any  plain  “old”  memcached/CouchDB  library,  really. 4Friday, August 5, 2011
  • 6. SUPPORT  ALL  COUCHBASE  2.0   FEATURES Views touch,  gat,  getl,  sync 5Friday, August 5, 2011
  • 7. BEST  PRACTICES  BUILT  IN View  Efficiency PaginaVon Maintaining  Development  and  ProducVon  Views 6Friday, August 5, 2011
  • 8. QUICK  JAVA  EXAMPLE MaX  Ingenthron 7Friday, August 5, 2011
  • 9. ! Query query = new Query(); ! View view = client.getView(“design”, “players”); ! ViewFuture future = client.query(view, query); ! ViewResponseWithDocs response = future.get(); ! Iterator<RowWithDocs> itr = response.iterator(); ! while (itr.hasNext()) { ! ! RowWithDocs row = itr.next(); ! ! // do something row.getDoc(); ! } 8Friday, August 5, 2011
  • 10. ! Query query = new Query(); ! View view = client.getView(“design”, “players”); ! HttpFuture<ViewResponseNoDocs> future = client.queryAndExcludeDocs(view, query); ! ViewResponseNoDocs response = future.get(); ! Iterator<RowNoDocs> itr = response.iterator(); ! while (itr.hasNext()) { ! ! RowNoDocs row = itr.next(); ! ! // do something with row.getKey(); row.getValue(); ! } 9Friday, August 5, 2011
  • 11. QUICK  PHP  EXAMPLE Jan  Lehnardt 10Friday, August 5, 2011
  • 12. <?php // setup include "Couchbase.php"; $cb = new Couchbase; $cb->addCouchbaseServer("localhost"); $cb->set("a", 1); echo $cb->get("a"); 11Friday, August 5, 2011
  • 13. <?php $obj = new stdClass; $obj->name = "Simon"; $cb->set("a", json_encode($obj)); 12Friday, August 5, 2011
  • 14. <?php $obj = new stdClass; $obj->name = "James"; $cb->set("a", json_encode($obj)); 13Friday, August 5, 2011
  • 15. <?php $obj = new stdClass; $obj->name = "Ben"; $cb->set("a", json_encode($obj)); 14Friday, August 5, 2011
  • 16. 15Friday, August 5, 2011
  • 17. Design  Doc Name 16Friday, August 5, 2011
  • 18. <?php Design  Doc Name $view = $db->getView("design_doc", "name"); $result = $view->getResult(); foreach($result AS $row) { echo $row->value; } 17Friday, August 5, 2011
  • 19. $ php test.php Ben James Simon $ 18Friday, August 5, 2011
  • 20. Friday, August 5, 2011
  • 21. <?php $result = $view->getResultByKey("Ben"); 20Friday, August 5, 2011
  • 22. <?php $result = $view->getResultByKeyRange("Ben", "James"); 21Friday, August 5, 2011
  • 23. <?php $result = $view->getValues(); // {"name": "Ben"} // {"name": "James"} // {"name": "Simon"} 22Friday, August 5, 2011
  • 24. <?php $resultPages = $view->getResultPaginator(); foreach($resultPages AS $page) { // $page is a Couchbase_ViewResult instance } 23Friday, August 5, 2011
  • 25. HTTP://GITHUB.COM/ COUCHBASELABS/PHP-­‐COUCHBASE (BE  GENTLE) 24Friday, August 5, 2011
  • 26. QUICK  .NET  EXAMPLE Jason  Sirota,  Couchbase  .NET  client  contributor (Open  Source  is  Awesome!) 25Friday, August 5, 2011
  • 27. SDK  CENTER  ON HTTP://COUCHBASE.ORG Downloads Ge`ng  Started  Guides In-­‐depth  Tutorials Contribute 26Friday, August 5, 2011
  • 28. QUESTIONS? 27Friday, August 5, 2011
  • 29. THANKS! 28Friday, August 5, 2011
  • 30. THANKS! 29Friday, August 5, 2011
  • 31. Friday, August 5, 2011

×