CouchConf-SF-Developing-with-Couchbase

3,480 views

Published on

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

No Downloads
Views
Total views
3,480
On SlideShare
0
From Embeds
0
Number of Embeds
1,280
Actions
Shares
0
Downloads
34
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

CouchConf-SF-Developing-with-Couchbase

  1. 1. Developing  with  Couchbase  Server Ma7  Ingenthron,  Jan  Lehnardt,  Jason  Sirota 1Friday, August 5, 2011
  2. 2. LOWERING  THE  BAR 2Friday, August 5, 2011
  3. 3. LOWERING  THE  BAR 2Friday, August 5, 2011
  4. 4. LOWERING  THE  BAR Easy  to  Install Easy  to  get  Started (building  on)  Open  Source 3Friday, August 5, 2011
  5. 5. LANGUAGE  SUPPORT Java,  C#,  PHP,  Ruby,  Python*,  Node.js* More  soon! Any  plain  “old”  memcached/CouchDB  library,  really. 4Friday, August 5, 2011
  6. 6. SUPPORT  ALL  COUCHBASE  2.0   FEATURES Views touch,  gat,  getl,  sync 5Friday, August 5, 2011
  7. 7. BEST  PRACTICES  BUILT  IN View  Efficiency PaginaVon Maintaining  Development  and  ProducVon  Views 6Friday, August 5, 2011
  8. 8. QUICK  JAVA  EXAMPLE MaX  Ingenthron 7Friday, August 5, 2011
  9. 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. 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. 11. QUICK  PHP  EXAMPLE Jan  Lehnardt 10Friday, August 5, 2011
  12. 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. 13. <?php $obj = new stdClass; $obj->name = "Simon"; $cb->set("a", json_encode($obj)); 12Friday, August 5, 2011
  14. 14. <?php $obj = new stdClass; $obj->name = "James"; $cb->set("a", json_encode($obj)); 13Friday, August 5, 2011
  15. 15. <?php $obj = new stdClass; $obj->name = "Ben"; $cb->set("a", json_encode($obj)); 14Friday, August 5, 2011
  16. 16. 15Friday, August 5, 2011
  17. 17. Design  Doc Name 16Friday, August 5, 2011
  18. 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. 19. $ php test.php Ben James Simon $ 18Friday, August 5, 2011
  20. 20. Friday, August 5, 2011
  21. 21. <?php $result = $view->getResultByKey("Ben"); 20Friday, August 5, 2011
  22. 22. <?php $result = $view->getResultByKeyRange("Ben", "James"); 21Friday, August 5, 2011
  23. 23. <?php $result = $view->getValues(); // {"name": "Ben"} // {"name": "James"} // {"name": "Simon"} 22Friday, August 5, 2011
  24. 24. <?php $resultPages = $view->getResultPaginator(); foreach($resultPages AS $page) { // $page is a Couchbase_ViewResult instance } 23Friday, August 5, 2011
  25. 25. HTTP://GITHUB.COM/ COUCHBASELABS/PHP-­‐COUCHBASE (BE  GENTLE) 24Friday, August 5, 2011
  26. 26. QUICK  .NET  EXAMPLE Jason  Sirota,  Couchbase  .NET  client  contributor (Open  Source  is  Awesome!) 25Friday, August 5, 2011
  27. 27. SDK  CENTER  ON HTTP://COUCHBASE.ORG Downloads Ge`ng  Started  Guides In-­‐depth  Tutorials Contribute 26Friday, August 5, 2011
  28. 28. QUESTIONS? 27Friday, August 5, 2011
  29. 29. THANKS! 28Friday, August 5, 2011
  30. 30. THANKS! 29Friday, August 5, 2011
  31. 31. Friday, August 5, 2011

×