CD210 Couchbase NoSQL Data Modeling, Querying, and Tuning Using N1QL

CD210 Couchbase NoSQL Data Modeling, Querying, and Tuning Using N1QL


A 3-day hands-on lab-intensive course on architecture and design of NoSQL data using N1QL. Instruction and exercises are focused on data modeling, query, storage and access for robust, scalable, high-performance NoSQL applications. Topics include: the N1QL query language (SQL for JSON), data modeling for NoSQL applications, indexes and views, and methods of application performance tuning for principal use cases. See Customer testimonials


Through conceptual presentation, demonstration and extensive hands­-on labs and exercises, this 3-day instructor-­led course guides developers, architects and DBA's on storing and accessing data rapidly and at web scale, in diverse document-database use cases based on JSON, using Couchbase Server, N1QL, and related technologies. All labs rely on queries in N1QL without dependency on any particular application programming language. The course is aimed at developers, architects, analysts, SQL and Oracle Developers, DBAs, data warehouse and business intelligence admins and analysts, and DevOps professionals.

The hands-on labs (usually 60% of class time) get you real-world "flight-time" modeling NoSQL data using best practices for JSON and key/value, creating and exploiting secondary indexes, performing complex aggregations using map-reduce Views, and becoming capable with N1QL as a basis for developing powerful, scalable, and reliable applications using NoSQL data, in any programming language.


3 Days


The course is geared to produce effective NoSQL data modeling, storage, querying, and performance tuning competency in experienced software application developers and other technical professionals who may be either newbies to data-driven apps, or already experienced with SQL and modern databases from prior data application development projects.


This course is intended for application developers, architects, software engineers, database administrators, data warehouse managers, business intelligence analysts, data engineers, and DevOps professionals with experience in any software development or scripting language. Oracle and other SQL application developers will find N1QL very easy to grasp by analogy to SQL. Those without prior SQL or RDBMS context will also find N1QL and NoSQL easy to comprehend and develop for.


The course is designed for application developers and data architects seeking to leverage Couchbase Server for database, KV, data store and/or document database applications and use-cases. No specific programming language expertise is required or assumed. Success in the hands-on labs will be assured for participants who bring prior experience writing software or scripting in ANY modern language, for example, Java, C#/.Net, Node.js, Go, Python, C/C++, Ruby, PHP, etc. Familiarity with basic programming fundamentals and database concepts is assumed, but no prior experience with NoSQL databases (or with SQL datbases) is required. We strongly suggest Participants complete the following Couchbase online courses prior to class: CB030, and CB105, and CB110.


Partial list of concepts, topics and hands-on labs. Subject to change and update without prior notice. Course includes: 

Module 00 – Welcome to the Course
Module 01 - Introduction to NoSQL
Modern Application Challenges
Growth of Digital Data
Why Not Use a Relational Database?
What is Big Data?
Common Strategies for Handling Big Data
ACID Properties in Relational Databases
The CAP Theorem
Hadoop and NoSQL
Types of NoSQL
Polyglot Programming
LABS: 6 hands-on labs
Module 02 - Introduction to Couchbase
History of Couchbase Server
NoSQL and Couchbase Server
What is Couchbase Server?
JavaScript Object Notation
Couchbase as Key-Value Store vs. Document Store
Storage of Data in Couchbase Server
Couchbase Server Architecture
What is a Couchbase Document?
Anatomy of a Couchbase Application
Read, Write and Update Operations with Couchbase
Cache Miss
The Couchbase “write path”
Scaling with Couchbase
MDS Architecture
Tools to Integrate with Couchbase
Module 03 – N1QL Essentials [4 labs]
JavaScript Object Notation
Json As Database Storage Format
Relational Model Vs. JSON
What is N1QL?
Goals of N1QL
Who Uses N1QL
Query Workbench
Key features of N1QL
Querying with N1QL
Querying Nested Elements
Document Meta-Data
Performing Simple Arithmetic
Filtering Documents
Pattern Matching
Matching Elements in Nested Arrays with ANY
Querying Using Document Keys
Sorting, Ordering and Grouping
Getting System Information
            Querying Datastores
            Querying Namespaces
            Querying Keyspaces
            Querying Indexes
Array, Objects and Array of Objects
Collection Operators
Functions in N1QL
            ARRAY_APPEND(expression, value, ...)
            ARRAY_INTERSECT(expression1, expression2, ...)
            DATE_ADD_MILLIS(date1, n, part)
            Other Date Functions
            Pattern-Matching Functions
            Token Functions
            String Functions
Join Documents from a Key Array
Data Manipulation Statements
Module 04 – Indexes in N1QL [4 labs + 2 optional labs]
Index Options
            Primary Index
            Named Primary Index
            Secondary Index
            Secondary Composite Index
            Functional Index
            Array Index
            Partial Index
            Covering Index
            Duplicate Index
