Book Image

Learning Couchbase

By : Henry Potsangbam
Book Image

Learning Couchbase

By: Henry Potsangbam

Overview of this book

This book achieves its goal by taking up an end-to-end development structure, right from understanding NOSQL document design to implementing full fledged eCommerce application design using Couchbase as a backend. Starting with the architecture of Couchbase to get you up and running, this book quickly takes you through designing a NoSQL document and implementing highly scalable applications using Java API. You will then be introduced to document design and get to know the various ways to administer Couchbase. Followed by this, learn to store documents using bucket. Moving on, you will then learn to store, retrieve and delete documents using smart client base on Java API. You will then retrieve documents using SQL like syntax call N1QL. Next, you will learn how to write map reduce base views. Finally, you will configure XDCR for disaster recovery and implement an eCommerce application using Couchbase.
Table of Contents (12 chapters)
Index

Index

A

  • ACID
    • Atomicity / What is NoSQL and why do we need it?
    • Consistency / What is NoSQL and why do we need it?
    • Isolation / What is NoSQL and why do we need it?
    • Durability / What is NoSQL and why do we need it?
  • administrative interface, Couchbase
    • about / The need for the Couchbase administrative interface
  • architecture, Couchbase
    • about / The architecture of Couchbase
    • data manager / Data manager
    • cluster management / Cluster management
  • async operations
    • about / async operations
  • attributes, CouchbaseEnvironment class
    • connectTimeout(long) / Connection management
    • reconnectDelay(Delay) / Connection management
    • keepAliveInterval(long) / Connection management
    • viewTimeout(long) / Connection management
    • computationPoolSize(int) / Connection management
    • queryTimeout(long) / Connection management
    • queryPort(int) / Connection management
  • auto-sharding / Why do we need NoSQL?

B

  • backup
    • about / Backup and restoration
    • full backup / Backup and restoration
    • incremental backup / Backup and restoration
    • differential backup / Backup and restoration
  • best practices, administrator
    • about / Best practices
    • cluster design / Cluster design
    • sizing / Sizing
    • hardware / Hardware
  • buckets
    • features, viewing / Buckets and servers
    • server nodes / Server nodes
    • data buckets / Data buckets
    • Memcached / Data buckets, Memcached
    • Couchbase / Data buckets, Couchbase
    • about / Buckets, Types of bucket
    • types / Types of bucket
  • built-in reduce functions
    • about / Built-in reduce functions
    • count function / count
    • sum function / sum
    • stats function / stats
  • bulk set
    • performing / Performing a bulk set

