Couchbase Models

This *unofficial* site is dedicated to sharing mental strategies, design patterns, and model samples in Couchbase.

Learning any new technology requires learning how to think in that technology. This site is dedicated to building that mental model of how things work, using patterns for your structure, and learn modeling by example.

About Couchbase » About this Site »


Simple Model

This strategy describes a basic mapping of instance variables to a Couchbase document in a direct relationship.

View Details »

Complex Model

This strategy describes mapping of instance variables and collections to multiple Couchbase documents.

View details »


This strategy describes a mental model for how to think about modeling when transitioning from SQL to NoSQL with Couchbase.

View details »

Key-Value Patterns


This very common pattern is based on an atomic counter that is used as an index, and a set of documents that uses the index in the key.

View details »


When a single document can be referenced by a number of different ID's, the Lookup pattern is the ideal pattern. Users might have a username, email, FacebookID, and TwitterID, these can all be used to find and retrieve a user without the need for Views.

View details »

Auto Versioning

This pattern abstracts write operations through a common method to enable easy auto-versioning of individual keys. This can be useful if you want a document archive on particular keys.

View details »

Model Samples

Activity Stream

You can use this simple model to create a site based stream of activities taken by users in your application or game, when you need it tailored to individual users or their graph, you can take this model and personalize it into a stream based on each user.

View details »

Product Catalog

If you are modeling a product catalog, whether it's real or virtual goods, you can start with this simple model and grow the model based on additional complexity required.

View details »