Beruflich Dokumente
Kultur Dokumente
Architecture
Laurent Doguin
Couchbase Developer Advocate
@ldoguin | laurent.doguin@couchbase.com
Real-time, Batch-oriented
interactive databases analytic databases
N1QL
{
“ID”: 1,
= +
“FIRST”: “Dipti”,
“LAST”: “Borkar”,
“ZIP”: “94040”,
“CITY”: “MV”,
“STATE”: “CA”
} JSON
Data Buckets
Servers Which live on
Functional
Allow for querying, execution of other
Manage connections to the bucket within the
Hold on to cluster information such as
Give the application developer a concurrent
Allow for view querying, building of queries
directives such as defining indexes and
topology.
API for basic (k-v) or document management
cluster for different services.
and reasonable error handling from the cluster.
View checking on index state.
Provide a core layer where IO can be managed
CRUD N1QL Query API
and optimized.
Query
API
Provide a way to manage buckets.
Reference Cluster Management
get()
abucket.NewViewQuery().Limit().Stale()
Query & Index insert()
Data Service abucket.NewN1QLQuery(
openBucket()
Services API
info()
upsert()
“SELECT * FROM default LIMIT 5” )
Cluster disconnect()
remove()
insertDesignDocument()
.Consistency(gocouchbase.RequestPlus);
flush()
listDesignDocuments()
©2015 Couchbase Inc. 10
Couchbase SDKs and Connectors
View Engine
Cluster
Orchestration
and executes queries against either
Global or Distributed indexes
Managed
Cache
Storage Managed
ü Cluster Manager – configuration, Cache
heartbeat, statistics, RESTful Storage Erlang / OTP
Management interface
Node Manager Cluster Manager
Couchbase Server Node
©2015 Couchbase Inc. 13
13
Data Service: Write Operation
Single-node type means
APPLICATION SERVER easier administration and
DOC 1
scaling
§ Writes are async by default
§ Application gets
acknowledgement when
MANAGED CACHE successfully in RAM and can trade-
off waiting for replication or
DOC 1
persistence per-write
REPLICATION/
XDCR/
§ Replication to 1, 2 or 3 other nodes
CONNECTORS/
VIEWS/
INDEXING
DISK
§ Replication is RAM-based so
DISK
extremely fast
QUEUE
§ Off-node replication is primary
level of HA
§ Disk written to as fast as possible –
©2015 Couchbase Inc. no waiting 14
14
Data Service: Read Operation
APPLICATION SERVER
Single-node type means
easier administration and
GET
DOC 1 scaling
§ Layer consolidation means 1
single interface for App to talk to
and get its data back as fast as
MANAGED CACHE possible
§ Incremental Map-Reduce
– Distributed simple real-time analytics
– Only considers changes due to updated data
Data buckets
vB vB vB vB
Couchbase SDK
Couchbase SDK
CRC32 CRC32
Hashing Algorithm
Hashing Algorithm
CLUSTER MAP
CLUSTER MAP
vBucket1024
vBucket2
vBucket4
vBucket6
vBucket5
vBucket3
vBucket7
vBucket1024
vBucket1
vBucket2
vBucket4
vBucket6
vBucket5
vBucket3
vBucket7
vBucket1
...
...
node1 node8
Index Service
Query Service
Data Service
Data Service
New York
San
Francisco
SF Server Cluster