SlideShare una empresa de Scribd logo
1 de 36
Introduc+on	
  to	
  	
  
Couchbase	
  Server	
  2.0	
  




                                 1	
  
Couchbase	
  Server	
  


      NoSQL	
  Document	
  Database	
  
                    	

                      2.0


                                          2	
  
Couchbase	
  Server	
  


                    Easy	
                                                    Consistent	
  High	
  
                 Scalability	
                        PE
                                                           RF O R M A N C E
                                                                               Performance	
  
       Grow	
  cluster	
  without	
                 Consistent	
  sub-­‐millisecond	
  	
  
    applica+on	
  changes,	
  without	
           read	
  and	
  write	
  response	
  +mes	
  	
  
    down+me	
  with	
  a	
  single	
  click	
     with	
  consistent	
  high	
  throughput	
  



                 Always	
  On	
                                                Flexible	
  Data	
  
                  24x365	
                                                        Model	
  
                                                    JSON
                                                  JSON JSO
                                                              N
                                                   JSON
                                                   JSON




    No	
  down+me	
  for	
  soGware	
                 JSON	
  document	
  model	
  with	
  
        upgrades,	
  hardware	
                             no	
  fixed	
  schema.	
  
           maintenance,	
  etc.	
  

                                                                                                       3	
  
Flexible	
  Data	
  Model	
  


                                     	
  {	
  
                                     	
  	
  	
  	
  “ID”:	
  1,	
  
                                     	
  	
  	
  	
  “FIRST”:	
  “DipN”,	
  
                                     	
  	
  	
  	
  “LAST”:	
  “Borkar”,	
  
                                     	
  	
  	
  	
  “ZIP”:	
  “94040”,	
  
                                     	
  	
  	
  	
  “CITY”:	
  “MV”,	
  
                                     	
  	
  	
  	
  “STATE”:	
  “CA”	
  
                                      }	
                                                    JSON	
     JSON	
  
                                                                                  JSON	
  
                                                                       JSON	
  


         •  No	
  need	
  to	
  worry	
  about	
  the	
  database	
  when	
  changing	
  your	
  
            applica+on	
  
         •  Records	
  can	
  have	
  different	
  structures,	
  there	
  is	
  no	
  fixed	
  
            schema	
  
         •  Allows	
  painless	
  data	
  model	
  changes	
  for	
  rapid	
  applica+on	
  
            development	
  
         	
  
                                                                                                                   4	
  
Couchbase	
  Server	
  Features	
  

                       Built-­‐in	
  clustering	
  –	
  All	
  nodes	
  equal	
  
                       	
  
                       Data	
  replica+on	
  with	
  auto-­‐failover	
  
                       	
  
                       Zero-­‐-­‐down+me	
  maintenance	
  	
  
                       	
  
                       Clone	
  to	
  grow	
  and	
  scale	
  horizontally	
  
                       	
  
                       Built-­‐in	
  managed	
  cached	
  
                       	
  
                       Monitoring	
  and	
  administra+on	
  APIs	
  and	
  GUI	
  	
  
                       	
  
                       SDK	
  for	
  a	
  variety	
  of	
  languages	
  
                	
  
                       	
  
                                                                                          5	
  
New	
  in	
  2.0	
  


             JSON	
  support	
          Indexing	
  and	
  Querying	
  


                    JSON
                  JSON JSO
                   JSON N
                   JSON




     Incremental	
  Map	
  Reduce	
     Cross	
  data	
  center	
  replicaNon	
  




                                                                                    6	
  
Couchbase	
  Server	
  2.0	
  Architecture	
  
    8092	
                          11211	
                       11210	
  
    Query	
  API	
                  Memcapable	
  	
  1.0	
       Memcapable	
  	
  2.0	
  



                                        Moxi	
  
         Query	
  Engine	
  




                                                                                               REST	
  management	
  API/Web	
  UI	
  




                                                                                                                                                                                                                                                                                                                         vBucket	
  state	
  and	
  replica+on	
  manager	
  
                                                Memcached	
  




                                                                                                                                                                                                               Global	
  singleton	
  supervisor	
  


                                                                                                                                                                                                                                                        Rebalance	
  orchestrator	
  
                                                                                                                                                                                  Configura+on	
  manager	
  




                                                                                                                                                                                                                                                                                         Node	
  health	
  monitor	
  
                                                                                                                                                         Process	
  monitor	
  
                                                                                                                                         Heartbeat	
  
                                      Couchbase	
  EP	
  Engine	
  
                               Data	
  Manager	
                                                                         Cluster	
  Manager	
  
                                                                storage	
  interface	
  




                               New	
  Persistence	
  Layer	
                                  hp	
                                              on	
  each	
  node	
                                                                                  one	
  per	
  cluster	
  



                                                                                                                                                                            Erlang/OTP	
  



                                                                                              HTTP	
                                         Erlang	
  port	
  mapper	
                                                                                                                 Distributed	
  Erlang	
  
                                                                                              8091	
                                         4369	
                                                                                                                                     21100	
  -­‐	
  21199	
  
                                                                                                                                                                                                                                                                                                                                                                                7	
  
Couchbase	
  Server	
  2.0	
  Architecture	
  
    8092	
                          11211	
                       11210	
  
    Query	
  API	
                  Memcapable	
  	
  1.0	
       Memcapable	
  	
  2.0	
  



                                        Moxi	
  
         Query	
  Engine	
  




                                                                                               REST	
  management	
  API/Web	
  UI	
  




                                                                                                                                                                                                                                                                                                                         vBucket	
  state	
  and	
  replica+on	
  manager	
  
                                        Object-­‐level	
  Cache	
  




                                                                                                                                                                                                               Global	
  singleton	
  supervisor	
  


                                                                                                                                                                                                                                                        Rebalance	
  orchestrator	
  
                                                                                                                                                                                  Configura+on	
  manager	
  




                                                                                                                                                                                                                                                                                         Node	
  health	
  monitor	
  
                                                                                                                                                         Process	
  monitor	
  
                                                                                                                                         Heartbeat	
  
                                      Couchbase	
  EP	
  Engine	
  

                                                                storage	
  interface	
  




                               New	
  Persistence	
  Layer	
                                  hp	
                                              on	
  each	
  node	
                                                                                  one	
  per	
  cluster	
  



                                                                                                                                                                            Erlang/OTP	
  



                                                                                              HTTP	
                                         Erlang	
  port	
  mapper	
                                                                                                                 Distributed	
  Erlang	
  
                                                                                              8091	
                                         4369	
                                                                                                                                     21100	
  -­‐	
  21199	
  
                                                                                                                                                                                                                                                                                                                                                                                8	
  
Couchbase	
  deployment	
  


                          Web	
  
                        Applica+on	
  

                        Couchbase	
  
                       Client	
  Library	
  

    Data	
  Flow	
  




                                               Cluster	
  Management	
  


                                                                           9	
  
