I’m considering using CouchBase for a very read heavy and write heavy application. I’ll also need to support searching based on different attributes of the documents as well as range queries.
CouchBase has views to allow searching beyond key value searches but it seems like this is mainly to get documents within a certain range, eg. get all documents indexed between two specified keys, rather than “give me all documents that have the genre attribute to ‘adventure'” or “give me all documents that have creation date between 1/1/1 and 2/1/1”
Is there a way to achieve what I want without an external index?
You can definitely do both of what you describe there. You’d do both with views in Couchbase Server 2.0.
For example, a common technique when needing to search a date range is to emit a JSON array from your map function in the view. This would give you something like:
[2012, 5, 11, 16, 27, 41]
Since when you query a view, a JSON array is a valid place for start key and end key, you can specify that range.
Similarly, extracting all of the attributes you’d emit each one of them from your map function with the doc _id. Then using one of the Couchbase SDKs, you can set the include docs option when querying and the doc will be automatically fetched.