SlideShare a Scribd company logo
UNDER THE HOOD
COUCHBASE SERVER 4.0 ARCHITECTURE
Cihan Biyikoglu
Director of Product Management
©2015 Couchbase Inc. 2
Agenda
Goals
 Give you a full tour of the mansion!
 Zoom into major components and services in
Couchbase Server 4.0
 Impress your date…
©2015 Couchbase Inc. 3
Agenda
 Overview
 Cluster Architecture – 10k ft view
 Deep Dive
 Connectivity Architecture with Client SDKs
 ReplicationArchitecture with DCP
 Cluster Management
 Services
Data Service, Index Service, Query Service
 Recap
 Q&A
©2015 Couchbase Inc. 4
Disclaimer
Couchbase Server 4.0 and ForestDB are still in
development and the final version of the
products may not be identical in details
discussed on this session.
Overview
©2015 Couchbase Inc. 6
Couchbase Server 4.0 - Cluster Architecture
STORAGE
Couchbase Server 1
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Managed Cache
Storage
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 2
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 3
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 4
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 5
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 6
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
Managed Cache
Storage
Managed Cache
Storage
Managed Cache
Storage
Managed Cache
Storage
Managed Cache
Storage
©2014 Couchbase Inc.
Couchbase Server 4.0 - Cluster Architecture
STORAGE
Couchbase Server 1
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Managed Cache
Storage
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 2
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 3
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 4
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 5
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
STORAGE
Couchbase Server 6
SHARD
7
SHARD
9
SHARD
5
SHARDSHARDSHARD
Managed
Cache
Cluster
ManagerCluster
Manager
Data Service
Index Service
Query Service
Managed Cache
Storage
Managed Cache
Storage
Managed Cache
Storage
Managed Cache
Storage
Managed Cache
Storage
Deep Dive
Connectivity
Replication
Cluster Manager
Data Service
Indexing & Index Service
Query Service
©2015 Couchbase Inc. 9
Connectivity and Client Libraries
Type Port Endpoint
REST 8091, 18091 Admin Connections
Pointed at any node in the cluster
REST 8091, 18092 Query withView
Load balanced across node of the cluster that runs data service
REST 8093, 18093 Query with N1QL
Load balanced across node of the cluster that runs query service
ONLINE 11210, 11207 Core Data Operations
State-full connections from client app to nodes of the cluster that runs
data service
©2015 Couchbase Inc. 10
Connectivity and Client Libraries
Connectivity Phases
1. Auth
2. Discovery
Get cluster map
3. Service Connection
Auth to Service
Run operation
If (topology_change)
Rerun #2
10
1 2
…
©2015 Couchbase Inc. 11
Discovery and Cluster Map
©2015 Couchbase Inc. 12
Discovery and Cluster Map
©2015 Couchbase Inc. 13
Discovery and Cluster Map – 2 New Nodes
Deep Dive
Connectivity
Replication
Cluster Manager
Data Service
Indexing & Index Service
Query Service
©2015 Couchbase Inc. 15
Database Change Protocol (DCP)
Fast Streaming Replication
 DCP - An open streaming protocol that conveys the consistent database state to all consumers
 Ordering (vbucket based seq.number)
 Re-startable, Resumable (version histories and rollbacks)
 Consistent (snapshots)
 High Performance (memory based with dedup)
Master
Local
Replica
Index
Map/R
educe
Remot
e
Replica
IndexMap/Re
duce
Source Cluster
Cross Data Center Cluster
Hadoop
Client/Appl
ication
Notification
In future
Integration
Backup/Ex
port
Tooling
Deep Dive
Connectivity
Replication
Cluster Manager
Data Service
Indexing & Index Service
Query Service
©2015 Couchbase Inc. 17
Cluster Manager
Cluster Manager = Governor of the Cluster
Manages cluster level operations and coordination among nodes
 Cluster Membership & Service Layout
 Node Status & Failover
 Data Placement & Rebalance
 Auth