C

  • CAS / CAS
  • cbbackup command
    • about / cbbackup
    • all nodes, backing up / Backing up all nodes and all buckets
    • all buckets, backing up / Backing up all nodes and all buckets
    • all nodes, backing up for single bucket / Backing up all nodes for a single bucket
    • single node, backing up for single bucket / Backing up a single node for a single bucket
    • cbrestore tool, used for restoring / Restoring using the cbrestore tool
    • Couchbase cluster file copies, backing up / Backing up the Couchbase cluster using file copies
  • cluster monitoring
    • about / Monitoring
    • server startup / Monitoring startup
    • disk write queue / Monitoring the disk write queue
  • command line interface / The command line interface
  • compaction
    • about / Compaction
    • process / The compaction process
    • configuration / The compaction configuration
  • conceptual model
    • about / The conceptual model
    • customer / The conceptual model
    • cart / The conceptual model, Cart
    • product / The conceptual model, Product
    • category / The conceptual model
    • customer information / Customer
    • category/catalog / Category/catalog
    • order information / Order
  • connection management
    • about / Connection management
  • content-driven applications
    • about / Understanding content-driven applications
  • Couchbase
    • architecture / The architecture of Couchbase
    • concepts / Concepts of Couchbase
    • buckets / Buckets, Buckets
    • views / Views
    • Cross Data Center Replication (XDCR) / Cross Data Center Replication
    • installation, on Windows / Installation on Windows and Linux environments
    • URL / Installation on Windows and Linux environments
    • installation, on Linux environments / Installation on Windows and Linux environments
    • installation, on Red Hat / CentOS / Couchbase installation on Red Hat, CentOS, and others
    • stopping, on Linux / On Linux
    • starting, on Linux / On Linux
    • starting, on Windows / On Windows
    • stopping, on Windows / On Windows
    • log files / Understanding log and configuration files
    • configuration files / Understanding log and configuration files
    • debug-level error messages / debug
    • information-level error messages / info
    • error-level messages / error
    • mapreduce_errors file / mapreduce_errors
    • reports.log / reports.log
    • Lite, using for mobile development / Mobile development with Couchbase Lite
    • administrative interface / The need for the Couchbase administrative interface
    • administrative REST API / Couchbase administrative REST API
    • internals / Understanding some internals of Couchbase
    • using, as database for e-commerce application / Overview
  • couchbase-cli command / The command line interface
  • Couchbase API
    • about / Understanding the Couchbase API
    • used, for CRUD operations / CRUD operations using the Couchbase API
  • Couchbase bucket type
    • about / Couchbase
  • Couchbase cluster
    • write operation / Understanding write operation in the Couchbase cluster
    • update operation / Understanding update operations in the Couchbase cluster
    • read operation / Understanding read operation in the Couchbase cluster
    • overview / Overview
  • Couchbase cluster, designing
    • RAM / Cluster design
    • nodes and cores / Cluster design
    • storages / Cluster design
  • CouchbaseEnvironment class
    • attributes / Connection management
  • Couchbase Java SDK (2.1.3)
    • URL / Connection management
  • Couchbase Lite
    • used, for mobile development / Mobile development with Couchbase Lite
  • Couchbase SDK
    • overview / A Couchbase SDK overview
    • URL / A Couchbase SDK overview
    • smart clients / A Couchbase SDK overview
    • Memcached compatible / A Couchbase SDK overview
  • Couchbase Server
    • features / Why do we need NoSQL?
  • counters
    • about / Understanding counters
  • create() method / Understanding Java SDK
  • create operations
    • set (key, value) / Create
    • add (key, value) / Create
  • CRUD operations
    • Couchbase API, using / CRUD operations using the Couchbase API
  • CRUD operations, with Couchbase API
    • about / CRUD operations using the Couchbase API
    • create / Create
    • read / Read
    • update / Update
    • delete / Delete
  • CRUD operations, with Java SDK
    • about / CRUD operations using the Java SDK
    • URL / CRUD operations using the Java SDK
    • insert / Insert
    • read / Read
    • update / Update
    • upsert / Upsert
    • delete / Delete
    • touch / Touch
    • Maven project, implementing / Implementation – a Maven project for CRUD operations using the Java SDK
  • curl
    • URL / Couchbase administrative REST API
  • custom reduce functions
    • about / Custom reduce functions

D

  • data
    • filtering / Filtering and transforming data
    • transforming / Filtering and transforming data
  • data transformation
    • about / Filtering and transforming data
    • keys, using / Using keys
    • pagination, incorporating / Pagination
    • grouping / Grouping
    • ordering / Ordering
  • data types
    • about / A shopping cart – understanding data types
  • delete operations
    • delete (key) / Delete
  • detailed replication progress / The detailed replication progress
  • document
    • versus RDBMS / Document versus RDBMS
  • document class
    • about / Insert
  • document editor
    • using / Using the document editor
    • User document / User
    • Order / Order
  • document modeling
    • about / Document modeling
    • one document, versus multiple documents / One document versus multiple documents, Order
  • document relationships
    • about / Document relationships
    • between user and order, maintaining / User and Order
  • documents
    • about / Understanding documents
    • keys / Keys and metadata
    • metadata / Keys and metadata
    • JSON format / Keys and metadata
    • binary data / Keys and metadata
  • domain object
    • and user, representing / User
    • and order, representing / Order

E

  • Eclipse IDE for Java Developers
    • URL / Implementation – a Maven project for CRUD operations using the Java SDK
  • ejection / Ejection
  • emit() method / Views
  • ES
    • about / Full text search overview
    • URL / Full text search overview, Configuration and query
    • document / Full text search overview
    • index / Full text search overview
    • type / Full text search overview
    • configuring / Configuration and query
    • integrating, with Couchbase / Configuration and query
    • querying, with Java APIs / An API to connect to ES
  • ES, features
    • full text search / Full text search overview
    • document-oriented / Full text search overview
    • schemaless / Full text search overview
    • analytics / Full text search overview
  • ES query API
    • using / Using the ES query API

F

  • features, Couchbase Server
    • schemaless / Why do we need NoSQL?
    • JSON-based document structure / Why do we need NoSQL?
    • built-in clustering, with replication / Why do we need NoSQL?
    • 365 days availability / Why do we need NoSQL?
    • cache / Why do we need NoSQL?
    • Web UI / Why do we need NoSQL?
    • varieties of SDK / Why do we need NoSQL?
  • full text search
    • overview / Full text search overview

