Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Real-time, Batch-oriented
interactive databases analytic databases
24x365
12
Couchbase
provides
a
complete
Data
Management
solution
Multi-‐purpose
capabilities
support
a
broad
range
of
apps
and
use
cases
Enterprises
often
start
with
cache,
then
broaden
usage
to
other
apps
and
use
cases
©2014
Couchbase
Inc.
13
Major
enterprises
across
industries
are
adopting
Couchbase
Technology
Retail
&
Apparel
Communications
E-‐Commerce
&
Digital
Advertising
Finance
&
Travel
&
Hospitality
Games
&
Gaming
Media
&
Business
Services
Entertainment
16
Couchbase
Server
Architecture
8092 11210 8091
Query API Data Access API Admin Console
Single-‐node
type
means
easier
administration
and
scaling
Query Engine
Node/Cluster
Coordination
Web UI
Data
manager
cluster
manager
§ Data
manager:
§ C/C++
Multi-threaded § Layer
consolidation
of
caching
and
Persistence Engine persistence
Erlang / OTP
§ Cluster
manager:
§ Erlang/OTP
DATA MANAGER CLUSTER MANAGER
§ Administration
UI’s
Couchbase Server Node
§ Out-‐of-‐band
for
data
requests
©2014
Couchbase
Inc.
Couchbase
Read
Operation
APPLICATION
SERVER
Single-‐node
type
means
GET
easier
administration
and
DOC
1
scaling
§ Reads
out
of
cache
are
extremely
fast
MANAGED
CACHE
§ No
other
process/system
to
communicate
with
DOC
1
DISK
QUEUE
DOC
1
20
Auto
sharding
–
Bucket
and
vBuckets
§ A
bucket
is
a
logical,
unique
key
space
Data buckets
§ Multiple
buckets
can
exist
within
a
single
cluster
of
nodes
§ Each
bucket
has
active
and
replica
data
sets
(1,
2
or
3
extra
copies)
§ Each
data
set
has
1024
Virtual
Buckets
(vBuckets)
§ Each
vBucket
contains
1/1024th
portion
of
the
data
set
§ vBuckets
do
not
have
a
fixed
physical
server
location
vB
vB
§ Mapping
between
the
vBuckets
and
physical
servers
is
called
the
cluster
map
1 ….. 1024 § Document
IDs
(keys)
always
get
hashed
to
the
same
vbucket
§ Couchbase
SDK’s
lookup
the
vbucket
-‐>
server
mapping
Virtual buckets
Couchbase SDK
CRC32
Hashing Algorithm
CLUSTER MAP
vBucket1024
vBucket7
vBucket4
vBucket6
vBucket5
vBucket3
vBucket2
vBucket1
...
©2014
Couchbase
Inc.
Couchbase Cluster
Basic
Operation
Application
has
single
logical
connection
to
cluster
(client
object)
• Data
is
automatically
sharded
resulting
in
even
document
data
distribution
across
cluster
ACTIVE
ACTIVE
ACTIVE
• Each
vbucket
replicated
1,
2
or
3
times
(“peer-‐to-‐peer”
replication)
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
5
2
9
4
7
8
1
3
6
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
§ Client
library
is
automatically
updated
via
cluster
map
REPLICA
REPLICA
REPLICA
REPLICA
REPLICA
§ Replicas
not
recreated
to
SHARD
4
SHARD
1
SHARD
6
SHARD
3
SHARD
7
SHARD
9
SHARD
5
SHARD
SHARD
8
SHARD
preserve
stability
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
SHARD
2
SHARD
§ Best
practice
to
replace
node
and
rebalance
Couchbase
Server
1
Couchbase
Server
2
Couchbase
Server
3
Couchbase
Server
4
Couchbase
Server
5
New
York
San
Francisco
SF Server Cluster
SELECT Projection
DISTINCT De-duplication
FROM Sourcing
WHERE Filtering
ORDER BY Sorting
Expressions
q Arithmetic [ +, -, *, /, % ]
Operators q Comparison [ <, <=, =, !=, >=, >, BETWEEN, IS NULL ]
NEST Collecting second term into nested array [ INNER, LEFT OUTER ]
Array and deep update* UPDATE of matching elements IN arrays and WITHIN any depth
Distributed Data
Document metadata § META function to access ID, TTL, CAS, FLAGS…
*Upcoming
Pre-Aggregate
Parse Plan Scan Fetch Join Filter Aggregate Sort Offset Limit Project