CouchBase

A Mini Primer

Agenda

  • Brief history
  • Feature Overview
  • Architecture
  • Compare with CouchDB
  • See it in action!

Brief History

+

Features

Key-Value Store

Document Store

Managed Cache

CP or AP?

Architecture

Types of Services

  • Query Service
    • Query planning, execution and coordination
  • Index Service
    • Builds and maintains global secondary indexes
  • Data Service
    • Builds and maintains map-reduce views

 

Indexing

  • Map-Reduce views (distributed secondary index)
    • Scatter-and-gather
    • Same semantics as CouchDB
    • No python query server
  • Global secondary index
    • Low latency, without compromising mutation performance
  • Spatial Views - for geo-spatial data

Querying

  • Map-Reduce view
    • Scatter-and-gather, pre-aggregated
    • Javascript M-R function (same as CouchDB)
  • Global Secondary Index (GSI)
    • Single-node, JIT-aggregated
    • N1QL (Superset of SQL)
    • Extended SQL construct for JSON manipulation
    • support EXPLAIN

Tunable Durability

  • Write to managed cache by default
  • Increase durability requirement by using
    • persistTo(number of nodes)
    • replicateTo(number of nodes)
  • See the performance impact in demo

Compare with CouchDB

  • Both support document storage
    • CouchBase is also a key-value store
  • Both have RESTful API
    • CouchBase SDK uses binary protocol by default
  • Both support querying by M-R
    • CouchBase also supports SQL-like query lang.
  • Out-of-the-box clustering and sharding
  • In active development

Demo Time

couchbase

By Kevin Jing Qiu

couchbase

  • 1,490