Search:

Search all manuals
Search this manual
Manual
Couchbase Developer's Guide 1.8
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Chapters

Couchbase Developer's Guide 1.8

Copyright © 2010-2013 Couchbase, Inc. Contact copyright@couchbase.com.

For documentation license information, see Documentation License. For all license information, see Licenses.

Abstract

This manual provides information on how to build applications using Couchbase Server 1.8. The guide is designed to be used in conjunction with the language-specific guide for your chosen SDK.

Note.  The following document is still in production, and is not considered complete or exhaustive.

Last document update: 07 Mar 2013 00:06; Document built: 18 Jun 2013 23:04.

Documentation Availability and Formats.  This documentation is available for download: HTML Zip, PDF, EPUB . For other documentation from Couchbase, see Couchbase Documentation Library

Contact: editors@couchbase.com or couchbase.com


Table of Contents

Preface
1. Manual Conventions
2. Contributors
1. Introduction to Couchbase
1.1. Understanding Couchbase Concepts
1.1.1. Data Buckets
1.1.2. Keys and Metadata
1.1.3. Couchbase SDKs
1.1.4. Nodes and Clusters
1.1.5. Information about the Cluster
1.2. Comparing Couchbase and Traditional RDMS
1.3. Support for Memcached Protocol
1.4. Server Rebalancing
1.5. Server Failover
1.6. Applications on Couchbase Server
2. Using Couchbase SDKs
2.1. Comparing Couchbase SDKs and SQL Commands
2.2. Core Couchbase Operations
2.3. About TTLs
2.4. About Asynchronous Methods
2.5. Storing Information
2.5.1. Set
2.5.2. Add
2.6. Retrieving Information
2.6.1. Get
2.6.2. Retrieving Multiple Keys
2.6.3. Get and Touch
2.7. Retrieving Items with CAS Values
2.8. Locking Items
2.9. Updating Information
2.9.1. Touch
2.9.2. Replace
2.9.3. Check and Set (CAS)
2.9.4. Appending and Pre-pending
2.9.5. Incrementing and Decrementing
2.10. Deleting Information
2.11. Permanently Destroying Data
3. Creating Your First Application
3.1. Setting Up the Development Environment
3.2. Connecting to Couchbase Server
3.2.1. Create Your First Bucket
3.2.2. Connecting with a Client
3.2.3. Authenticating a Client
3.3. Performing Connect, Set and Get
3.4. Performing Basic Telnet Operations
4. Storing Data
4.1. About Keys, Values and Meta-data
4.1.1. Specifying Keys
4.1.2. Specifying Values
4.1.3. More on Metadata
4.1.4. Understanding Expiration
4.2. Writing JSON Documents to Couchbase
4.3. Loading Data
4.4. About Data Buckets
4.5. About Sharding Data
4.6. Creating and Managing Buckets
4.7. Partitioning Data with Buckets
5. Structuring Data
5.1. Comparing Document-Oriented and Relational Data
5.2. Using JSON Documents
5.3. Schema-less Data Modeling
5.4. Document Design Considerations
5.5. Using Reference Documents for Lookups
5.6. Sample Storage Documents
6. Advanced Topics in Development
6.1. Handling Temporary Out of Memory Errors
6.2. Synchronous and Asynchronous Transactions
6.3. Providing Transactional Logic
6.3.1. Using a 'Lease-Out' Pattern
6.3.2. Performing Two-Phase Commits
6.3.3. Getting and Locking
6.4. Improving Application Performance
6.4.1. Performing Cluster Sizing
6.4.2. Improving Document Access
6.4.3. Using the Fastest Methods
6.4.4. Optimizing Client Instances
6.4.5. Maintaining Persistent Connections with Couchbase
6.5. Thread-Safety for Couchbase SDKs
6.6. Handling Common Errors
6.6.1. Client-Side Timeouts
6.7. Troubleshooting
6.7.1. Configuring Logs
6.7.2. Backups and Restores
6.7.3. Handling Failover
7. Developing a Client Library
7.1. Providing SASL Authentication
7.1.1. List Mechanisms
7.1.2. Making an Authentication Request
7.2. Handling REST/JSON
7.2.1. Parsing the JSON
7.2.2. Handling vBucketMap Information
7.2.3. Encoding the vBucketId
7.2.4. Handling Rebalances in Your Client Library
7.2.5. Fast Forward Map
7.2.6. Redundancy & Availability
7.3. Couchbase Protocol Extensions
A. Licenses
A.1. Documentation License
A.2. Couchbase, Inc. Community Edition License Agreement
A.3. Couchbase, Inc. Enterprise License Agreement: Free Edition

List of Figures

1.1. Couchbase SDK to Server Communications
2.1. Creating Items with Set
2.2. Using Add for Unique Items
2.3. Using Get for Properties
2.4. Using Multiple-retrieve to Aggregate Scores
2.5. Using Get-and-Touch to Retrieve Mode
2.6. Using Get-with-Cas to Determine Next Actions
2.7. Using Get-and-Lock to Reserve Inventory
2.8. Using Touch to See if Key Exists
2.9. Create Key after Touch
2.10. Using Replace to Determine Offer Status
2.11. Make Offer After Replace
2.12. Getting Current CAS Value
2.13. Updating with Correct CAS Value
2.14. Using Append and Prepend for Binary Values
2.15. Append and Prepend Updates to Item
2.16. Using Incr for Unique User Ids
5.1. Conventional RDMS Table and Document-based Information
5.2. Data Normalization in Traditional RDBMS
5.3. Data Normalization in Traditional RDBMS
5.4. Tracking User Count
5.5. Adding New User Document
5.6. Adding Supporting Documents for Lookups
5.7. User Lookup by Email
6.1. Ticketing System
6.2. Ticket Document Updates
6.3. Couchbase SDK Two-Phase Commit
6.4. Couchbase SDK Rollback for Transactions

List of Tables

2.1. SQL Commands/Couchbase Commands
6.1. Available Timeouts for Java Connections
6.2. Available Timeouts for .Net Connections
6.3. Available Timeouts for Ruby Connections