cc boston couchbase server demo & tour

29
1 Couchbase Server Raghavan “Rags” N. Srinivas Developer Advocate

Upload: couchbase

Post on 13-Jul-2015

572 views

Category:

Technology


4 download

TRANSCRIPT

1  

Couchbase  Server  

Raghavan  “Rags”  N.  Srinivas  Developer  Advocate  

2  

•  Architect  and  Evangelist  working  with  developers  •  Speaker  at  JavaOne,  RSA  conferences,  Sun  Tech  Days,  JUGs  and  other  developer  conferences  

•  Taught  undergrad  and  grad  courses  •  Technology  Evangelist  at  Sun  Microsystems  for  10+  years  

•  SMll  trying  to  understand  and  work  more  effecMvely  on  Java  and  distributed  systems  

•  Couchbase  Developer  Advocate  working  with  Java  and  Ruby  developers  

•  Philosophy:  “Be#er  to  have  an  unanswered  ques1on  than  a  unques1oned  answer”  

Speaker  IntroducMon  

3  

Couchbase  Server  

=  •  Simple  •  Fast  •  ElasMc  •  NoSQL  Database  

Formerly  known  as  Membase  Server  

4  

Couchbase  Server  Features  

•  Built-­‐in  clustering  –  All  nodes  equal  

•  Data  replicaMon  with  auto-­‐failover  

•  Zero-­‐-­‐downMme  maintenance      

•  Clone  to  grow  and  scale  horizontally  

5  

Couchbase  Server  Basic  OperaMon  

                           

                           

         

COUCHBASE  CLIENT  LIBRARY      

§ Docs  distributed  evenly  across  servers  in  the  cluster  

§ Each  server  stores  both  ac1ve  &  replica  docs  §  Only  one  server  acMve  at  a  Mme  

§ Client  library  provides  app  with  simple  interface  to  database  

§ Cluster  map  provides  map  to  which  server  doc  is  on  §  App  never  needs  to  know  

§  App  reads,  writes,  updates  docs  

§  MulMple  App  Servers  can  access  same  document  at  same  Mme  

 

                           

Doc  4  

Doc  2  

Doc  5  

SERVER  1  

Doc  6  

Doc  4  

SERVER  2  

Doc  7  

Doc  1  

SERVER  3  

Doc  3  

Read/Write/Update  

         

COUCHBASE  CLIENT  LIBRARY      

Read/Write/Update  

Doc  9  

Doc  7  

Doc  8   Doc  6  

Doc  3  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

Doc  9  

Doc  5  

DOC  

DOC  

DOC  

Doc  1  

Doc  8   Doc  2  

Replica  Docs   Replica  Docs   Replica  Docs  

AcMve  Docs   AcMve  Docs   AcMve  Docs  

CLUSTER  MAP      

CLUSTER  MAP      

APP  SERVER  1   APP  SERVER  2  

COUCHBASE  SERVER  CLUSTER  

6  

Add  Nodes  

                           

                           

§  Two  servers  added  to  cluster  §  One-­‐click  operaMon  

§  Docs  automaMcally  rebalanced  across  cluster  §  Even  distribuMon  of  

docs  §  Minimum  doc  movement  

§  Cluster  map  updated  

§  App  database  calls  now  distributed  over  larger  #  of  servers  

Read/Write/Update   Read/Write/Update  

Doc  7  

Doc  9  

Doc  3  

AcMve  Docs  

Replica  Docs  

Doc  6  

         

COUCHBASE  CLIENT  LIBRARY      CLUSTER  MAP  

   

APP  SERVER  1  

         

COUCHBASE  CLIENT  LIBRARY      CLUSTER  MAP  

   

APP  SERVER  2  

                           

                           

                           

Doc  4  

Doc  2  

Doc  5  

SERVER  1  

Doc  6  

Doc  4  

SERVER  2  

Doc  7  

Doc  1  

SERVER  3  

Doc  3  

Doc  9  

Doc  7  

Doc  8   Doc  6  

Doc  3  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

Doc  9  

Doc  5  

DOC  

DOC  

DOC  

Doc  1  

Doc  8   Doc  2  

Replica  Docs   Replica  Docs   Replica  Docs  

AcMve  Docs   AcMve  Docs   AcMve  Docs  

SERVER  4   SERVER  5  

AcMve  Docs   AcMve  Docs  

Replica  Docs   Replica  Docs  

COUCHBASE  SERVER  CLUSTER  

7  

Fail  Over  Node  

                           

                           

Doc  7  

Doc  9  

Doc  3  

AcMve  Docs  

Replica  Docs  

Doc  6  

         

COUCHBASE  CLIENT  LIBRARY      CLUSTER  MAP  

   

         