COUCHBASE	
  OPERATIONS	
  




                              10	
  
Single	
  node	
  -­‐	
  Couchbase	
  Write	
  Opera+on	
  
                                                                                 2	
  

                                                                  Doc	
  1	
  
                                 App	
  Server	
  




                                                          3	
            2	
             3	
  
                                                         Managed	
  Cache	
  
     To	
  other	
  node	
     Replica+on	
  
                                 Queue	
                          Doc	
  1	
  




                                                                                                 Disk	
  Queue	
  
                                           Disk	
  




                                                      Couchbase	
  Server	
  Node	
                                  11	
  
Single	
  node	
  -­‐	
  Couchbase	
  Update	
  Opera+on	
  
                                                                                2	
  

                                                                Doc	
  1’	
  
                                App	
  Server	
  




                                                         3	
            2	
             3	
  
                                                        Managed	
  Cache	
  
    To	
  other	
  node	
     Replica+on	
  
                                                                Doc	
  1	
  
                                                                Doc	
  1’	
  
                                Queue	
  




                                                                                                Disk	
  Queue	
  
                                          Disk	
  
                                                                 Doc	
  1	
  




                                                     Couchbase	
  Server	
  Node	
                                  12	
  
Single	
  node	
  -­‐	
  Couchbase	
  Read	
  Opera+on	
  
                                                                                 2	
  




                                                                  Doc	
  1	
  
                                                                   GET	
  
                                 App	
  Server	
  




                                                          3	
            2	
             3	
  
                                                         Managed	
  Cache	
  
     To	
  other	
  node	
     Replica+on	
  
                                 Queue	
                          Doc	
  1	
  




                                                                                                 Disk	
  Queue	
  
                                           Disk	
  
                                                                  Doc	
  1	
  




                                                      Couchbase	
  Server	
  Node	
                                  13	
  
Single	
  node	
  -­‐	
  Couchbase	
  Cache	
  Evic+on	
  
                                                                                                       2	
  

                                                                                 Doc	
  6	
  
                                                                                        2
                                                                                        3
                                                                                        4
                                                                                        5
                                 App	
  Server	
  




                                                                3	
            2	
                             3	
  
                                                               Managed	
  Cache	
  
     To	
  other	
  node	
     Replica+on	
  
                                 Queue	
                                         Doc	
  1	
  




                                                                                                                       Disk	
  Queue	
  
                                           Disk	
  
                                                                                 Doc	
  1	
  


                                            Doc	
  6	
   Doc	
  5	
   Doc	
  4	
   Doc	
  3	
   Doc	
  2	
  




                                                       Couchbase	
  Server	
  Node	
                                                       14	
  
Single	
  node	
  –	
  Couchbase	
  Cache	
  Miss	
  
                                                                                                             2	
  




                                                                                      Doc	
  1	
  
                                                                                       GET	
  
                                 App	
  Server	
  




                                                                 3	
            2	
                                       3	
  
                                                                Managed	
  Cache	
  
     To	
  other	
  node	
     Replica+on	
  
                                 Queue	
                                              Doc	
  1	
  
                                                           Doc	
  5	
   4	
   4	
  
                                                             Doc	
  
                                                                  Doc	
                              Doc	
  3	
   2	
  
                                                                                                       Doc	
  




                                                                                                                                  Disk	
  Queue	
  
                                           Disk	
  
                                                                                      Doc	
  1	
  


                                            Doc	
  6	
   Doc	
  5	
   Doc	
  4	
   Doc	
  3	
   Doc	
  2	
  




                                                       Couchbase	
  Server	
  Node	
                                                                  15	
  
Cluster	
  wide	
  -­‐	
  Basic	
  Opera+on	
  

                            APP	
  SERVER	
  1	
                                                APP	
  SERVER	
  2	
  
                   COUCHBASE	
  Client	
  Library	
                                      COUCHBASE	
  Client	
  Library	
  
                             	
                                                                    	
  
                       CLUSTER	
  MAP	
  
                             	
                                                              CLUSTER	
  MAP	
  
                                                                                                   	
  


                                          READ/WRITE/UPDATE	
  

                        SERVER	
  1	
  
                           	
                                       SERVER	
  2	
  
                                                                       	
                                    SERVER	
  3	
  
                                                                                                                	
                •  Docs	
  distributed	
  evenly	
  across	
  
                           	
  
                         ACTIVE	
  
                                                                       	
  
                                                                     ACTIVE	
  
                                                                                                                	
  
                                                                                                              ACTIVE	
  
                                                                                                                                     servers	
  	
  

                  Doc	
  5	
        Doc	
                      Doc	
  4	
      Doc	
                    Doc	
  1	
      Doc	
     •  Each	
  server	
  stores	
  both	
  acNve	
  and	
  
                                                                                                                                     replica	
  docs	
  
                  Doc	
  2	
        Doc	
                      Doc	
  7	
      Doc	
                    Doc	
  2	
      Doc	
  
                                                                                                                                     Only	
  one	
  server	
  ac+ve	
  at	
  a	
  +me	
  

                                                                                                                                  •  Client	
  library	
  provides	
  app	
  with	
  
                  Doc	
  9	
        Doc	
                      Doc	
  8	
      Doc	
                    Doc	
  6	
      Doc	
  
                                                                                                                                     simple	
  interface	
  to	
  database	
  
                        REPLICA	
                                    REPLICA	
                                REPLICA	
           •  Cluster	
  map	
  provides	
  map	
  	
  
                                                                                                                                     to	
  which	
  server	
  doc	
  is	
  on	
  
                  Doc	
  4	
        Doc	
                      Doc	
  6	
      Doc	
                    Doc	
  7	
      Doc	
        App	
  never	
  needs	
  to	
  know	
  

                  Doc	
  1	
        Doc	
                      Doc	
  3	
      Doc	
                    Doc	
  9	
      Doc	
     •  App	
  reads,	
  writes,	
  updates	
  docs	
  
                  Doc	
  8	
        Doc	
                      Doc	
  2	
      Doc	
                    Doc	
  5	
      Doc	
     •  MulNple	
  app	
  servers	
  can	
  access	
  same	
  
                                                                                                                                     document	
  at	
  same	
  Nme	
  
                                                      COUCHBASE	
  SERVER	
  	
  CLUSTER	
  


User	
  Configured	
  Replica	
  Count	
  =	
  1	
                                                                                                                                           16	
  
