Couchbase: is it better to retrieve a list object or each object individually?

余生颓废 提交于 2019-12-13 05:13:47

问题


I'm currently using couchbase for quick and distributed access of data. I have Community objects being stored by the keys "comm-{index}" where {index} is the key index for a given community object (i.e. comm-1 stores object 1, comm-2 stores object 2 a so on).

I need to retrieve a list containing all of the Community objects, and I wonder: would it be better (faster) to do a GET of every object one by one and add it to a list, or otherwise, storing a List object identified by a key, and retrieve the whole list object in one GET?

I'm unsure if because of couchbase's distributed nature and limited size for objects, it would be faster or just equally fast to retrieve every object individually (such as many couchbase examples do).


回答1:


Couchbase 2.0 will support Map/Reduce powered views, which allows you to write map function which will filter out all the keys you need and then build incremental index



来源:https://stackoverflow.com/questions/10077131/couchbase-is-it-better-to-retrieve-a-list-object-or-each-object-individually

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!