Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

CouchConf-NYC-Developing-with-Couchbase

896 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

CouchConf-NYC-Developing-with-Couchbase

  1. 1. Developing
with
Couchbase
Server 1
  2. 2. 2
  3. 3. Easy
to
Install Easy
to
Get
Started(Building
on)
Open
Source 2
  4. 4. LANGUAGE
SUPPORT 3
  5. 5. LANGUAGE
SUPPORTRuby,
Java,
PHP,
C#,
Python,
Node.js 3
  6. 6. LANGUAGE
SUPPORTRuby,
Java,
PHP,
C#,
Python,
Node.js More
soon! 3
  7. 7. SUPPORT
ALL
COUCHBASE
2.0
FEATURES 4
  8. 8. SUPPORT
ALL
COUCHBASE
2.0
FEATURES get,
set,
add,
replace,
delete 4
  9. 9. SUPPORT
ALL
COUCHBASE
2.0
FEATURES get,
set,
add,
replace,
delete touch,
gat,
getl,
sync 4
  10. 10. SUPPORT
ALL
COUCHBASE
2.0
FEATURES get,
set,
add,
replace,
delete touch,
gat,
getl,
sync views 4
  11. 11. BEST
PRACTICES
ARE
BUILT
IN 5
  12. 12. BEST
PRACTICES
ARE
BUILT
IN Data
Access
PaPerns 5
  13. 13. BEST
PRACTICES
ARE
BUILT
IN Data
Access
PaPerns PaginaQon 5
  14. 14. BEST
PRACTICES
ARE
BUILT
IN Data
Access
PaPerns PaginaQonAccess
to
Development
and
ProducQon
Views 5
  15. 15. THE
SERVER 6
  16. 16. THE
SERVER(BUCKETS
AND
VIEWS) 6
  17. 17. THE
DATA 7
  18. 18. THE
DATA(PRESIDENTS
AND
U.S.
EVENTS) 7
  19. 19. THE
VIEWS 8
  20. 20. THE
VIEWS(PRESIDENT_NAMES,
BY_STATE,
PRESIDENT_EVENTS) 8
  21. 21. QUICK
RUBY
EXAMPLE 9
  22. 22. QUICK
RUBY
EXAMPLE (COUCHBASE
GEM
IN
IRB) 9
  23. 23. 10
  24. 24. require couchbaserequire uuidDEFAULT_BUCKET_URL = http://localhost:8091/pools/defaultcouchbase = Couchbase.new(DEFAULT_BUCKET_URL) 10
  25. 25. require couchbaserequire uuidDEFAULT_BUCKET_URL = http://localhost:8091/pools/defaultcouchbase = Couchbase.new(DEFAULT_BUCKET_URL)design_doc = couchbase.design_docs[‘design_doc’]design_doc.views[‘president_names’, ‘president_events’, ‘by_party’, ‘by_state’] 10
  26. 26. require couchbaserequire uuidDEFAULT_BUCKET_URL = http://localhost:8091/pools/defaultcouchbase = Couchbase.new(DEFAULT_BUCKET_URL)design_doc = couchbase.design_docs[‘design_doc’]design_doc.views[‘president_names’, ‘president_events’, ‘by_party’, ‘by_state’]design_doc.president_names(:reduce => false).each { |doc| puts "#{doc[key]}: #{doc[value]}"} 10
  27. 27. QUICK
JAVA
EXAMPLE 11
  28. 28. QUICK
JAVA
EXAMPLE(SPYMEMCACHED
IN
GROOVYSH) 11
  29. 29. CONNECTING
TO
THE
SERVERimport net.spy.memcached.CouchbaseClientimport net.spy.memcached.protocol.couch.Queryimport java.util.LinkedListSERVER_URI = "http://127.0.0.1:8091/pools"uris = new LinkedList()uris.add(URI.create(SERVER_URI))couchbase = new CouchbaseClient(uris, "default", "") 12
  30. 30. A
QUERYquery = new Query()query.setReduce(false)view = couchbase.getView("design_doc", "president_names")future = couchbase.asyncQuery(view, query)viewResponse = future.get()iterator = viewResponse.iterator()while (iterator.hasNext()) { viewRow = iterator.next() println("Key: " + viewRow.key + ", Value:" + viewRow.value)} 13
  31. 31. QUICK
PHP
EXAMPLE 14
  32. 32. QUICK
PHP
EXAMPLE(PHP‐COUCHBASE
IN
PHPSH) 14
  33. 33. include "Couchbase.php";$couchbase = new Couchbase;$couchbase->addCouchbaseServer("localhost");$view = $couchbase->getView("design_doc", "by_state");$result = $view->getResult();foreach($result AS $row) { echo $row->value; 15
  34. 34. GET
STARTED! 16
  35. 35. GET
STARTED!gem
install
couchbase 16
  36. 36. GET
STARTED! gem
install
couchbasehPp://www.couchbase.org/code/couchbase/java/2.0 16
  37. 37. GET
STARTED! gem
install
couchbasehPp://www.couchbase.org/code/couchbase/java/2.0 hPp://github.com/couchbaselabs/php‐couchbase 16
  38. 38. HTTP://WWW.COUCHBASE.ORG 17
  39. 39. HTTP://WWW.COUCHBASE.ORG Downloads Geng
Started
Guides In‐Depth
Tutorials Screencasts 17
  40. 40. QUESTIONS? 18

×