Cluster	
  wide	
  -­‐	
  Add	
  Nodes	
  to	
  Cluster	
  

                                   APP	
  SERVER	
  1	
                                                        APP	
  SERVER	
  2	
  
                            COUCHBASE	
  Client	
  Library	
                                             COUCHBASE	
  Client	
  Library	
  
                                      	
                                                                           	
  
                                CLUSTER	
  MAP	
  
                                      	
                                                                     CLUSTER	
  MAP	
  
                                                                                                                   	
  


                                                READ/WRITE/UPDATE	
                                                                 READ/WRITE/UPDATE	
  


          SERVER	
  1	
  
             	
                                       SERVER	
  2	
  
                                                         	
                            SERVER	
  3	
  
                                                                                          	
                              SERVER	
  4	
  
                                                                                                                             	
                  SERVER	
  5	
  
                                                                                                                                                    	
             •  Two	
  servers	
  added	
  
             	
  
           ACTIVE	
  
                                                         	
  
                                                       ACTIVE	
  
                                                                                          	
  
                                                                                        ACTIVE	
  
                                                                                                                             	
  
                                                                                                                           ACTIVE	
  
                                                                                                                                                    	
  
                                                                                                                                                  ACTIVE	
  
                                                                                                                                                                      One-­‐click	
  operaNon	
  

     Doc	
  5	
       Doc	
                   Doc	
  4	
         Doc	
            Doc	
  1	
      Doc	
                                                            •  Docs	
  automaNcally	
  
                                                                                                                                                                      rebalanced	
  across	
  
     Doc	
  2	
       Doc	
                   Doc	
  7	
         Doc	
            Doc	
  2	
      Doc	
                                                               cluster	
  
                                                                                                                                                                      Even	
  distribu+on	
  of	
  docs	
  
                                                                                                                                                                      Minimum	
  doc	
  movement	
  
     Doc	
  9	
       Doc	
                   Doc	
  8	
         Doc	
            Doc	
  6	
      Doc	
  
                                                                                                                                                                   •  Cluster	
  map	
  updated	
  
           REPLICA	
                                   REPLICA	
                        REPLICA	
                          REPLICA	
              REPLICA	
  
                                                                                                                                                                   •  App	
  database	
  	
  
     Doc	
  4	
       Doc	
                   Doc	
  6	
         Doc	
            Doc	
  7	
      Doc	
                                                               calls	
  now	
  distributed	
  	
  
                                                                                                                                                                      over	
  larger	
  number	
  of	
  
     Doc	
  1	
       Doc	
                   Doc	
  3	
         Doc	
            Doc	
  9	
      Doc	
  
                                                                                                                                                                      servers	
  
                                                                                                                                                                      	
  
     Doc	
  8	
       Doc	
                   Doc	
  2	
         Doc	
            Doc	
  5	
      Doc	
  


                                                                        COUCHBASE	
  SERVER	
  	
  CLUSTER	
  


User	
  Configured	
  Replica	
  Count	
  =	
  1	
                                                                                                                                                       17	
  
Cluster	
  wide	
  -­‐	
  Fail	
  Over	
  Node	
  

                                      APP	
  SERVER	
  1	
                                                     APP	
  SERVER	
  2	
  
                              COUCHBASE	
  Client	
  Library	
                                           COUCHBASE	
  Client	
  Library	
  
                                        	
                                                                         	
  
                                  CLUSTER	
  MAP	
  
                                        	
                                                                   CLUSTER	
  MAP	
  
                                                                                                                   	
  




            SERVER	
  1	
  
               	
                                     SERVER	
  2	
  
                                                         	
                            SERVER	
  3	
  
                                                                                          	
                                SERVER	
  4	
  
                                                                                                                               	
                     SERVER	
  5	
  
                                                                                                                                                         	
                •  App	
  servers	
  accessing	
  docs	
  
               	
                                        	
                               	
                                   	
                        	
  
             ACTIVE	
                                  ACTIVE	
                         ACTIVE	
                             ACTIVE	
                  ACTIVE	
  
                                                                                                                                                                           •  Requests	
  to	
  Server	
  3	
  fail	
  
       Doc	
  5	
       Doc	
                   Doc	
  4	
       Doc	
            Doc	
  1	
      Doc	
               Doc	
  9	
       Doc	
     Doc	
  6	
      Doc	
  
                                                                                                                                                                           •  Cluster	
  detects	
  server	
  failed	
  
                                                                                                                                                                              Promotes	
  replicas	
  of	
  docs	
  to	
  
       Doc	
  2	
       Doc	
                   Doc	
  7	
       Doc	
            Doc	
  2	
      Doc	
               Doc	
  8	
       Doc	
                     Doc	
        ac+ve	
  
                                                                                                                                                                              Updates	
  cluster	
  map	
  
       Doc	
  1	
                               Doc	
  3	
  
                                                                                                                                                                           •  Requests	
  for	
  docs	
  now	
  go	
  to	
  
             REPLICA	
                                 REPLICA	
                        REPLICA	
                            REPLICA	
                 REPLICA	
              appropriate	
  server	
  

       Doc	
  4	
       Doc	
                   Doc	
  6	
       Doc	
            Doc	
  7	
      Doc	
               Doc	
  5	
      Doc	
      Doc	
  8	
      Doc	
     •  Typically	
  rebalance	
  	
  
                                                                                                                                                                              would	
  follow	
  
       Doc	
  1	
       Doc	
                   Doc	
  3	
       Doc	
            Doc	
  9	
      Doc	
               Doc	
  2	
                                 Doc	
  




                                                                        COUCHBASE	
  SERVER	
  	
  CLUSTER	
  


User	
  Configured	
  Replica	
  Count	
  =	
  1	
                                                                                                                                                                            18	
  
DEMO	
  TIME	
  




                   19	
  
Indexing	
  and	
  Querying	
  –	
  The	
  basics	
  

 •  Define	
  materialized	
  views	
  on	
  JSON	
  documents	
  and	
  
    then	
  query	
  across	
  the	
  data	
  set	
  	
  
 •  Using	
  views	
  you	
  can	
  define	
  
       •    Primary	
  indexes	
  	
  
       •    Simple	
  secondary	
  indexes	
  (most	
  common	
  use	
  case)	
  
       •    Complex	
  secondary,	
  ter+ary	
  and	
  composite	
  indexes	
  
       •    Aggrega+ons	
  (reduc+on)	
  	
  
 •  Indexes	
  are	
  eventually	
  indexed	
  	
  
 •  Queries	
  are	
  eventually	
  consistent	
  with	
  respect	
  to	
  
    documents	
  
 •  Built	
  using	
  Map/Reduce	
  technology	
  	
  
       •  Map	
  and	
  Reduce	
  func+ons	
  are	
  wrihen	
  in	
  Javascript	
  
                                                                                      20	
  
Eventually	
  indexed	
  Views	
  –	
  Data	
  flow	
  
                                                                                        2	
  

                                                                         Doc	
  1	
  
                                    App	
  Server	
  



                               Couchbase	
  Server	
  Node	
  
                                                             3	
           2	
                  3	
  
                                                            Managed	
  Cache	
  
     To	
  other	
  node	
       Replica+on	
  
                                 Queue	
                                Doc	
  1	
  




                                                                                                        Disk	
  Queue	
  
                                              Disk	
  
                                                                         Doc	
  1	
  




                                                     View	
  engine	
  	
  

                                                                                                                            21	
  
