Performance Data for secondary Index
I was wondering how scalable the secondary Index is. I have a json doc which has
has as part of its structure a array of tag elements which store userid and name
of the user who was tagged like
Taggs
userid: 1, name: "Frank",
userid: 2, name: "Steve"
taggs
ignore the format its just to give id, so here is my question's
a) how do i access these tagg data ? doc.taggs.userid ?
b) lets assume i build a view what is the expected performance if i have like 10 million docs and
each doc can have between 1 and 1000 tagg's ? And how far will it scale ?
c )my query needs to find all taggs for a given user, would it be better to store all taggs for one user
in a separate doc and keep the docs in sync or is there a way to avoid this and still get a good response
time ?
Any ideas and pointers would be great
Thanks
Hello,
Secondary Index is still very fast for the following reason:
- All the data are distributed on all nodes of your cluster, and the index are also distributed (indexes of a document are located at the same place)
- The index is when the document is "added" , see http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writi...
- When you query the view the query is distributed on all the nodes of the cluster to navigate into the index
You can find some interesting chapter in the documentation:
- Chapter 9. Views and Indexes : http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views.html
- Appendix D. Troubleshooting Views : http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-troub...
Regards
Tug
Tug
@tgrall