17
©2015 Couchbase Inc. 18
Cluster Manager
Inside Cluster Manager
per-node-&-bucket services
generic distributed facilities
generic local facilities
Logging and Other Services
distributed node discovery
Master Services
- cluster level
operations
- data placement
- rebalancer
- auto-failover
Admin Portal – RESTAPI
Global Config (gossip replication)
Local Config Store
Per-node Services
- Heartbeats,
- Babysitter
Bucket services
- dcp init and teardown
- stats collectors,
Auth
©2014 Couchbase Inc.
Adding Nodes to Cluster Online
19
ACTIVE ACTIVE ACTIVE
REPLICA REPLICA REPLICA
Couchbase Server 1 Couchbase Server 2 Couchbase Server 3
ACTIVE ACTIVE
REPLICA REPLICA
Couchbase Server 4 Couchbase Server 5
SHARD
5
SHARD
2
SHARD SHARD
SHARD
4
SHARD SHARD
SHARD
1
SHARD
3
SHARD SHARD
SHARD
4
SHARD
1
SHARD
8
SHARD SHARD SHARD
SHARD
6
SHARD
3
SHARD
2
SHARD SHARD SHARD
SHARD
7
SHARD
9
SHARD
5
SHARD SHARD SHARD
SHARD
7
SHARD
SHARD
6
SHARD
SHARD
8
SHARD
9
SHARD
READ/WRITE/UPDATE
Cluster Manager receives the
new nodes
- Node inherit cluster
settings
- Move active and replica
vbuckets using DCP
- As vbuckets catch up,
Initiate online handoff
from “existing node” to
“new node”
Clients Receive Topology
Change Notification
- Trap not_my_vbucket
errors
- Refresh cluster map and
retry operation
©2015 Couchbase Inc. 20
Deeper Dive into Architecture
THUR @1.00 - ArchitectureTrack
Deep Dive into Cluster Manager in
Couchbase Server 4.0
Dave Finlay, Senior Director of Development, Couchbase
Deep Dive
Connectivity
Replication
Cluster Manager
Data Service
Indexing & Index Service
Query Service
©2015 Couchbase Inc. 22
Data Service
 Data Service = GET/SET + Map-ReduceViews*
Tackles fast core data operations with efficient caching and disk persistence
 Core Database Operations
 Core GET/SET operations
 Couchstore Based Storage
Terms:
Bucket = database reside within a cluster
vBucket = hash partition of the database that reside within a node
22
©2015 Couchbase Inc. 23
Data Manager Architecture
…
Database Engine (ep-engine)
Listener
vBucket
Manager
Item Pager
Expiry PagerCheckpoint Manager
Cache Partition Hash Tables
(Active and Replica)
Partition Hash Tables
(Active and Replica)
Partition Hash Tables
(Active and Replica)
AuthNetwork IO
Flusher
Scheduler
Reader IO
Writer IO
Non IO
Batch Reader
©2014 Couchbase Inc.
APPLICATION SERVER
MANAGED CACHE
DISK
DISK
Data Manager - Update Operation
24
DOC 1
DOC 1
DOC 1
DOC 1DOC 1
 Caching based on Memcached:
App gets an ACK when update is
successfully in RAM
 Or RAM+Replicated
 Or RAM+Persisted
 Or RAM+Replicated+Persisted
 Or …
 DCP base Replication: updates
queued to other nodes
 Couchstore based Storage:
updates queued for storage
DCP
©2014 Couchbase Inc.
Data Manager - Cache Ejection
25
APPLICATION SERVER
MANAGED CACHE
DISK
DISK
DOC 1
DOC 2DOC 3DOC 4DOC 5
DOC 1
DOC 2 DOC 3 DOC 4 DOC 5
DCP
©2014 Couchbase Inc.
APPLICATION SERVER
MANAGED CACHE
DISK
DISK
DCP
DOC 1
Data Manager - Cache Miss
26
DOC 2 DOC 3 DOC 4 DOC 5
DOC 2 DOC 3 DOC 4 DOC 5
GET
DOC 1
DOC 1
DOC 1
©2015 Couchbase Inc. 27
Deeper Dive into Architecture
WED @4.30 - ArchitectureTrack
Next Generation Storage Engine: ForestDB
Chiyoung Seo, Software Engineer, Couchbase
©2015 Couchbase Inc. 28
Deeper Dive into Architecture
THUR @2.30 - ArchitectureTrack
Under the Hood ForestDB: Performance on
SSDs and File Systems
Sundar Sridharan, Senior Developer, Couchbase
Prof. Sang-Won Lee, Sungkyunkwan University, Suwon, Korea
Deep Dive
Connectivity
Replication
Cluster Manager
Data Service
Indexing & Index Service
Query Service
©2015 Couchbase Inc. 30
Indexing
 Indexers
 Views: Incremental Map/Reduce with customer JavaScript for