Cluster	
  wide	
  -­‐	
  Indexing	
  and	
  Querying	
  	
  

                            APP	
  SERVER	
  1	
                                               APP	
  SERVER	
  2	
  
                    COUCHBASE	
  Client	
  Library	
                                    COUCHBASE	
  Client	
  Library	
  
                              	
                                                                  	
  
                        CLUSTER	
  MAP	
  
                              	
                                                            CLUSTER	
  MAP	
  
                                                                                                  	
  



                                                                                                              Query     	
  
                  SERVER	
  1	
                                           SERVER	
  2	
                                          SERVER	
  3	
  
                                                                                                                                           	
      •  Indexing	
  work	
  is	
  distributed	
  
                  ACTIVE	
  
                              	
  
                                                                          ACTIVE	
  
                                                                                      	
  
                                                                                                                                ACTIVE	
  
                                                                                                                                           	
         amongst	
  nodes	
  

          Doc	
  5	
       Doc	
                                  Doc	
  5	
       Doc	
                                Doc	
  5	
       Doc	
     •  Large	
  data	
  set	
  possible	
  

          Doc	
  2	
       Doc	
                                  Doc	
  2	
       Doc	
                                Doc	
  2	
       Doc	
  
                                                                                                                                                   •  Parallelize	
  the	
  effort	
  

          Doc	
  9	
       Doc	
  
                                                                                                                                                   •  Each	
  node	
  has	
  index	
  for	
  data	
  stored	
  
                                                                  Doc	
  9	
       Doc	
                                Doc	
  9	
       Doc	
  
                                                                                                                                                      on	
  it	
  
                REPLICA	
                                               REPLICA	
                                              REPLICA	
           •  Queries	
  combine	
  the	
  results	
  from	
  
          Doc	
  4	
       Doc	
  
                                                                                                                                                      required	
  nodes	
  
                                                                  Doc	
  4	
       Doc	
                                Doc	
  4	
      Doc	
  

          Doc	
  1	
       Doc	
                                  Doc	
  1	
       Doc	
                                Doc	
  1	
      Doc	
  

          Doc	
  8	
       Doc	
                                  Doc	
  8	
       Doc	
                                Doc	
  8	
      Doc	
  

                                                      COUCHBASE	
  SERVER	
  	
  CLUSTER	
  


User	
  Configured	
  Replica	
  Count	
  =	
  1	
                                                                                                                                                    22	
  
Cross	
  Data	
  Center	
  Replica+on	
  –	
  The	
  basics	
  

 •  Replicate	
  your	
  Couchbase	
  data	
  across	
  clusters	
  
 •  Clusters	
  may	
  be	
  spread	
  across	
  geos	
  
 •  Configured	
  on	
  a	
  per-­‐bucket	
  basis	
  
 •  Supports	
  unidirec+onal	
  and	
  bidirec+onal	
  opera+on	
  
 •  Applica+on	
  can	
  read	
  and	
  write	
  from	
  both	
  clusters	
  
    (ac+ve	
  –	
  ac+ve	
  replica+on)	
  
 •  Replica+on	
  throughput	
  scales	
  out	
  linearly	
  
 •  Different	
  from	
  intra-­‐cluster	
  replica+on	
  



                                                                                23	
  
Cross	
  data	
  center	
  replica+on	
  –	
  Data	
  flow	
  
                                                                                2	
  

                                                                 Doc	
  1	
  
                                    App	
  Server	
  



                               Couchbase	
  Server	
  Node	
  
                                                          3	
            2	
            3	
  
                                                         Managed	
  Cache	
  
     To	
  other	
  node	
        Replica+on	
  
                                    Queue	
                      Doc	
  1	
  




                                                                                                Disk	
  Queue	
  
                                              Disk	
  
                                                                 Doc	
  1	
  




                                                                 XDCR	
  Queue	
  
                                                                                        To	
  other	
  cluster	
  
                                                                                                                     24	
  
Cluster	
  wide	
  -­‐	
  XDCR	
  
      SERVER	
  1	
  	
                           SERVER	
  2	
   	
                                                 SERVER	
  3	
   	
  
                       	
   ACTIVE	
                                 	
   ACTIVE	
                                                     	
   ACTIVE	
  
                                                                                                                                                                                  COUCHBASE	
  SERVER	
  	
  CLUSTER	
  
                    Doc	
  	
                                    Doc	
                                                              Doc	
  	
  
                                                                                                                                                                                       NY	
  DATA	
  CENTER	
  

                   Doc	
  2	
                                    Doc	
  	
                                                          Doc	
  	
  

                   Doc	
  9	
                                    Doc	
  	
                                                          Doc	
  
RAM	
                                        RAM	
                                                            RAM	
  


     Doc	
  	
       Doc	
  	
     Doc	
           Doc	
  	
       Doc	
          Doc	
  	
                          Doc	
          Doc	
           Doc	
  

                   DISK	
                                        DISK	
                                                          DISK	
  



                                                                                        SERVER	
  1	
  	
                                                SERVER	
  2	
   	
                                SERVER	
  3	
   	
  
                                                                                                         	
   ACTIVE	
                                                      	
   ACTIVE	
                                    	
   ACTIVE	
  

                                                                                                      Doc	
  	
                                                         Doc	
                                             Doc	
  	
  

                                                                                                     Doc	
  2	
                                                         Doc	
  	
                                         Doc	
  	
  

                                                                                                     Doc	
  9	
                                                         Doc	
  	
                                         Doc	
  
                                                                               RAM	
                                                              RAM	
                                               RAM	
  


           COUCHBASE	
  SERVER	
  	
  CLUSTER	
                                        Doc	
  	
       Doc	
  	
     Doc	
                               Doc	
  	
        Doc	
         Doc	
  	
          Doc	
          Doc	
         Doc	
  
                SF	
  DATA	
  CENTER	
  
                                                                                                     DISK	
                                                            DISK	
                                          DISK	
                  25	
  
DEMO	
  TIME	
  




                   26	
  
Demo:	
  The	
  next	
  big	
  social	
  game	
  


   3	
  Objects	
  (documents)	
  within	
  game:	
  
           • Players	
  
           • Monsters	
  
           • Items	
  
   	
  
   Gameplay:	
  
           • Players	
  fight	
  monsters	
  
           • Monsters	
  drop	
  items	
  
           • Players	
  own	
  items	
  
                                                        27	
  
Player	
  Document	
  


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

                                                                               28	
  
Item	
  Document	
  


  {	
  
                                                          Item	
  ID	
  
          	
  "jsonType":	
  "item",	
  
          	
  "name":	
  "Katana_e5890c94-­‐11c6-­‐65746ce6c560",	
  
          	
  "uuid":	
  "e5890c94-­‐11c6-­‐4856-­‐a7a6-­‐65746ce6c560",	
  
          	
  "ownerId":	
  "Dale9887"	
  
  }	
  
                                            Player	
  ID	
  




                                                                               29	
  