COUCHBASE  CLIENT  LIBRARY      CLUSTER  MAP  

   

                           

                           

                           

Doc  4  

Doc  2  

Doc  5  

SERVER  1  

Doc  6  

Doc  4  

SERVER  2  

Doc  7  

Doc  1  

SERVER  3  

Doc  3  

Doc  9  

Doc  7   Doc  8  

Doc  6  

Doc  3  

DOC  

DOC  

DOC  DOC  

DOC  

DOC  

DOC  

DOC  

DOC   DOC  

DOC  

DOC  

DOC  

Doc  9  

Doc  5  DOC  

DOC  

DOC  

Doc  1  

Doc  8  

Doc  2  

Replica  Docs   Replica  Docs   Replica  Docs  

AcMve  Docs   AcMve  Docs   AcMve  Docs  

SERVER  4   SERVER  5  

AcMve  Docs   AcMve  Docs  

Replica  Docs   Replica  Docs  

COUCHBASE  SERVER  CLUSTER  

DOC  

DOC  

§  App  servers  happily  accessing  docs  on  Server  3  

§  Server  fails  §  App  server  requests  to  server  3  fail  §  Cluster  detects  server  has  failed  

§  Promotes  replicas  of  docs  to  ac1ve  §  Updates  cluster  map  

§  App  server  requests  for  docs  now  go  to  appropriate  server  

§  Typically  rebalance  would  follow    

8  

Couchbase  Server  Features  

•  Memcached  compaMble  (built-­‐in  caching)  

•  Monitoring  and  administraMon  APIs  and  GUI    

•  Reliable  storage  architecture      

9  

Couchbase  Server  1.8  Architecture  

Heartbeat  

Process  m

onito

r  

Glob

al  singleton  supe

rviso

r  

Confi

guraMo

n  manager  

on  each  node  

Rebalance  orchestrator  

Nod

e  he

alth  m

onito

r  

one  per  cluster  

vBucket  state  and

 replicaM

on  m

anager  

hkp  RE

ST  m

anagem

ent  A

PI/W

eb  UI  

HTTP  8091  

Erlang  port  mapper  4369  

Distributed  Erlang  21100  -­‐  21199  

Erlang/OTP  

Cluster  Manager  

Persistence  Layer  

storage  interface  

Memcached  

Couchbase  EP  Engine  

11210  Memcapable    2.0  

Moxi  

11211  Memcapable    1.0  

Data  Manager  

10  

Couchbase  Server  1.8  Architecture  

Persistence  Layer  

storage  interface  

Heartbeat  

Process  m

onito

r  

Glob

al  singleton  supe

rviso

r  

Confi

guraMo

n  manager  

on  each  node  

Rebalance  orchestrator  

Nod

e  he

alth  m

onito

r  

one  per  cluster  

vBucket  state  and

 replicaM

on  m

anager  

hkp  RE

ST  m

anagem

ent  A

PI/W

eb  UI  

Memcached  

Couchbase  EP  Engine  

11210  Memcapable    2.0  

Moxi  

11211  Memcapable    1.0  

HTTP  8091  

Erlang  port  mapper  4369  

Distributed  Erlang  21100  -­‐  21199  

Erlang/OTP  

11  

Couchbase  Server  1.8  Architecture  

Heartbeat  

Process  m

onito

r  

Confi

guraMo

n  Manager  

Glob

al  singleton  supe

rviso

r  

on  each  node  

Rebalance  orchestrator  

Nod

e  he

alth  m

onito

r  

one  per  cluster  

vBucket  state  and

 replicaM

on  m

anager  

hNp  RE

ST  M

anagem

ent  /Web

UI  

HTTP  8091  

Erlang  port  mapper  4369  

Distributed  Erlang  21100  -­‐  21199  

Erlang/OTP  

Persistence  Layer  

storage  interface  

Memcached  

Couchbase  EP  Engine  

11210  Memcapable    2.0  

Moxi  

11211  Memcapable    1.0  

12  

Couchbase  SDKs  

Java    SDK  

.Net  SDK  

PHP  SDK  

Ruby  SDK  

…and  many  more  

Java  client  API  

User  Code  

Couchbase  Server  

CouchbaseClient  cb  =  new  CouchbaseClient(listURIs,  "aBucket",  "letmein");    cb.set("hello",  0,  "world");  cb.get("hello");  

hkp://www.couchbase.com/develop  

Couchbase  Java  Library  (spymemcached)  

13  

DEMO  TIME  

14  

Couchbase  Server  2.0  

•  Next  major  release  of  Couchbase  Server  •  Currently  in  Developer  Preview  

What’s  new:  •  Indexing  and  Querying  •  Incremental  Map  Reduce  •  Cross  Data  Center  ReplicaMon  