G

  • geospatial views
    • about / Understanding geospatial views
  • get() method / Order
  • getAndLock() method / Get with Lock (GETL)

H

  • Hard Disk Drive (HDD) / Cluster design

I

  • indexes
    • about / Indexes
    • creating / Indexing properties
    • query, explaining / Explaining a query
  • insert method signatures
    • D insert(D document) / Insert
    • D insert(D document, long timeout, TimeUnit timeUnit) / Insert
  • internals, Couchbase
    • about / Understanding some internals of Couchbase
    • ejection / Ejection
    • warmup / Warmup
    • replication / Replication
    • rebalancing / Rebalancing

J

  • Java API
    • used, for accessing views / Accessing a view using Java API
  • Java APIs
    • used, for querying ES / An API to connect to ES
  • Java Reactive programming APIs
    • URL / async operations
  • Java SDK
    • about / Understanding Java SDK
    • CRUD operations, using / CRUD operations using the Java SDK
  • JSON
    • about / Understanding JSON and non JSON data

K

  • key / Delete
  • keys / Understanding JSON and non JSON data

L

  • Lazy Deletion / Keys and metadata
  • locking
    • about / Understanding locking
    • pessimistic / Understanding locking
    • optimistic / Understanding locking
    • Lock (GETL) / Get with Lock (GETL)
    • CAS / CAS
  • Log tab / Log

M

  • map() function / async operations
  • map function / The views editor
  • MapReduce
    • overview / An overview of MapReduce
    • Map program / An overview of MapReduce
    • Reduce program / An overview of MapReduce
    • SQL, mapping to / Mapping with SQL to MapReduce
  • Maven
    • about / Understanding read operation in the Couchbase cluster
    • URL / Understanding read operation in the Couchbase cluster
  • Maven project
    • implementing, for CRUD operations with Java SDK / Implementation – a Maven project for CRUD operations using the Java SDK
    • URL / Implementation – a Maven project for CRUD operations using the Java SDK
  • Memcached
    • about / Memcached
    • URL / Memcached
  • metadata, types
    • rev / Keys and metadata
    • expiration / Keys and metadata
    • flags / Keys and metadata

N

  • N1QL
    • overview / The N1QL overview
    • installing / Installing and configuring N1QL
    • configuring / Installing and configuring N1QL
    • query engine / The N1QL query engine
    • syntax / Understanding N1QL syntax
  • N1QL API
    • using / Using the N1QL API
  • N1QL DP3
    • URL / Installing and configuring N1QL
    • operation types / Operation types
  • N1QL DP3, features
    • Select / Operation types
    • Filter / Operation types
    • Aggregate / Operation types
    • Having / Operation types
    • Order / Operation types
    • Skip / Operation types
    • Join / Operation types
  • N1QL syntax
    • about / Understanding N1QL syntax
    • JOIN clause / Join
    • cross-bucket joins / Cross-bucket joins
    • conditional expressions and operators / Query conditions and expressions
    • sorting / Sorting and grouping
    • grouping / Sorting and grouping
  • node
    • adding, to cluster / Adding and removing a node from the cluster
    • removing, from cluster / Adding and removing a node from the cluster
  • non JSON data
    • about / Understanding JSON and non JSON data
  • NoSQL
    • importance / What is NoSQL and why do we need it?
    • URL / So what is NoSQL?
    • about / So what is NoSQL?, Why do we need NoSQL?
    • features / So what is NoSQL?
    • Key-value store / So what is NoSQL?
    • Column family store / So what is NoSQL?
    • Graph store / So what is NoSQL?
    • Document store / So what is NoSQL?
    • benefits / Why do we need NoSQL?
    • consistency / Why do we need NoSQL?
    • availability / Why do we need NoSQL?
    • partition tolerance / Why do we need NoSQL?

O

  • observe method / Delete
  • ongoing replications
    • monitoring / Monitoring ongoing replications
  • operators
    • = / Query conditions and expressions
    • > / Query conditions and expressions
    • < / Query conditions and expressions
    • != / Query conditions and expressions
    • >= / Query conditions and expressions
    • COUNT(expr) / Query conditions and expressions
    • AVG(expr) / Query conditions and expressions
    • MIN(expr) / Query conditions and expressions
    • CASE | WHEN | THEN | ELSE | END / Query conditions and expressions
    • ARRAY_AGG(expr) / Query conditions and expressions
    • IS MISSING / Query conditions and expressions
    • IS NOT / Query conditions and expressions
  • order information, conceptual model
    • representing / Order