complex indexing logic for online reporting and analytics
 SpatialViews: Incremental/Reduce with R-tree Indexes for Bounding-
Box queries
 GSI (Global Secondary Indexes): Efficient indexes for secondary
lookups and ad-hoc query processing
©2015 Couchbase Inc. 31
Indexing withViews
Incremental Map/ReduceViews
Queries with incremental map/reduce processing that can execute custom JS
 Flexible Indexer
 Indexer & Query Processor
 Couchstore Based Storage
31
©2015 Couchbase Inc. 32
Views
32
APPLICATION SERVER
VIEW
INDEXER
Query Set
1. SET operation
• In Memory SET: queued for DCP
Replication
• View Indexer: Executes
incremental map/reduce on a batch
of updates
• Couchstore based Storage:
updates queued for storage
2. ViewQuery Engine: REST Based
queries with filters, limit and more
executed with scatter-gather
©2015 Couchbase Inc. 33
Index Service
 Global Secondary Indexes (NEW in 4.0)
Tackles indexer for fast query execution with efficient index maintenance for
N1QLQueries
 High Performance Indexing
 Projector and Router : Coordinate and communicate efficient index change
notifications between data service and index service.
 Supervisor – Indexer and scanner
Indexer : Maintain large number of indexes as change notifications arrive
Scanner: Respond to Query Service index-scan requests with rich set of consistency dials
 Index Storage &Caching
ForestDB: Brand new storage engine for high performance index caching and storage
33
©2015 Couchbase Inc. 34
Data Service
Projector & Router
Indexing Service
Query ServiceIndex Service
Supervisor
Index maintenance &
Scan coordinator
Index#2Index#1
Query Processor
cbq-engine
Bucket#1 Bucket#2
DCP Stream
Index#4Index#3
...
B
u
c
k
e
t
#
2
B
u
c
k
e
t
#
1
Projector and Router:
1 Projector and Router per node
1 stream of changes per buckets per
supervisor
ForestDB
Storage Engine
Supervisor
1 Supervisor per node
Many indexes per Supervisor
©2015 Couchbase Inc. 35
Deeper Dive into Architecture
WED @1.45 - ArchitectureTrack
Global Secondary Indexing in Couchbase Server 4.0
Cihan Biyikoglu, Director of Product Management, Couchbase
©2015 Couchbase Inc. 36
Deeper Dive into Architecture
WED @3.45 - ArchitectureTrack
Deep Dive into Global Secondary Indexing
Architecture in Couchbase Server 4.0
John Liang, Architect, Couchbase
Deep Dive
Connectivity
Replication
Cluster Manager
Data Service
Indexing & Index Service
Query Service
©2015 Couchbase Inc. 38
Query Service
 Query Service = N1QL
Tackles N1QLQuery execution
 Query Execution
 N1QL Parser & Optimizer: tokenize N1QL statement, and generate an
execution plan based utilizing indexes
 Query Execution Engine: Assigns resources to query and coordinates query
execution.
 Data Sources: Pluggable “data source driver” layer for accessing data sources
in Couchbase Server (data and index service) and other external data provides
38
©2015 Couchbase Inc. 39
Query Service
 N1QL Query Processing
Query Engine
Query Processor
Listeners
Parser Optimizer
Data Stores
Execution Engine
Couchbase Server
Auth Data
Indexers
GSI Views
Others…
8093/18903
File system
Data Service
Index Service
......
Cluster Manager
Bucket#2 Bucket#2
Index#2Index#1
©2015 Couchbase Inc. 40
Deeper Dive into Architecture
WED @2.30 - ArchitectureTrack
Deep Dive into N1QL Internals
in Couchbase Server 4.0
Keshav Murthy, Director of Development, Couchbase
©2015 Couchbase Inc. 41
Recap
Couchbase Server decouples competing
workloads into Services
Each Service tunes itself with caching and
storage services
Each Service can be independently scale
Q&A
Cihan Biyikoglu
cihan@couchbase.com
@cihangirb
Couchbase.com/beta
Thank you.

More Related Content