Monster	
  Document	
  


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



                                                                              30	
  
GAME	
  ON!	
  




                  31	
  
Full	
  Text	
  Search	
  Integra+on	
  
•  Elas+c	
  Search	
  is	
  good	
  for	
  ad-­‐hoc	
  queries	
  and	
  faceted	
  browsing	
  
•  Couchbase	
  adapter	
  uses	
  XDCR	
  to	
  push	
  muta+ons	
  to	
  ESDocs	
  
   are	
  indexed	
  by	
  Elas+c	
  Search	
  
•  Couchbase	
  ES	
  Adapter	
  is	
  cluster-­‐aware	
  




                                                                 ElasNcSearch	
  



          Unidirec+onal	
  Cross	
  Data	
  Center	
  Replica+on	
  
                                                                                               32	
  
Full	
  Text	
  Search	
  	
  	
  




                                                 Application Server
                                          Couchbase SDK               ES Queries over HTTP

                                                                                          Do
                                    ta                                      TS              c
                                 Da                      ry                      Qu             Re
                                                      ue                           er             fs
                                                 MRQ                                  y


               Couchbase Server Cluster                                               ElasticSearch Server Cluster




                  MR      MR              MR           MR
                 Views   Views           Views        Views



                                                                                                          XDCR-based
                                                     Cross Data Center Replication                       CB-ES Transport



                                                                                                                           33	
  
Couchbase	
  SDKs	
  



Java	
  	
  SDK	
           User	
  Code	
  


.Net	
  SDK	
                                             CouchbaseClient	
  cb	
  =	
  new	
  CouchbaseClient(listURIs,	
  
                           Java	
  client	
  API	
        "aBucket",	
  "letmein");	
  
                                                          	
  
                                                          cb.set("hello",	
  0,	
  "world");	
  
                                                          cb.get("hello");	
  
                       Couchbase	
  Java	
  Library	
  
PHP	
  SDK	
             (spymemcached)	
  


Ruby	
  SDK	
  
                       Couchbase	
  Server	
  
…and	
  many	
  
more	
  

                      hhp://www.couchbase.com/develop	
  
                                                                                                                           34	
  
QUESTIONS?	
  




                 35	
  3
THANK	
  YOU	
  
           	
  
CHIYOUNG@COUCBASE.COM	
  
     @CHIYOUNGSEO	
  




                            36	
  3

Más contenido relacionado

La actualidad más candente

Dena Loves Perl
Dena Loves PerlDena Loves Perl
Dena Loves Perl
notolab
 
MongoDB at the energy frontier
MongoDB at the energy frontierMongoDB at the energy frontier
MongoDB at the energy frontier
Valentin Kuznetsov
 
The fillmore-group-aese-presentation-111810
The fillmore-group-aese-presentation-111810The fillmore-group-aese-presentation-111810
The fillmore-group-aese-presentation-111810
Gennaro (Rino) Persico
 
Snapmirror Design
Snapmirror DesignSnapmirror Design
Snapmirror Design
OkieUnix
 
Oracle10g new features
Oracle10g  new featuresOracle10g  new features
Oracle10g new features
Tanvi_Agrawal
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
sqlserver.co.il
 

La actualidad más candente (18)

DB2 9.7 Overview
DB2 9.7 OverviewDB2 9.7 Overview
DB2 9.7 Overview
 
Hdfs high availability
Hdfs high availabilityHdfs high availability
Hdfs high availability
 
Data Aggregation System
Data Aggregation SystemData Aggregation System
Data Aggregation System
 
Dena Loves Perl
Dena Loves PerlDena Loves Perl
Dena Loves Perl
 
MongoDB at the energy frontier
MongoDB at the energy frontierMongoDB at the energy frontier
MongoDB at the energy frontier
 
The fillmore-group-aese-presentation-111810
The fillmore-group-aese-presentation-111810The fillmore-group-aese-presentation-111810
The fillmore-group-aese-presentation-111810
 
ECM Technical Solution
ECM Technical SolutionECM Technical Solution
ECM Technical Solution
 
Gain Insight Into DB2 9 And DB2 10 for z/OS Performance Updates And Save Cost...
Gain Insight Into DB2 9 And DB2 10 for z/OS Performance Updates And Save Cost...Gain Insight Into DB2 9 And DB2 10 for z/OS Performance Updates And Save Cost...
Gain Insight Into DB2 9 And DB2 10 for z/OS Performance Updates And Save Cost...
 
Instalación y Configuración : Bases de datos fuera del asistente
Instalación y Configuración : Bases de datos fuera del asistente Instalación y Configuración : Bases de datos fuera del asistente
Instalación y Configuración : Bases de datos fuera del asistente
 
Ta3
Ta3Ta3
Ta3
 
2009 Q2 WSO2 Technical Update
2009 Q2 WSO2 Technical Update2009 Q2 WSO2 Technical Update
2009 Q2 WSO2 Technical Update
 
Snapmirror Design
Snapmirror DesignSnapmirror Design
Snapmirror Design
 
Oracle10g new features
Oracle10g  new featuresOracle10g  new features
Oracle10g new features
 
2011 04-dsi-javaee-in-the-cloud-andreadis
2011 04-dsi-javaee-in-the-cloud-andreadis2011 04-dsi-javaee-in-the-cloud-andreadis
2011 04-dsi-javaee-in-the-cloud-andreadis
 
The Case for using MongoDB in Social Game - Animal Land
The Case for using MongoDB in Social Game - Animal LandThe Case for using MongoDB in Social Game - Animal Land
The Case for using MongoDB in Social Game - Animal Land
 
Lego Cloud SAP Virtualization Week 2012
Lego Cloud SAP Virtualization Week 2012Lego Cloud SAP Virtualization Week 2012
Lego Cloud SAP Virtualization Week 2012
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
 
Hecatonchire kvm forum_2012_benoit_hudzia
Hecatonchire kvm forum_2012_benoit_hudziaHecatonchire kvm forum_2012_benoit_hudzia
Hecatonchire kvm forum_2012_benoit_hudzia
 

Destacado (8)

Test powerpoint
Test powerpointTest powerpoint
Test powerpoint
 
Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2Couchbase Korea User Group 2nd Meetup #2
Couchbase Korea User Group 2nd Meetup #2
 
Great Southern Music
Great Southern MusicGreat Southern Music
Great Southern Music
 
Clase n°2
Clase n°2Clase n°2
Clase n°2
 
기획1팀
기획1팀기획1팀
기획1팀
 
Gns sales force new features
Gns sales force   new featuresGns sales force   new features
Gns sales force new features
 
Fasilitas dan perlengkapan bulu tangkis
Fasilitas dan perlengkapan bulu tangkisFasilitas dan perlengkapan bulu tangkis
Fasilitas dan perlengkapan bulu tangkis
 
Full user tour
Full user tourFull user tour
Full user tour
 

Similar a Couchbase Korea User Gorup 2nd Meetup #1