Q

  • queries, e-commerce application
    • products for category, obtaining / Getting all products for a category
    • orders for particular customer, obtaining / Getting all orders for a particular customer
    • cart for customer, obtaining / Getting the cart for a customer
  • query engine, N1QL / The N1QL query engine

R

  • RDBMS
    • versus document / Document versus RDBMS
  • read method signatures
    • D get(D document) / Read
    • D get(D document, long timeout, TimeUnit timeUnit) / Read
    • JsonDocument get(String id) / Read
  • read operation
    • in Couchbase cluster / Understanding read operation in the Couchbase cluster
  • read operations
    • get (key) / Read
  • rebalancing / The need for the Couchbase administrative interface, Rebalancing
  • rebalancing process
    • about / Rebalancing
  • reduce method / An overview of MapReduce
  • Relational Database Management Systems (RDBMS) / What is NoSQL and why do we need it?
  • replication
    • about / Replication
    • servers settings / Server settings
    • bucket settings / Bucket settings
  • Replication Queue / Understanding the XDCR architecture

S

  • Serial Advanced Technology Attachment (SATA) / Cluster design
  • servers
    • about / Buckets and servers
  • Settings option , Cluster tab / Settings
  • Software Development Kit (SDK) / The need for the Couchbase administrative interface
  • SQL, mapping to MapReduce
    • about / Mapping with SQL to MapReduce
    • select conditions / Select and where conditions
    • where conditions / Select and where conditions
    • order by clause / Order by
    • group by clause / Group by
  • stale parameters
    • about / Understanding stale parameters
    • update_after value / Understanding stale parameters
    • ok value / Understanding stale parameters
    • false value / Understanding stale parameters

T

  • TAP protocol / Rebalancing
  • topologies, XDCR
    • unidirectional / Unidirectional
    • bidirectional / Bidirectional
  • touch method signatures
    • about / Touch
    • Boolean touch(D document) / Touch
    • Boolean touch(String id, int expiry) / Touch

U

  • universally unique identifier (UUID) / Order
  • update method signatures
    • D replace(D document / Update
    • D replace(D document) / Update
    • D replace(D document, long timeout, TimeUnit timeUnit) / Update
  • update operations
    • in Couchbase cluster / Understanding update operations in the Couchbase cluster
    • replace (key, value) / Update
    • cas (key, value, cas) / Update
  • Upsert method signatures
    • D upsert(D document) / Upsert
    • D upsert(D document, long timeout, TimeUnit timeUnit) / Upsert
  • use cases, XDCR / XDCR use cases

V

  • 3Vs
    • varieties / An overview of MapReduce
    • volume / An overview of MapReduce
    • velocity / An overview of MapReduce
  • value / Delete
  • variables, for sizing calculation
    • documents_num / Sizing
    • ID_size / Sizing
    • value_size / Sizing
    • number_of_replicas / Sizing
    • working_set_percentage / Sizing
    • per_node_ram_quota / Sizing
  • vBucket
    • about / vBuckets
  • View Engine / Views
  • views
    • about / Views
    • defining / Views
    • types / Types of views
    • development view / Development
    • production view / Production
    • life cycle / A view's life cycle
    • creating / A view's life cycle
    • editor / The views editor
    • accessing, with Java API / Accessing a view using Java API
    • writing guidance / View writing guidance
  • Views function / Views

W

  • warmup / Warmup
  • web admin UI
    • about / The web admin UI
    • functionalities / The web admin UI

X

  • XDCR
    • architecture / Understanding the XDCR architecture
    • configuring / Configuration and monitoring
    • monitoring / Configuration and monitoring
    • CAPI-mode XDCR / CAPI-mode XDCR
    • XMEM-mode XDCR / XMEM-mode XDCR
    • use cases / XDCR use cases
    • topologies / XDCR topologies
    • impact / XDCR impact
  • XDCR architecture
    • intracluster replication / Understanding the XDCR architecture
    • intercluster replication / Understanding the XDCR architecture
    • about / Understanding the XDCR architecture
    • active-active conflict resolution / Active-active conflict resolution
  • XDCR Queue / Understanding the XDCR architecture
  • XDCR section
    • using / XDCR
  • XDCR topologies
    • about / XDCR topologies
    • unidirectional / Unidirectional
    • bidirectional / Bidirectional