Intersect Scans in N1QL
Bucket Analysis
The INFER command
Indexing Architectures
GSI Vs. Views
Module 05 – Query Engine [OPTIONAL]
Query Execution
Client to Query Service: REST API
The Parse Phase
Plan Phase
Scan Phase
Fetch Phase
Aggregate, Sort, Offset, Limit
Project Phase
Covered and Non-Covered Indexes
Capacity Management of Query Node
LABS: 2 hands-on labs
Module 06 - Query Planning and Tuning [1 lab]
Query Planning
Data Source Access Methods
Index Selection
Index Scans – Covering and Regular Index Scans
Index Scans – CountScan and IndexCountScan
Index Scans – ValueScan and DummyScan
Pushdowns - Predicates
Pushdowns - Order
Pushdowns - Limit
Pushdowns - Offset
Query Tuning in N1QL
Query Tuning Checklist
Module 07: N1QL Performance Tricks and Other Tools [3 labs + 1 optional lab]
Pretty – Query Setting
UPDATE Nested Arrays
cURL in N1QL
Module 08 – Introduction to Data Modeling
What is Data Modeling?
Data Modeling for Distributed Systems
Data Modeling for Couchbase Server
Conceptual Data Modeling
Logical Data Modeling
Physical Data Modeling
Data Models Used In The Course
Module 09 – Data Modeling for Couchbase Server [exercise by the instructor]
What is Data Modeling?
Data Modeling for Distributed Systems
Data Modeling for Couchbase Server
Conceptual Data Modeling
Logical Data Modeling
Physical Data Modeling
JSON Document Design
JSON Design Choices
Single Root Attributes
Objects vs. Arrays
Array Element Types
Timestamp Formats
Property Names
Empty and Null Property Values
JSON Schema
Data Nesting (aka Denormalization)
Key Design
Lookup Key Pattern
Making Trade-offs
Making tough choices: Document Size, Atomicity, Complexity, Speed
Embed vs. Refer
Module 10 – Query Monitoring and Troubleshooting [1 lab]
What is Query Monitoring?
REST API Endpoints in N1QL
REST: active requests
REST: completed requests
REST: prepared statements
REST: cache configuration
SYSTEM Namespaces and N1QL Query Monitoring
Using N1QL Monitoring for Problem Resolution
Prepared Statements With Highest Execution Time
Prepared Statements With Highest Prepare Counts
Non-Prepared Statements With Highest Execution Times/Counts
Plans Using Sub-Optimal Indexes
Cancelling unruly requests
Module 11 – View Essentials [OPTIONAL] [1 lab]
What is a View?
Design Documents
Working with Views in the Couchbase web console
Create Development View
Writing Map Functions
The emit Function
Writing Reduce Functions
Built-in Reduce Functions
View group and group_level
Emitting Multiple Rows from the Map Function
Emitting Array Keys
View Use Cases
View vs. N1QL
lab-09-tokens-detailed [optional]
lab-10-n1ql-twitter [optional]
lab-15-cbq [optional]
lab-17-view-essentials [optional]

Note: The above listed topics, labs, and all other content of this course are subject to change and/or update without prior notice from time to time, as we optimize our hands-on training for guaranteed customer success.

Upcoming Classes


Location Sep 2018 Oct 2018 Nov 2018 Dec 2018 Jan 2019
Milan - Piazzale Antonio Cantore - Italy Sep 24 – Sep 26

Classes in bold are guaranteed to run!


Location Sep 2018 Oct 2018 Nov 2018 Dec 2018 Jan 2019
Paris - rue de Milan FRANCE Oct 2 – Oct 4
Paris - avenue de l'Opéra - FRANCE Nov 21 – Nov 23

Classes in bold are guaranteed to run!


Location Sep 2018 Oct 2018 Nov 2018 Dec 2018 Jan 2019
Madrid – Retiro – SPAIN Oct 8 – Oct 11
Barcelona - SPAIN Oct 8 – Oct 11

Classes in bold are guaranteed to run!

United States

Location Sep 2018 Oct 2018 Nov 2018 Dec 2018 Jan 2019
Dallas TX - Lincoln Center Oct 16 – Oct 18
Boston MA - Burlington Rte 128 Oct 16 – Oct 18
Washington DC - Herndon Oct 16 – Oct 18
New York - Broad St Oct 16 – Oct 18
Chicago - Downtown Loop M Oct 16 – Oct 18

Classes in bold are guaranteed to run!


Instructor-led online training

Location Sep 2018 Oct 2018 Nov 2018 Dec 2018 Jan 2019
VIRTUAL Class - Pacific / Mountain Time Oct 16 – Oct 18
VIRTUAL Class - Eastern / Central Time Oct 16 – Oct 18

Classes in bold are guaranteed to run!

Onsite Training

For groups of three or more

Request Quote

Public Training

Milano, Milano

Paris, Ile-de-France



Dallas, TX

VIRTUAL Class - Pacific / Mountain Time

Burlington, MA

Herndon, VA

New York, NY

Chicago, il

VIRTUAL Class - Eastern / Central Time


Classes marked with Confirmed are guaranteed to run. Sign up now while there is still space available!

Don't see a date that works for you?

Request Class