CD220 Developing Couchbase NoSQL Applications


This course provides 3 days of progressive hands-on flight time building a working NoSQL web application in Java/RxJava. With a mix of instruction, demos and intensive programming labs, participants develop an actual Couchbase NoSQL app that reflects typical use-cases for scalable NoSQL databases operating across the cloud.  Download course description. 
What customers say about CD220: Customer testimonials


Use of an engaging real-world data model and codebase enables a practical approach to NoSQL application development in Java EE libraries. The course leverages the Couchbase Client Java SDK, Gson/JSON, and the CrudRepository<T> pattern. We start with a high level perspective on NoSQL applications, Couchbase Server, installing, and starting Couchbase Server; basic administration overview. From there, each lab exercise builds progressive skills in developing NoSQL applications that take advantage of Couchbase Server’s powerful capabilities and benefits. 

Each student will practice and be able to perform all the basic NoSQL application development tasks that are required of a modern web application in the real world. Creating Buckets and usage of View/Index/N1QL, and document oriented data will be gained through more than a dozen lab exercises which challenge the student to build real solutions with this NoSQL technology. 

The client side Java SDK will be used extensively, including but not limited to: The Write Path, The Read Path, add, replace, CAS, set, and get, writing a Bucket utility with ClusterManager, writing a ClientFactory, data modeling with a document database, denormalization, CrudRespositories and Services, and View API with index creation and use. 

The course will include use of the Couchbase Query Language: N1QL, and an introduction to Couchbase Full Text (CBFT) search. Students will learn the top ten current developer issues and best practices.


3 Days


This is hands-on developer training for people who want to get real work done with NoSQL database applications, working with Couchbase Server and our Java SDK. While all labs are based on Java and RxJava, the concepts, techniques and methods are applicable to any of the available SDKs (.NET, PHP, Ruby, Python, C, Node.js). Expect to spend more time writing solutions and less time watching a presentation. If you have a background in programming, want to write software and are technically savvy this is the right course for you.


The concepts in the course can be learned by experienced Java developers, and others familiar with Java who may prefer to develop in C/C++, C#/.Net, or Python, Ruby, PHP, etc. All labs are in Java and the course presumes adequate Java programming skills. Participants should gain some background in rxjava, reactive programming in java, before arrival in class (see Additional Notes). Familiarity with programming fundamentals and database essentials is assumed. Some find it helpful to view the Couchbase Training Webinars (Couchbase 101,102,103,104,105) before start of class, but these are optional. We strongly suggest Participants complete the following Couchbase online courses prior to class: CB030 and CB110.

Additional Notes

Preparation in advance of class: participants are strongly advised to review and learn about ReactiveX extensions to Java, otherwise known as rxjava. The reactive controls for java consist of a library for composing asynchronous and event-based programs using observable sequences for the java vm. Links to resources are provided at:

Participation during class: since the class covers concepts at a rapid pace and because lab assignments are additive and progressive, it is important for students to devote their full attention to the training. If students miss one of the earlier labs or fail to complete it this may prevent or reduce ability to complete subsequent labs.


A partial list of concepts, topics and labs - all are subject to changes and updates without prior notice, from time to time. 

Topics and Labs may include:

1. Introduction to Couchbase Server
1.1. Couchbase Server Ecosystem
1.2. How are analytical and operational uses different?
1.3. Where would Couchbase fit into an enterprise app?
1.4. What does Couchbase provide?
1.5. Couchbase Server Core Principles
1.6. Couchbase Server 4.0 Architecture
1.7. Anatomy of a Couchbase Application
1.8. How is data organized?
1.9. Architectural structures in Couchbase
1.10. Cluster Manager 
1.11. Node Manager 
1.12. Introduction to Multi-Dimensional Scalability (MDS)
1.13. Buckets
1.14. Couchbase Operations
1.15. Single node - Couchbase Write Operation
1.16. Single node - Couchbase Update Operation
1.17. Single node - Couchbase Read Operation
1.18. Single node - Couchbase Cache Eviction
1.19. Single node – Couchbase Cache Miss
1.20. Using the Couchbase Web Console
1.21. N1QL Overview
1.22. How is a query processed?
1.23. Introduction to Couchbase Query Wrokbench
1.24. Cross Data Center Replication (XDCR)
1.25. Couchbase Java SDK 2.4 Overview
1.26. Introducing the CouchMusic Application
1.27. Bulk Loading JSON Documents with cbdocloader