PPTX
Tuning N1QL Query Performance with Couchbase Server 4.0
PPTX
Deploy data analysis pipeline with mesos and docker
PPTX
A tour of Oracle DV V3.0 new features (June 2017)
PDF
[db tech showcase Tokyo 2017] C24:Taking off to the clouds. How to use DMS in...
PPTX
Oracle DV V4 new features overview
PPTX
NYC* 2013 — "Using Cassandra for DVR Scheduling at Comcast"
PPTX
Foundations of streaming SQL: stream & table theory
PPTX
Tez Data Processing over Yarn
Tuning N1QL Query Performance with Couchbase Server 4.0
Deploy data analysis pipeline with mesos and docker
A tour of Oracle DV V3.0 new features (June 2017)
[db tech showcase Tokyo 2017] C24:Taking off to the clouds. How to use DMS in...
Oracle DV V4 new features overview
NYC* 2013 — "Using Cassandra for DVR Scheduling at Comcast"
Foundations of streaming SQL: stream & table theory
Tez Data Processing over Yarn

What's hot (20)

PPTX
Apache Tez : Accelerating Hadoop Query Processing
PDF
Parallelization of Structured Streaming Jobs Using Delta Lake
PPTX
Ozone: scaling HDFS to trillions of objects
PDF
Big Data Tools in AWS
PPTX
Apache Tez - Accelerating Hadoop Data Processing
PPTX
Discover How IBM Uses InfluxDB and Grafana to Help Clients Monitor Large Prod...
PPTX
Couchbase presentation
PPTX
Change data capture
PDF
Couchbase Day
PDF
How InfluxDB Enables NodeSource to Run Extreme Levels of Node.js Processes
PPTX
Cost-based query optimization in Apache Hive
PPTX
Pulsar in the Lakehouse: Apache Pulsar™ with Apache Spark™ and Delta Lake - P...
PPTX
Tez big datacamp-la-bikas_saha
PDF
Couchbase Sydney meetup #1 Couchbase Architecture and Scalability
PPTX
Large-scaled telematics analytics
PDF
Change Data Capture with Data Collector @OVH
PDF
Real-Time Attribution with Structured Streaming and Databricks Delta with Car...
PPTX
Curriculum Associates Strata NYC 2017
PPTX
Manage Microservices & Fast Data Systems on One Platform w/ DC/OS
PPTX
Apache Tez -- A modern processing engine
Apache Tez : Accelerating Hadoop Query Processing
Parallelization of Structured Streaming Jobs Using Delta Lake
Ozone: scaling HDFS to trillions of objects
Big Data Tools in AWS
Apache Tez - Accelerating Hadoop Data Processing
Discover How IBM Uses InfluxDB and Grafana to Help Clients Monitor Large Prod...
Couchbase presentation
Change data capture
Couchbase Day
How InfluxDB Enables NodeSource to Run Extreme Levels of Node.js Processes
Cost-based query optimization in Apache Hive
Pulsar in the Lakehouse: Apache Pulsar™ with Apache Spark™ and Delta Lake - P...
Tez big datacamp-la-bikas_saha
Couchbase Sydney meetup #1 Couchbase Architecture and Scalability
Large-scaled telematics analytics
Change Data Capture with Data Collector @OVH
Real-Time Attribution with Structured Streaming and Databricks Delta with Car...
Curriculum Associates Strata NYC 2017
Manage Microservices & Fast Data Systems on One Platform w/ DC/OS
Apache Tez -- A modern processing engine
Ad

Similar to Under the Hood - Couchbase Server Architecture - June 2015 (20)

