1

Sometimes, you need to access a certain document (A), but you do not know the key for that document (A), as that data is stored in a different document (B). So now, if you want to fetch A, it looks like the following:

fetch B
parse B
get name of A
fetch A

Now, obviously, this doesn't look too bad, but after three or four levels of recursion, especially once you have larger documents (100 KB+), this can become a performance issue:

fetch A (10K)
parse A
fetch B (100K)
parse B
still parsing B
fetch C (1M)
waiting for C
parse C
still parsing C
and still parsing C
fetch D (1K)

How can I reduce the amout of recursion required in a scenario like this? I mean, obviously, I could rewrite the documents, but if that is not an option, what exactly can I do?

My documents are all JSON documents; does Couchbase have some sort of feature to fetch documents recursively for me?

  • 4
    No offence to couchbase but if it can't do - efficiently - a simple 4-table join, you should consider using a boring old SQL product. – ypercubeᵀᴹ Jun 9 '14 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.