2. Couchbase Java SDK Synchronous API
2.1. The Couchbase Java SDK
2.2. The Cluster Interface
2.3. Cluster Methods
2.4. The ClusterManager Interface
2.5. ClusterManager Methods
2.6. The Bucket Interface
2.7. Bucket Methods
2.8. The Document<T> Interface
2.9. Document Methods
2.10. JsonObject, JsonDocument
2.11. CRUD Operation with Couchbase Synchronous APIs
2.12. CAS
2.13. The Sub-Document API (new in Couchbase 4.5)

3. N1QL Essentials

3.1. Selecting documents and limiting results 
3.2. Aliasing, un-nesting, and concatenating values
3.3. Selecting by key or value, and accessing document metadata
3.4. Creating and using secondary indexes, and using filters
3.5. Querying ranges, ordering results, and explaining queries
3.6. Verifying index availability, counting values, and selecting distinct results
3.7. Selecting for missing attributes, and grouping results by attributes
3.8. Operating on collections
3.9. Using functions in queries
3.10. Joining documents
3.11. Cover Indexes
3.12. Array Indexing in Couchbase 4.5
3.13. Working with Couchbase Workbench

4. Data Modeling for Couchbase Server
4.1. What is Data Modeling?
4.2. Data Modeling for Distributed Systems
4.3. Data Modeling for Couchbase Server
4.4. Conceptual Data Modeling
4.5. Logical Data Modeling
4.6. Physical Data Modeling
4.7. JSON Document Design
4.8. JSON Design Choices
4.9. Single Root Attributes
4.10. Objects vs. Arrays
4.11. Array Element Types
4.12. Timestamp Formats
4.13. Property Names
4.14. Empty and Null Property Values
4.15. JSON Schema
4.16. Data Nesting (aka Denormalization)
4.17. Key Design
4.18. Lookup Key Pattern
4.19. Making Trade-offs
4.20. Making tough choices: Document Size, Atomicity, Complexity, Speed
4.21. Embed vs. Refer

5. Executing N1QL Queries in Java
5.1. The query methods of the Bucket interface
5.2. The Query DSL
5.3. Building Queries in Code
5.4. The Statement Interface
5.5. The Select Class
5.6. The Expression Class
5.7. The LetPath Interface
5.8. The N1qlQuery Class
5.9. Processing N1QL Query Results
5.10. The N1qlQueryResult Interface
5.11. The N1qlQueryRow Interface
5.12. The Index Class

6. Asynchronous Programming with the Couchbase Java SDK
6.1. Moore's Law vs. Physical Reality
6.2. What is asynchronous programming?
6.3. Asynchronous Programming on the JVM
6.4. Asynchronous Programming Alternatives
6.5. The Reactive Manifesto
6.6. Functional Programming
6.7. Side Effects
6.8. Why use functional programming?
6.9. Java 8 Lambda Expressions
6.10. Anonymous Class vs Lambda Expression
6.11. Java 8 Method References
6.12. What is RxJava?
6.13. What does RxJava provide?
6.14. Why Couchbase chose RxJava
6.15. RxJava implementation of Observable
6.16. Iterable (pull) vs. Observable (push)
6.17. The rx.Observable Class
6.18. Action Interfaces
6.19. Function Interfaces
6.20. Operators for Creating Observables
6.21. Operators for Transforming Observables
6.22. Operators for Filtering Observables
6.23. Operators for Combining Observables
6.24. Utility Operators
6.25. Conditional and Boolean Operators
6.26. Error Handling Operators
6.27. The RetryBuilder Class
6.28. Mathematical and Aggregate Operators
6.29. The BlockingObservable Class
6.30. Composing Observables
6.31. The AsyncCluster Interface
6.32. The AsyncBucket Interface