PPTX
Couchbase 101
PDF
Manuel Hurtado. Couchbase paradigma4oct
PPT
NoSQL_Night
PDF
Couchbase - Yet Another Introduction
PPTX
Couchbase and Apache Spark
PPTX
Couchbase Data Pipeline
PPTX
Enterprise Architect's view of Couchbase 4.0 with N1QL
PPTX
Introduction to couchbase
PPTX
Introduction no sql solutions with couchbase and .net core
DOCX
PPTX
Revolutionizing the customer experience - Hello Engagement Database
PPTX
Optimized Couchbase Data Management
PPTX
Couchbase Data Platform | Big Data Demystified
PDF
The Modern Database for Enterprise Applications
PDF
PDF
Introduction to NoSQL with Couchbase
PDF
How companies use NoSQL & Couchbase - NoSQL Now 2014
PDF
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
PDF
Enterprise Architecture vs. Data Architecture
PDF
Slides: Enterprise Architecture vs. Data Architecture
Couchbase 101
Manuel Hurtado. Couchbase paradigma4oct
NoSQL_Night
Couchbase - Yet Another Introduction
Couchbase and Apache Spark
Couchbase Data Pipeline
Enterprise Architect's view of Couchbase 4.0 with N1QL
Introduction to couchbase
Introduction no sql solutions with couchbase and .net core
Revolutionizing the customer experience - Hello Engagement Database
Optimized Couchbase Data Management
Couchbase Data Platform | Big Data Demystified
The Modern Database for Enterprise Applications
Introduction to NoSQL with Couchbase
How companies use NoSQL & Couchbase - NoSQL Now 2014
apidays LIVE Singapore 2022_Redesigning Data Architecture.pdf
Enterprise Architecture vs. Data Architecture
Slides: Enterprise Architecture vs. Data Architecture
Ad

More from Cihan Biyikoglu (9)

PPTX
Securing Redis
PPTX
Real-time Analytics with Redis
PPTX
Developing Active-Active Geo-Distributed Apps with Redis
PPTX
Cross Data Center Replication with Redis using Redis Enterprise
PPTX
Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015
PPTX
SQL gene in NoSQL
PPTX
Document Data Modelling with Couchbase Server 4.0
PPTX
Deploying couchbaseserverazure cihanbiyikoglu_microsoft
PPTX
Inside Sql Azure - Cihan Biyikoglu - SQL Azure
Securing Redis
Real-time Analytics with Redis
Developing Active-Active Geo-Distributed Apps with Redis
Cross Data Center Replication with Redis using Redis Enterprise
Global Secondary Indexes in Couchbase Server 4.0 - JUNE 2015
SQL gene in NoSQL
Document Data Modelling with Couchbase Server 4.0
Deploying couchbaseserverazure cihanbiyikoglu_microsoft
Inside Sql Azure - Cihan Biyikoglu - SQL Azure

Recently uploaded (20)

PPTX
Construction Project Organization Group 2.pptx
PPT
Project quality management in manufacturing
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
composite construction of structures.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Well-logging-methods_new................
PPTX
Welding lecture in detail for understanding
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
web development for engineering and engineering
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Geodesy 1.pptx...............................................
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Construction Project Organization Group 2.pptx
Project quality management in manufacturing
Internet of Things (IOT) - A guide to understanding
R24 SURVEYING LAB MANUAL for civil enggi
composite construction of structures.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
CH1 Production IntroductoryConcepts.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Well-logging-methods_new................
Welding lecture in detail for understanding
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
web development for engineering and engineering
UNIT 4 Total Quality Management .pptx
Geodesy 1.pptx...............................................
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf

