Hi there, I’ve been trying to learn couchbase but most of the available resources are essentially theory or overviews, and practical resources appear to be non-existent.
I’m working with 2 collections, one with 480K documents and the other has 1.5M. Server performance is about 38Kops/s. Primary indexes created for each collection.
To simplify the picture, lets say its an ecommerce site and each of the docs are skus with product data. There’s a field within each document that holds a category code, and I’m simply trying to query how many documents there are whos category code start with 3 particular digits for example. The issue im having is that the query (select count(sku) from a.b.c where substr(catcode,0,3) == 001
) takes 13.7s, and there are 30 different categories that i need to fetch the same count for.
Trying to display a category tree with a count of how many skus are in each but processing time is too great.
Now, it appears that views can assist with this by basically caching and updating the result im looking for in this particular scenario. I see and understand how views can help, but i cannot find step by step instructions on how to create and test the view. I tried what i thought would work, basically the default map returning the meta.id and doc.catcode but it shows no results.
What are the best resources out there for learning how to do this from a practical standpoint? Something with before and after results, and the actual steps in between?
I’m totally ok with paying for courses to learn what i’m trying to do. I’ve learned that a few hours of learning can save dozens and dozens. So i’d like to know what the best resources are out there, and if you can help me over this little hurdle feel free to enlighten.
Thanks!