•  Fully  backwards  compaMble  with  exisMng  Couchbase  Server  

15  

Couchbase  Server  2.0  Architecture  

Heartbeat  

Process  m

onito

r  

Glob

al  singleton  supe

rviso

r  

Confi

guraMo

n  manager  

on  each  node  

Rebalance  orchestrator  

Nod

e  he

alth  m

onito

r  

one  per  cluster  

vBucket  state  and

 replicaM

on  m

anager  

hNp  RE

ST  m

anagem

ent  A

PI/W

eb  UI  

HTTP  8091  

Erlang  port  mapper  4369  

Distributed  Erlang  21100  -­‐  21199  

Erlang/OTP  

storage  interface  

Couchbase  EP  Engine  

11210  Memcapable    2.0  

Moxi  

11211  Memcapable    1.0  

Memcached  

New  Persistence  Layer  

8092  Query  API  

Que

ry  Engine  

16  

Indexing  and  Querying  

                           

                           

                           

APP  SERVER  1            

COUCHBASE  CLIENT  LIBRARY      

§ Indexing  work  is  distributed  amongst  nodes  §  Large  data  set  possible  §  Parallelize  the  effort  

§ Each  node  has  index  for  data  stored  on  it  

§ Queries  combine  the  results  from  required  nodes  

 

CLUSTER  MAP  

Doc  4  

Doc  2  

Doc  5  

SERVER  1  

Doc  6  

Doc  4  

SERVER  2  

Doc  7  

Doc  1  

SERVER  3  

Doc  3  

APP  SERVER  2            

COUCHBASE  CLIENT  LIBRARY      CLUSTER  MAP  

Doc  9  

Doc  7  

Doc  8   Doc  6  

Doc  3  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

DOC  

Doc  9  

Doc  5  

DOC  

DOC  

DOC  

Doc  1  

Doc  8   Doc  2  

Replica  Docs   Replica  Docs   Replica  Docs  

AcMve  Docs   AcMve  Docs   AcMve  Docs  

         

COUCHBASE  CLIENT  LIBRARY      

         

COUCHBASE  CLIENT  LIBRARY      CLUSTER  MAP  

   

CLUSTER  MAP      

APP  SERVER  1   APP  SERVER  2  

Query  Response  

17  

Cross  Data  Center  ReplicaMon  

§ Data  close  to  users  § MulMple  locaMons  for  disaster  recovery  § Independently  managed  clusters  serving  local  data  

US  DATA  CENTER  

 

EUROPE  DATA  CENTER  

 

ASIA  DATA  CENTER  

 Replica]on   Replica]on  

Replica]on  

18  

DEMO  TIME  

19  

Demo:  The  next  big  social  game  

3  Objects  (documents)  within  game:  • Players  • Monsters  •  Items  

 Gameplay:  

• Players  fight  monsters  • Monsters  drop  items  • Players  own  items  

20  

Player  Document  

{    "_id":  "Keith4540",    "jsonType":  "player",    "uuid":  "35767d02-­‐a958-­‐4b83-­‐8179-­‐616816692de1",    "name":  "Keith4540",    "hitpoints":  75,    "experience":  663,    "level":  4,    "loggedIn":  false  

}    

21  

Item  Document  

{    "_id":  "Katana_e5890c94-­‐11c6-­‐48-­‐65746ce6c560",    "jsonType":  "item",    "name":  "Katana_e5890c94-­‐11c6-­‐65746ce6c560",    "uuid":  "e5890c94-­‐11c6-­‐4856-­‐a7a6-­‐65746ce6c560",    "ownerId":  "Dale9887"  

}  Player  “_id”  

22  

Monster  Document  

{    "_id":  "Bauchan9932”,    "jsonType":  "monster",    "name":  "Bauchan9932",    "uuid":  "d10dfc1b-­‐0412-­‐4140-­‐b4ec-­‐affdbf2aa5ec",    "hitpoints":  370,    "experienceWhenKilled":  52,    "itemProbability":  0.5050581341872865  

}  

23  

GAME  ON!  

24  

THANK  YOU!  

Get  Couchbase  Server  2.0  at    hkp://www.couchbase.com/downloads  

 Give  us  feedback  at:  

hkp://www.couchbase.com/forums  

25  

QUESTIONS?  

26  

Boston  May  15,  2012  

27  

#CouchConf  

TweeMng  

28  

Tell  us  what  you  think!  

Fill  in  the  conference  eval  form  in  your  

conference  bag.      

Turn  it  in  axer  the  closing  session  for  your  World  Tour    

t-­‐shirt!  

29  

Submit  your  quesMons!  

Submit  your  quesMons  for  the  Couchbase  Q&A  Panel  at  the  end  of  the  conference  to:  

 [email protected]