Launch webinar-introducing couchbase server 2.0-01202013
Launch webinar-introducing couchbase server 2.0-01202013Launch webinar-introducing couchbase server 2.0-01202013
Launch webinar-introducing couchbase server 2.0-01202013
Dipti Borkar
 
Eu Esri 2011 - Esri (Damian Spangrud)
Eu Esri 2011 - Esri (Damian Spangrud)Eu Esri 2011 - Esri (Damian Spangrud)
Eu Esri 2011 - Esri (Damian Spangrud)
Imagem_Oficial
 
Couchbase presentation
Couchbase presentationCouchbase presentation
Couchbase presentation
sharonyb
 
Stairway to heaven webinar
Stairway to heaven webinarStairway to heaven webinar
Stairway to heaven webinar
CloudBees
 
Transition from relational to NoSQL Philly DAMA Day
Transition from relational to NoSQL Philly DAMA DayTransition from relational to NoSQL Philly DAMA Day
Transition from relational to NoSQL Philly DAMA Day
Dipti Borkar
 
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Ontico
 
Software architectures for the cloud
Software architectures for the cloudSoftware architectures for the cloud
Software architectures for the cloud
Georgios Gousios
 

Similar a Couchbase Korea User Gorup 2nd Meetup #1 (20)

Introduction to Couchbase Server 2.0 - CouchConf SF - Tour and Demo
Introduction to Couchbase Server 2.0 - CouchConf SF - Tour and DemoIntroduction to Couchbase Server 2.0 - CouchConf SF - Tour and Demo
Introduction to Couchbase Server 2.0 - CouchConf SF - Tour and Demo
 
Launch webinar-introducing couchbase server 2.0-01202013
Launch webinar-introducing couchbase server 2.0-01202013Launch webinar-introducing couchbase server 2.0-01202013
Launch webinar-introducing couchbase server 2.0-01202013
 
Couchbase b jmeetup
Couchbase b jmeetupCouchbase b jmeetup
Couchbase b jmeetup
 
Couchdb + Membase = Couchbase
Couchdb + Membase = CouchbaseCouchdb + Membase = Couchbase
Couchdb + Membase = Couchbase
 
Eu Esri 2011 - Esri (Damian Spangrud)
Eu Esri 2011 - Esri (Damian Spangrud)Eu Esri 2011 - Esri (Damian Spangrud)
Eu Esri 2011 - Esri (Damian Spangrud)
 
Couchbase presentation
Couchbase presentationCouchbase presentation
Couchbase presentation
 
Stairway to heaven webinar
Stairway to heaven webinarStairway to heaven webinar
Stairway to heaven webinar
 
Navigating the Transition from relational to NoSQL - CloudCon Expo 2012
Navigating the Transition from relational to NoSQL - CloudCon Expo 2012Navigating the Transition from relational to NoSQL - CloudCon Expo 2012
Navigating the Transition from relational to NoSQL - CloudCon Expo 2012
 
Transition from relational to NoSQL Philly DAMA Day
Transition from relational to NoSQL Philly DAMA DayTransition from relational to NoSQL Philly DAMA Day
Transition from relational to NoSQL Philly DAMA Day
 
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...
How AOL Advertising Uses NoSQL to Make Millions of Smart Targeting Decisions ...
 
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
2012 04-06-v2-tdp-1163-java e-evsspringshootout-final
 
What’s new in Nuxeo 5.2?
What’s new in Nuxeo 5.2?What’s new in Nuxeo 5.2?
What’s new in Nuxeo 5.2?
 
WebLogic Diagnostic Framework Dr. Frank Munz / munz & more WLS11g
WebLogic Diagnostic Framework  Dr. Frank Munz / munz & more WLS11gWebLogic Diagnostic Framework  Dr. Frank Munz / munz & more WLS11g
WebLogic Diagnostic Framework Dr. Frank Munz / munz & more WLS11g
 
Dell web monsters-oct2011-v6-public
Dell web monsters-oct2011-v6-publicDell web monsters-oct2011-v6-public
Dell web monsters-oct2011-v6-public
 
Go simple-fast-elastic-with-couchbase-server-borkar
Go simple-fast-elastic-with-couchbase-server-borkarGo simple-fast-elastic-with-couchbase-server-borkar
Go simple-fast-elastic-with-couchbase-server-borkar
 
DAT101 Understanding AWS Database Options - AWS re: Invent 2012
DAT101 Understanding AWS Database Options - AWS re: Invent 2012DAT101 Understanding AWS Database Options - AWS re: Invent 2012
DAT101 Understanding AWS Database Options - AWS re: Invent 2012
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
Shared personalization service. How to scale to 15 k rps (Patrice Pelland)
 
Software architectures for the cloud
Software architectures for the cloudSoftware architectures for the cloud
Software architectures for the cloud
 