7. View Essentials
7.1. What is a View?
7.2. MapReduce
7.3. Design Documents
7.4. Working with Views in the Couchbase web console
7.5. Create Development View
7.6. Writing Map Functions
7.7. The emit Function
7.8. Writing Reduce Functions
7.9. Built-in Reduce Functions
7.10. View group and group_level
7.11. Emitting Multiple Rows from the Map Function
7.12. Emitting Array Keys
7.13. View Use Cases
7.14. View vs. N1QL

8. Executing Views in Java
8.1. The ViewQuery Class
8.2. The Stale Enum
8.3. The query methods of the Bucket Interface
8.4. The ViewResult Interface
8.5. The ViewRow Interface

9. APPENDIX A: Full Text Search in Couchbase with CBFT (OPTIONAL – NO LABS)
9.1. What is fulltext and why should I care?
9.2. What can you do with Fulltext search?
9.3. CBFT Vs. ElasticSearch/SOLR 
9.4. Couchbase Integration
9.5. Full Text Search in Couchbase
9.6. The Java API for CBFT
9.7. SearchQuery 
9.8. MatchQuery 
9.9. SearchQueryResult 
9.10. Various Types of Queries
9.11. Fuzzy Querying
9.12. Multiple Terms: MatchPhrase
9.13. Regexp Query
9.14. Prefix Query
9.15. Range and Date Queries
9.16. Generic Querying

Partial List of Labs:
Lab 1. Configure Couchbase Server in the virtual machine environment
Lab 2. Create a Couchbase Bucket and load it with documents
Lab 3. Implement the setConfig and getBucket methods of the BucketFactory class
Lab 4. Implement the findById method of the JsonRepository class.
Lab 5. Implement the create method of the JsonRepository class. 
Lab 6. Implement the delete method of the JsonRepository class. 
Lab 7. Implement the update and upsert methods of the JsonRepository class.
Lab 8. Modify the methods in the RepositoryHelper class to take advantage of the CAS functionality of the Couchbase Java SDK.
Lab 9. Creating secondary indexes with document attributes
Lab 10. Reviewing execution time of JOIN queries
Lab 11. Reviewing execution time of queries that perform aggregation
Lab 12. Improving execution time of queries for the couchmusic data model
Lab 13. Improving execution time of other queries for couchmusic
Lab 14. Use N1QL to Query the system:indexes Bucket and use the Index class to create a Primary Index
Lab 15. Implementing the findById method of the TrackRepository class
Lab 16. Implementing the search method of the TrackRepository class
Lab 17. Implementing the byIdWithoutTracks method of the PlaylistRepository class
Lab 18. Implementing the byIdWithTracks method of the PlaylistRepository class
Lab 19. Implement the getAsyncBucket method of the BucketFactory class using the openBucket methods of the AsyncCluster interface.
Lab 20. Implement the findById method of the GenericAsyncRepository class
Lab 21. Implement the insert method of the GenericAsyncRepository class
Lab 22. Implement the delete method of the GenericAsyncRepository class
Lab 23. Implement the update and upsert methods of the GenericAsyncRepository class
Lab 24. Implement the findById method of the UserprofileAsyncRepository class

Note: The above listed topics and labs and all 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

Classes in bold are guaranteed to run!


Instructor-led online training

Location Dec 2016 Jan 2017 Feb 2017 Mar 2017 Apr 2017
VIRTUAL Class - EMEA CEST Jan 24 – Jan 26
VIRTUAL Class - Pacific / Mountain Time Mar 7 – Mar 9
United Kingdom
Location Dec 2016 Jan 2017 Feb 2017 Mar 2017 Apr 2017
London - Paul Street - UK Jan 24 – Jan 26
United States
Location Dec 2016 Jan 2017 Feb 2017 Mar 2017 Apr 2017
Seattle/Bellevue-Kirkland Mar 7 – Mar 9
San Francisco-MontgomeryM Mar 7 – Mar 9
Los Angeles - Pacific/LAX - CA Mar 7 – Mar 9
Denver - Downtown Mar 7 – Mar 9

Public Training


London, London

Kirkland, WA

VIRTUAL Class - Pacific / Mountain Time

San Francisco, CA

El Segundo, CA

Denver, CO