Under the Hood - Couchbase Server Architecture - June 2015

  • 1. UNDER THE HOOD COUCHBASE SERVER 4.0 ARCHITECTURE Cihan Biyikoglu Director of Product Management
  • 2. ©2015 Couchbase Inc. 2 Agenda Goals  Give you a full tour of the mansion!  Zoom into major components and services in Couchbase Server 4.0  Impress your date…
  • 3. ©2015 Couchbase Inc. 3 Agenda  Overview  Cluster Architecture – 10k ft view  Deep Dive  Connectivity Architecture with Client SDKs  ReplicationArchitecture with DCP  Cluster Management  Services Data Service, Index Service, Query Service  Recap  Q&A
  • 4. ©2015 Couchbase Inc. 4 Disclaimer Couchbase Server 4.0 and ForestDB are still in development and the final version of the products may not be identical in details discussed on this session.
  • 6. ©2015 Couchbase Inc. 6 Couchbase Server 4.0 - Cluster Architecture STORAGE Couchbase Server 1 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Managed Cache Storage Data Service Index Service Query Service STORAGE Couchbase Server 2 Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service STORAGE Couchbase Server 3 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service STORAGE Couchbase Server 4 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service STORAGE Couchbase Server 5 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service STORAGE Couchbase Server 6 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service Managed Cache Storage Managed Cache Storage Managed Cache Storage Managed Cache Storage Managed Cache Storage
  • 7. ©2014 Couchbase Inc. Couchbase Server 4.0 - Cluster Architecture STORAGE Couchbase Server 1 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Managed Cache Storage Data Service Index Service Query Service STORAGE Couchbase Server 2 Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service STORAGE Couchbase Server 3 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service STORAGE Couchbase Server 4 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service STORAGE Couchbase Server 5 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service STORAGE Couchbase Server 6 SHARD 7 SHARD 9 SHARD 5 SHARDSHARDSHARD Managed Cache Cluster ManagerCluster Manager Data Service Index Service Query Service Managed Cache Storage Managed Cache Storage Managed Cache Storage Managed Cache Storage Managed Cache Storage
  • 8. Deep Dive Connectivity Replication Cluster Manager Data Service Indexing & Index Service Query Service
  • 9. ©2015 Couchbase Inc. 9 Connectivity and Client Libraries Type Port Endpoint REST 8091, 18091 Admin Connections Pointed at any node in the cluster REST 8091, 18092 Query withView Load balanced across node of the cluster that runs data service REST 8093, 18093 Query with N1QL Load balanced across node of the cluster that runs query service ONLINE 11210, 11207 Core Data Operations State-full connections from client app to nodes of the cluster that runs data service
  • 10. ©2015 Couchbase Inc. 10 Connectivity and Client Libraries Connectivity Phases 1. Auth 2. Discovery Get cluster map 3. Service Connection Auth to Service Run operation If (topology_change) Rerun #2 10 1 2 …
  • 11. ©2015 Couchbase Inc. 11 Discovery and Cluster Map
  • 12. ©2015 Couchbase Inc. 12 Discovery and Cluster Map
  • 13. ©2015 Couchbase Inc. 13 Discovery and Cluster Map – 2 New Nodes
  • 14. Deep Dive Connectivity Replication Cluster Manager Data Service Indexing & Index Service Query Service
  • 15. ©2015 Couchbase Inc. 15 Database Change Protocol (DCP) Fast Streaming Replication  DCP - An open streaming protocol that conveys the consistent database state to all consumers  Ordering (vbucket based seq.number)  Re-startable, Resumable (version histories and rollbacks)  Consistent (snapshots)  High Performance (memory based with dedup) Master Local Replica Index Map/R educe Remot e Replica IndexMap/Re duce Source Cluster Cross Data Center Cluster Hadoop Client/Appl ication Notification In future Integration Backup/Ex port Tooling
  • 16. Deep Dive Connectivity Replication Cluster Manager Data Service Indexing & Index Service Query Service
  • 17. ©2015 Couchbase Inc. 17 Cluster Manager Cluster Manager = Governor of the Cluster Manages cluster level operations and coordination among nodes  Cluster Membership & Service Layout  Node Status & Failover  Data Placement & Rebalance  Auth 17
  • 18. ©2015 Couchbase Inc. 18 Cluster Manager Inside Cluster Manager per-node-&-bucket services generic distributed facilities generic local facilities Logging and Other Services distributed node discovery Master Services - cluster level operations - data placement - rebalancer - auto-failover Admin Portal – RESTAPI Global Config (gossip replication) Local Config Store Per-node Services - Heartbeats, - Babysitter Bucket services - dcp init and teardown - stats collectors, Auth
  • 19. ©2014 Couchbase Inc. Adding Nodes to Cluster Online 19 ACTIVE ACTIVE ACTIVE REPLICA REPLICA REPLICA Couchbase Server 1 Couchbase Server 2 Couchbase Server 3 ACTIVE ACTIVE REPLICA REPLICA Couchbase Server 4 Couchbase Server 5 SHARD 5 SHARD 2 SHARD SHARD SHARD 4 SHARD SHARD SHARD 1 SHARD 3 SHARD SHARD SHARD 4 SHARD 1 SHARD 8 SHARD SHARD SHARD SHARD 6 SHARD 3 SHARD 2 SHARD SHARD SHARD SHARD 7 SHARD 9 SHARD 5 SHARD SHARD SHARD SHARD 7 SHARD SHARD 6 SHARD SHARD 8 SHARD 9 SHARD READ/WRITE/UPDATE Cluster Manager receives the new nodes - Node inherit cluster settings - Move active and replica vbuckets using DCP - As vbuckets catch up, Initiate online handoff from “existing node” to “new node” Clients Receive Topology Change Notification - Trap not_my_vbucket errors - Refresh cluster map and retry operation
  • 20. ©2015 Couchbase Inc. 20 Deeper Dive into Architecture THUR @1.00 - ArchitectureTrack Deep Dive into Cluster Manager in Couchbase Server 4.0 Dave Finlay, Senior Director of Development, Couchbase
  • 21. Deep Dive Connectivity Replication Cluster Manager Data Service Indexing & Index Service Query Service
  • 22. ©2015 Couchbase Inc. 22 Data Service  Data Service = GET/SET + Map-ReduceViews* Tackles fast core data operations with efficient caching and disk persistence  Core Database Operations  Core GET/SET operations  Couchstore Based Storage Terms: Bucket = database reside within a cluster vBucket = hash partition of the database that reside within a node 22
  • 23. ©2015 Couchbase Inc. 23 Data Manager Architecture … Database Engine (ep-engine) Listener vBucket Manager Item Pager Expiry PagerCheckpoint Manager Cache Partition Hash Tables (Active and Replica) Partition Hash Tables (Active and Replica) Partition Hash Tables (Active and Replica) AuthNetwork IO Flusher Scheduler Reader IO Writer IO Non IO Batch Reader
  • 24. ©2014 Couchbase Inc. APPLICATION SERVER MANAGED CACHE DISK DISK Data Manager - Update Operation 24 DOC 1 DOC 1 DOC 1 DOC 1DOC 1  Caching based on Memcached: App gets an ACK when update is successfully in RAM  Or RAM+Replicated  Or RAM+Persisted  Or RAM+Replicated+Persisted  Or …  DCP base Replication: updates queued to other nodes  Couchstore based Storage: updates queued for storage DCP
  • 25. ©2014 Couchbase Inc. Data Manager - Cache Ejection 25 APPLICATION SERVER MANAGED CACHE DISK DISK DOC 1 DOC 2DOC 3DOC 4DOC 5 DOC 1 DOC 2 DOC 3 DOC 4 DOC 5 DCP
  • 26. ©2014 Couchbase Inc. APPLICATION SERVER MANAGED CACHE DISK DISK DCP DOC 1 Data Manager - Cache Miss 26 DOC 2 DOC 3 DOC 4 DOC 5 DOC 2 DOC 3 DOC 4 DOC 5 GET DOC 1 DOC 1 DOC 1
  • 27. ©2015 Couchbase Inc. 27 Deeper Dive into Architecture WED @4.30 - ArchitectureTrack Next Generation Storage Engine: ForestDB Chiyoung Seo, Software Engineer, Couchbase
  • 28. ©2015 Couchbase Inc. 28 Deeper Dive into Architecture THUR @2.30 - ArchitectureTrack Under the Hood ForestDB: Performance on SSDs and File Systems Sundar Sridharan, Senior Developer, Couchbase Prof. Sang-Won Lee, Sungkyunkwan University, Suwon, Korea
  • 29. Deep Dive Connectivity Replication Cluster Manager Data Service Indexing & Index Service Query Service
  • 30. ©2015 Couchbase Inc. 30 Indexing  Indexers  Views: Incremental Map/Reduce with customer JavaScript for complex indexing logic for online reporting and analytics  SpatialViews: Incremental/Reduce with R-tree Indexes for Bounding- Box queries  GSI (Global Secondary Indexes): Efficient indexes for secondary lookups and ad-hoc query processing
  • 31. ©2015 Couchbase Inc. 31 Indexing withViews Incremental Map/ReduceViews Queries with incremental map/reduce processing that can execute custom JS  Flexible Indexer  Indexer & Query Processor  Couchstore Based Storage 31
  • 32. ©2015 Couchbase Inc. 32 Views 32 APPLICATION SERVER VIEW INDEXER Query Set 1. SET operation • In Memory SET: queued for DCP Replication • View Indexer: Executes incremental map/reduce on a batch of updates • Couchstore based Storage: updates queued for storage 2. ViewQuery Engine: REST Based queries with filters, limit and more executed with scatter-gather
  • 33. ©2015 Couchbase Inc. 33 Index Service  Global Secondary Indexes (NEW in 4.0) Tackles indexer for fast query execution with efficient index maintenance for N1QLQueries  High Performance Indexing  Projector and Router : Coordinate and communicate efficient index change notifications between data service and index service.  Supervisor – Indexer and scanner Indexer : Maintain large number of indexes as change notifications arrive Scanner: Respond to Query Service index-scan requests with rich set of consistency dials  Index Storage &Caching ForestDB: Brand new storage engine for high performance index caching and storage 33
  • 34. ©2015 Couchbase Inc. 34 Data Service Projector & Router Indexing Service Query ServiceIndex Service Supervisor Index maintenance & Scan coordinator Index#2Index#1 Query Processor cbq-engine Bucket#1 Bucket#2 DCP Stream Index#4Index#3 ... B u c k e t # 2 B u c k e t # 1 Projector and Router: 1 Projector and Router per node 1 stream of changes per buckets per supervisor ForestDB Storage Engine Supervisor 1 Supervisor per node Many indexes per Supervisor
  • 35. ©2015 Couchbase Inc. 35 Deeper Dive into Architecture WED @1.45 - ArchitectureTrack Global Secondary Indexing in Couchbase Server 4.0 Cihan Biyikoglu, Director of Product Management, Couchbase
  • 36. ©2015 Couchbase Inc. 36 Deeper Dive into Architecture WED @3.45 - ArchitectureTrack Deep Dive into Global Secondary Indexing Architecture in Couchbase Server 4.0 John Liang, Architect, Couchbase
  • 37. Deep Dive Connectivity Replication Cluster Manager Data Service Indexing & Index Service Query Service
  • 38. ©2015 Couchbase Inc. 38 Query Service  Query Service = N1QL Tackles N1QLQuery execution  Query Execution  N1QL Parser & Optimizer: tokenize N1QL statement, and generate an execution plan based utilizing indexes  Query Execution Engine: Assigns resources to query and coordinates query execution.  Data Sources: Pluggable “data source driver” layer for accessing data sources in Couchbase Server (data and index service) and other external data provides 38
  • 39. ©2015 Couchbase Inc. 39 Query Service  N1QL Query Processing Query Engine Query Processor Listeners Parser Optimizer Data Stores Execution Engine Couchbase Server Auth Data Indexers GSI Views Others… 8093/18903 File system Data Service Index Service ...... Cluster Manager Bucket#2 Bucket#2 Index#2Index#1
  • 40. ©2015 Couchbase Inc. 40 Deeper Dive into Architecture WED @2.30 - ArchitectureTrack Deep Dive into N1QL Internals in Couchbase Server 4.0 Keshav Murthy, Director of Development, Couchbase
  • 41. ©2015 Couchbase Inc. 41 Recap Couchbase Server decouples competing workloads into Services Each Service tunes itself with caching and storage services Each Service can be independently scale