The IBM Netezza datawarehouse appliance
The IBM Netezza datawarehouse applianceThe IBM Netezza datawarehouse appliance
The IBM Netezza datawarehouse appliance
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Couchbase Korea User Gorup 2nd Meetup #1

  • 1. Introduc+on  to     Couchbase  Server  2.0   1  
  • 2. Couchbase  Server   NoSQL  Document  Database   2.0 2  
  • 3. Couchbase  Server   Easy   Consistent  High   Scalability   PE RF O R M A N C E Performance   Grow  cluster  without   Consistent  sub-­‐millisecond     applica+on  changes,  without   read  and  write  response  +mes     down+me  with  a  single  click   with  consistent  high  throughput   Always  On   Flexible  Data   24x365   Model   JSON JSON JSO N JSON JSON No  down+me  for  soGware   JSON  document  model  with   upgrades,  hardware   no  fixed  schema.   maintenance,  etc.   3  
  • 4. Flexible  Data  Model    {          “ID”:  1,          “FIRST”:  “DipN”,          “LAST”:  “Borkar”,          “ZIP”:  “94040”,          “CITY”:  “MV”,          “STATE”:  “CA”   }   JSON   JSON   JSON   JSON   •  No  need  to  worry  about  the  database  when  changing  your   applica+on   •  Records  can  have  different  structures,  there  is  no  fixed   schema   •  Allows  painless  data  model  changes  for  rapid  applica+on   development     4  
  • 5. Couchbase  Server  Features   Built-­‐in  clustering  –  All  nodes  equal     Data  replica+on  with  auto-­‐failover     Zero-­‐-­‐down+me  maintenance       Clone  to  grow  and  scale  horizontally     Built-­‐in  managed  cached     Monitoring  and  administra+on  APIs  and  GUI       SDK  for  a  variety  of  languages       5  
  • 6. New  in  2.0   JSON  support   Indexing  and  Querying   JSON JSON JSO JSON N JSON Incremental  Map  Reduce   Cross  data  center  replicaNon   6  
  • 7. Couchbase  Server  2.0  Architecture   8092   11211   11210   Query  API   Memcapable    1.0   Memcapable    2.0   Moxi   Query  Engine   REST  management  API/Web  UI   vBucket  state  and  replica+on  manager   Memcached   Global  singleton  supervisor   Rebalance  orchestrator   Configura+on  manager   Node  health  monitor   Process  monitor   Heartbeat   Couchbase  EP  Engine   Data  Manager   Cluster  Manager   storage  interface   New  Persistence  Layer   hp   on  each  node   one  per  cluster   Erlang/OTP   HTTP   Erlang  port  mapper   Distributed  Erlang   8091   4369   21100  -­‐  21199   7  
  • 8. Couchbase  Server  2.0  Architecture   8092   11211   11210   Query  API   Memcapable    1.0   Memcapable    2.0   Moxi   Query  Engine   REST  management  API/Web  UI   vBucket  state  and  replica+on  manager   Object-­‐level  Cache   Global  singleton  supervisor   Rebalance  orchestrator   Configura+on  manager   Node  health  monitor   Process  monitor   Heartbeat   Couchbase  EP  Engine   storage  interface   New  Persistence  Layer   hp   on  each  node   one  per  cluster   Erlang/OTP   HTTP   Erlang  port  mapper   Distributed  Erlang   8091   4369   21100  -­‐  21199   8  
  • 9. Couchbase  deployment   Web   Applica+on   Couchbase   Client  Library   Data  Flow   Cluster  Management   9  
  • 11. Single  node  -­‐  Couchbase  Write  Opera+on   2   Doc  1   App  Server   3   2   3   Managed  Cache   To  other  node   Replica+on   Queue   Doc  1   Disk  Queue   Disk   Couchbase  Server  Node   11  
  • 12. Single  node  -­‐  Couchbase  Update  Opera+on   2   Doc  1’   App  Server   3   2   3   Managed  Cache   To  other  node   Replica+on   Doc  1   Doc  1’   Queue   Disk  Queue   Disk   Doc  1   Couchbase  Server  Node   12  
  • 13. Single  node  -­‐  Couchbase  Read  Opera+on   2   Doc  1   GET   App  Server   3   2   3   Managed  Cache   To  other  node   Replica+on   Queue   Doc  1   Disk  Queue   Disk   Doc  1   Couchbase  Server  Node   13  
  • 14. Single  node  -­‐  Couchbase  Cache  Evic+on   2   Doc  6   2 3 4 5 App  Server   3   2   3   Managed  Cache   To  other  node   Replica+on   Queue   Doc  1   Disk  Queue   Disk   Doc  1   Doc  6   Doc  5   Doc  4   Doc  3   Doc  2   Couchbase  Server  Node   14  
  • 15. Single  node  –  Couchbase  Cache  Miss   2   Doc  1   GET   App  Server   3   2   3   Managed  Cache   To  other  node   Replica+on   Queue   Doc  1   Doc  5   4   4   Doc   Doc   Doc  3   2   Doc   Disk  Queue   Disk   Doc  1   Doc  6   Doc  5   Doc  4   Doc  3   Doc  2   Couchbase  Server  Node   15  
  • 16. Cluster  wide  -­‐  Basic  Opera+on   APP  SERVER  1   APP  SERVER  2   COUCHBASE  Client  Library   COUCHBASE  Client  Library       CLUSTER  MAP     CLUSTER  MAP     READ/WRITE/UPDATE   SERVER  1     SERVER  2     SERVER  3     •  Docs  distributed  evenly  across     ACTIVE     ACTIVE     ACTIVE   servers     Doc  5   Doc   Doc  4   Doc   Doc  1   Doc   •  Each  server  stores  both  acNve  and   replica  docs   Doc  2   Doc   Doc  7   Doc   Doc  2   Doc   Only  one  server  ac+ve  at  a  +me   •  Client  library  provides  app  with   Doc  9   Doc   Doc  8   Doc   Doc  6   Doc   simple  interface  to  database   REPLICA   REPLICA   REPLICA   •  Cluster  map  provides  map     to  which  server  doc  is  on   Doc  4   Doc   Doc  6   Doc   Doc  7   Doc   App  never  needs  to  know   Doc  1   Doc   Doc  3   Doc   Doc  9   Doc   •  App  reads,  writes,  updates  docs   Doc  8   Doc   Doc  2   Doc   Doc  5   Doc   •  MulNple  app  servers  can  access  same   document  at  same  Nme   COUCHBASE  SERVER    CLUSTER   User  Configured  Replica  Count  =  1   16  
  • 17. Cluster  wide  -­‐  Add  Nodes  to  Cluster   APP  SERVER  1   APP  SERVER  2   COUCHBASE  Client  Library   COUCHBASE  Client  Library       CLUSTER  MAP     CLUSTER  MAP     READ/WRITE/UPDATE   READ/WRITE/UPDATE   SERVER  1     SERVER  2     SERVER  3     SERVER  4     SERVER  5     •  Two  servers  added     ACTIVE     ACTIVE     ACTIVE     ACTIVE     ACTIVE   One-­‐click  operaNon   Doc  5   Doc   Doc  4   Doc   Doc  1   Doc   •  Docs  automaNcally   rebalanced  across   Doc  2   Doc   Doc  7   Doc   Doc  2   Doc   cluster   Even  distribu+on  of  docs   Minimum  doc  movement   Doc  9   Doc   Doc  8   Doc   Doc  6   Doc   •  Cluster  map  updated   REPLICA   REPLICA   REPLICA   REPLICA   REPLICA   •  App  database     Doc  4   Doc   Doc  6   Doc   Doc  7   Doc   calls  now  distributed     over  larger  number  of   Doc  1   Doc   Doc  3   Doc   Doc  9   Doc   servers     Doc  8   Doc   Doc  2   Doc   Doc  5   Doc   COUCHBASE  SERVER    CLUSTER   User  Configured  Replica  Count  =  1   17  
  • 18. Cluster  wide  -­‐  Fail  Over  Node   APP  SERVER  1   APP  SERVER  2   COUCHBASE  Client  Library   COUCHBASE  Client  Library       CLUSTER  MAP     CLUSTER  MAP     SERVER  1     SERVER  2     SERVER  3     SERVER  4     SERVER  5     •  App  servers  accessing  docs             ACTIVE   ACTIVE   ACTIVE   ACTIVE   ACTIVE   •  Requests  to  Server  3  fail   Doc  5   Doc   Doc  4   Doc   Doc  1   Doc   Doc  9   Doc   Doc  6   Doc   •  Cluster  detects  server  failed   Promotes  replicas  of  docs  to   Doc  2   Doc   Doc  7   Doc   Doc  2   Doc   Doc  8   Doc   Doc   ac+ve   Updates  cluster  map   Doc  1   Doc  3   •  Requests  for  docs  now  go  to   REPLICA   REPLICA   REPLICA   REPLICA   REPLICA   appropriate  server   Doc  4   Doc   Doc  6   Doc   Doc  7   Doc   Doc  5   Doc   Doc  8   Doc   •  Typically  rebalance     would  follow   Doc  1   Doc   Doc  3   Doc   Doc  9   Doc   Doc  2   Doc   COUCHBASE  SERVER    CLUSTER   User  Configured  Replica  Count  =  1   18  
  • 19. DEMO  TIME   19  
  • 20. Indexing  and  Querying  –  The  basics   •  Define  materialized  views  on  JSON  documents  and   then  query  across  the  data  set     •  Using  views  you  can  define   •  Primary  indexes     •  Simple  secondary  indexes  (most  common  use  case)   •  Complex  secondary,  ter+ary  and  composite  indexes   •  Aggrega+ons  (reduc+on)     •  Indexes  are  eventually  indexed     •  Queries  are  eventually  consistent  with  respect  to   documents   •  Built  using  Map/Reduce  technology     •  Map  and  Reduce  func+ons  are  wrihen  in  Javascript   20  
  • 21. Eventually  indexed  Views  –  Data  flow   2   Doc  1   App  Server   Couchbase  Server  Node   3   2   3   Managed  Cache   To  other  node   Replica+on   Queue   Doc  1   Disk  Queue   Disk   Doc  1   View  engine     21  
  • 22. Cluster  wide  -­‐  Indexing  and  Querying     APP  SERVER  1   APP  SERVER  2   COUCHBASE  Client  Library   COUCHBASE  Client  Library       CLUSTER  MAP     CLUSTER  MAP     Query   SERVER  1   SERVER  2   SERVER  3     •  Indexing  work  is  distributed   ACTIVE     ACTIVE     ACTIVE     amongst  nodes   Doc  5   Doc   Doc  5   Doc   Doc  5   Doc   •  Large  data  set  possible   Doc  2   Doc   Doc  2   Doc   Doc  2   Doc   •  Parallelize  the  effort   Doc  9   Doc   •  Each  node  has  index  for  data  stored   Doc  9   Doc   Doc  9   Doc   on  it   REPLICA   REPLICA   REPLICA   •  Queries  combine  the  results  from   Doc  4   Doc   required  nodes   Doc  4   Doc   Doc  4   Doc   Doc  1   Doc   Doc  1   Doc   Doc  1   Doc   Doc  8   Doc   Doc  8   Doc   Doc  8   Doc   COUCHBASE  SERVER    CLUSTER   User  Configured  Replica  Count  =  1   22  
  • 23. Cross  Data  Center  Replica+on  –  The  basics   •  Replicate  your  Couchbase  data  across  clusters   •  Clusters  may  be  spread  across  geos   •  Configured  on  a  per-­‐bucket  basis   •  Supports  unidirec+onal  and  bidirec+onal  opera+on   •  Applica+on  can  read  and  write  from  both  clusters   (ac+ve  –  ac+ve  replica+on)   •  Replica+on  throughput  scales  out  linearly   •  Different  from  intra-­‐cluster  replica+on   23  
  • 24. Cross  data  center  replica+on  –  Data  flow   2   Doc  1   App  Server   Couchbase  Server  Node   3   2   3   Managed  Cache   To  other  node   Replica+on   Queue   Doc  1   Disk  Queue   Disk   Doc  1   XDCR  Queue   To  other  cluster   24  
  • 25. Cluster  wide  -­‐  XDCR   SERVER  1     SERVER  2     SERVER  3       ACTIVE     ACTIVE     ACTIVE   COUCHBASE  SERVER    CLUSTER   Doc     Doc   Doc     NY  DATA  CENTER   Doc  2   Doc     Doc     Doc  9   Doc     Doc   RAM   RAM   RAM   Doc     Doc     Doc   Doc     Doc   Doc     Doc   Doc   Doc   DISK   DISK   DISK   SERVER  1     SERVER  2     SERVER  3       ACTIVE     ACTIVE     ACTIVE   Doc     Doc   Doc     Doc  2   Doc     Doc     Doc  9   Doc     Doc   RAM   RAM   RAM   COUCHBASE  SERVER    CLUSTER   Doc     Doc     Doc   Doc     Doc   Doc     Doc   Doc   Doc   SF  DATA  CENTER   DISK   DISK   DISK   25  
  • 26. DEMO  TIME   26  
  • 27. Demo:  The  next  big  social  game   3  Objects  (documents)  within  game:   • Players   • Monsters   • Items     Gameplay:   • Players  fight  monsters   • Monsters  drop  items   • Players  own  items   27  
  • 28. Player  Document   {    "jsonType":  "player",    "uuid":  "35767d02-­‐a958-­‐4b83-­‐8179-­‐616816692de1",    "name":  "Keith4540",    "hitpoints":  75,   Player  ID    "experience":  663,    "level":  4,    "loggedIn":  false   }     28  
  • 29. Item  Document   {   Item  ID    "jsonType":  "item",    "name":  "Katana_e5890c94-­‐11c6-­‐65746ce6c560",    "uuid":  "e5890c94-­‐11c6-­‐4856-­‐a7a6-­‐65746ce6c560",    "ownerId":  "Dale9887"   }   Player  ID   29  
  • 30. Monster  Document   {   Monster  ID    "jsonType":  "monster",    "name":  "Bauchan9932",    "uuid":  "d10dfc1b-­‐0412-­‐4140-­‐b4ec-­‐affdbf2aa5ec",    "hitpoints":  370,    "experienceWhenKilled":  52,    "itemProbability":  0.5050581341872865   }   30  
  • 31. GAME  ON!   31  
  • 32. Full  Text  Search  Integra+on   •  Elas+c  Search  is  good  for  ad-­‐hoc  queries  and  faceted  browsing   •  Couchbase  adapter  uses  XDCR  to  push  muta+ons  to  ESDocs   are  indexed  by  Elas+c  Search   •  Couchbase  ES  Adapter  is  cluster-­‐aware   ElasNcSearch   Unidirec+onal  Cross  Data  Center  Replica+on   32  
  • 33. Full  Text  Search       Application Server Couchbase SDK ES Queries over HTTP Do ta TS c Da ry Qu Re ue er fs MRQ y Couchbase Server Cluster ElasticSearch Server Cluster MR MR MR MR Views Views Views Views XDCR-based Cross Data Center Replication CB-ES Transport 33  
  • 34. Couchbase  SDKs   Java    SDK   User  Code   .Net  SDK   CouchbaseClient  cb  =  new  CouchbaseClient(listURIs,   Java  client  API   "aBucket",  "letmein");     cb.set("hello",  0,  "world");   cb.get("hello");   Couchbase  Java  Library   PHP  SDK   (spymemcached)   Ruby  SDK   Couchbase  Server   …and  many   more   hhp://www.couchbase.com/develop   34  
  • 35. QUESTIONS?   35  3
  • 36. THANK  YOU     CHIYOUNG@COUCBASE.COM   @CHIYOUNGSEO   36  3