+ All Categories
Home > Technology > CouchConf-Berlin-Couchbase-2.0-demo

CouchConf-Berlin-Couchbase-2.0-demo

Date post: 24-May-2015
Category:
Upload: couchbase
View: 383 times
Download: 0 times
Share this document with a friend
Popular Tags:
23
Transcript
Page 1: CouchConf-Berlin-Couchbase-2.0-demo
Page 2: CouchConf-Berlin-Couchbase-2.0-demo

Frank WeigelCOUCHBASE

Director, Product Management

Page 3: CouchConf-Berlin-Couchbase-2.0-demo

Couchbase Server 2.0

=

Simple. Fast. Elastic.

Page 4: CouchConf-Berlin-Couchbase-2.0-demo

Couchbase Server 2.0 Architecture

Hea

rtbe

at

Proc

ess

mon

itor

Glo

bal s

ingl

eton

sup

ervi

sor

Confi

gura

tion

man

ager

on each node

Reba

lanc

e or

ches

trat

or

Nod

e he

alth

mon

itor

one per cluster

vBuc

ket s

tate

and

repl

icati

on m

anag

er

httpRE

ST m

anag

emen

t API

/Web

UI

Erlang/OTP

Cluster Manager

Database Operations

Cluster Management

storage interface

Couc

h AP

I

Membase EP Engine

Moxi

Data Manager

Page 5: CouchConf-Berlin-Couchbase-2.0-demo

storage interface

Hea

rtbe

at

Proc

ess

mon

itor

Glo

bal s

ingl

eton

sup

ervi

sor

Confi

gura

tion

man

ager

on each node

Reba

lanc

e or

ches

trat

or

Nod

e he

alth

mon

itor

one per cluster

vBuc

ket s

tate

and

repl

icati

on m

anag

er

httpRE

ST m

anag

emen

t API

/Web

UI

5984Couch View

CouchDB

Memcached

Couc

h AP

I

Membase EP Engine

11210Memcapable 2.0

Moxi

11211Memcapable 1.0

HTTP8091

Erlang port mapper4369

Distributed Erlang21100 - 21199

Membase

Erlang/OTP

Couchbase Server 2.0 Architecture

Page 6: CouchConf-Berlin-Couchbase-2.0-demo

Java Client SDK

.Net SDK

PHP SDK

Ruby SDK

Python SDK

spymemcachedConnection

HTTP couchDB connection

Java client API

User Code

Couchbase Server

CouchbaseClient cb = new CouchbaseClient(listURIs,"aBucket", "letmein");// this is all the same as beforecb.set("hello", 0, "world");cb.get("hello");Map<String, Object> manyThings =cb.getBulk(Collection<String> keys);/* accessing a view View view = cb.getView("design_document", "my_view");Query query = new Query();query.getRange("abegin", "theend");

http://www.couchbase.org/code

Couchbase Client SDKs

Page 7: CouchConf-Berlin-Couchbase-2.0-demo

Partitioning The Data – vbucket map

Page 8: CouchConf-Berlin-Couchbase-2.0-demo

Couchbase Server Basic Operation

COUCHBASE CLIENT LIBRARY

Docs distributed evenly across servers in the cluster

Each server stores both active & replica docs Only one server active at a time

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

Multiple App Servers can access same document at same time

Doc 4

Doc 2

Doc 5

SERVER 1

Doc 6

Doc 4

SERVER 2

Doc 7

Doc 1

SERVER 3

Doc 3

User Configured Replica Count = 1

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

Active Docs Active Docs Active Docs

CLUSTER MAP CLUSTER MAP

APP SERVER 1 APP SERVER 2

COUCHBASE SERVER CLUSTER

Page 9: CouchConf-Berlin-Couchbase-2.0-demo

Add Nodes

Two servers added to cluster One-click operation

Docs automatically rebalanced across cluster Even distribution of

docs Minimum doc

movement Cluster map updated

App database calls now distributed over larger # of servers

User Configured Replica Count = 1

Read/Write/Update Read/Write/Update

Doc 7

Doc 9

Doc 3

Active 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

Active Docs Active Docs Active Docs

SERVER 4 SERVER 5

Active Docs Active Docs

Replica Docs Replica Docs

COUCHBASE SERVER CLUSTER

Page 10: CouchConf-Berlin-Couchbase-2.0-demo

Fail Over Node

User Configured Replica Count = 1

Doc 7

Doc 9

Doc 3

Active 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

DOCDOC

DOC

DOC

DOC DOC

DOC

DOC

DOC DOC

DOC

DOC

DOC

Doc 9

Doc 5DOC

DOC

DOC

Doc 1

Doc 8

Doc 2

Replica Docs Replica Docs Replica Docs

Active Docs Active Docs Active Docs

SERVER 4 SERVER 5

Active Docs Active Docs

Replica Docs Replica Docs

COUCHBASE SERVER CLUSTER

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 active Updates cluster map

App server requests for docs now go to appropriate server

Typically rebalance would follow

Page 11: CouchConf-Berlin-Couchbase-2.0-demo

DEMO TIME

Page 12: CouchConf-Berlin-Couchbase-2.0-demo

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

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

Demo: The next big social game

Page 13: CouchConf-Berlin-Couchbase-2.0-demo

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

}

Player Document

Page 14: CouchConf-Berlin-Couchbase-2.0-demo

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

}

Item Document

Player “_id”

Page 15: CouchConf-Berlin-Couchbase-2.0-demo

{"_id": "Bauchan9932","_rev": "1-5c90be58be58134a0fc5e7db77dab5f2","jsonType": "monster","name": "Bauchan9932","uuid": "d10dfc1b-0412-4140-b4ec-affdbf2aa5ec","hitpoints": 370,"experienceWhenKilled": 52,"itemProbability": 0.5050581341872865

}

Monster Document

Page 16: CouchConf-Berlin-Couchbase-2.0-demo

GAME ON!

Page 17: CouchConf-Berlin-Couchbase-2.0-demo

Performance Optimizations

• Much improved bulk loading performance

• Significantly better indexing performance

• Disk Storage Reduction

thanks for the photo! http://www.flickr.com/photos/daveverwer/2065387957/

Page 18: CouchConf-Berlin-Couchbase-2.0-demo

JSON Documents

Page 19: CouchConf-Berlin-Couchbase-2.0-demo

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

User Configured Replica Count = 1

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

Active Docs Active Docs Active Docs

COUCHBASE CLIENT LIBRARY COUCHBASE CLIENT LIBRARY

CLUSTER MAP CLUSTER MAP

APP SERVER 1 APP SERVER 2

QueryResponse

Page 20: CouchConf-Berlin-Couchbase-2.0-demo

Cross Data Center Replication

Want data close to user Want multiple locations for disaster recovery Can write to same document in all different regions & it will sync

US DATA CENTER EUROPE DATA CENTER ASIA DATA CENTER

CouchSync CouchSync

CouchSync

Page 21: CouchConf-Berlin-Couchbase-2.0-demo

DEMO TIME

Page 22: CouchConf-Berlin-Couchbase-2.0-demo

Q&A

Page 23: CouchConf-Berlin-Couchbase-2.0-demo

THANK YOU!Get Couchbase Server 2.0 at

http://www.couchbase.com/downloads

Give us feedback at:http://www.couchbase.org/forums


Recommended