Editor's Notes

  • #12: The application makes a call for a key called NYC MQ1 We run the key through the crc 32 function and the result of that hash function is that it points to vbucket3 Which in turn points to couchbase server number 1
  • #13: We now run a different key through through the has and we now come up with differnet vbucket, vbucket 4 and that points to server 3
  • #14: We now run a different key through through the has and we now come up with differnet vbucket, vbucket 4 and that points to server 3
  • #16: Protocol seemlessly consolidate/encapsulate working set management and storage cache Restartable – enable client to stop and resume work Universal – stream “Database change record”, not just data – enable disparate clients to have common agreement on a consistent state Effiicient – Multi-plex connection, de-duplication, memory-to-memory, flow control
  • #19: Large scale structure of ns_server. Similar / identical to Steve’s slide. Composed of different subsystems: libraries master services per node services per node – per bucket services generic services events To zoom in further, we need to talk a little about the language. Erlang.
  • #26: Now, as you fill up memory (click), some data that has already been written to disk will be ejected from RAM to make room for new data. (click) Couchbase supports holding much more data than you have RAM available. It’s important to size the RAM capacity appropriately for your working set: the portion of data your application is working with at any given point in time and needs very low latency, high throughput access to. In some applications this is the entire data set, in others it is much smaller. As RAM fills up, we use a “not recently used” algorithm to determine the best data to be ejected from cache.
  • #27: Should a read now come in for one of those documents that has been ejected (click), it is copied back from disk into RAM and sent back to the application. The document then remains in RAM as long as there is space and it is being accessed.