How can we improve Azure Cosmos DB?

Support cross-document joins

I have a many-to-many scenario that requires something like document-to-document joins.

In my app, users can "like" posts. That's three "tables" or entity sets. One each for users, likes and posts. I can't put the likes inside of either the users or the posts entities as sub-documents because there could be thousands of them. Even with 256KB documents I'd run out of room pretty quickly. I need a way to quickly get the top 100 posts that a user liked (and continue to paginate from there). I also need to go the other way. I need to get all the users who liked a particular post. Again, I need to show the top 100 users and continue to paginate from there.

Both of those scenarios require some kind of document-to-document join.

A cross-collection join would also be handy but I think I could survive without it for now.

1,481 votes
Vote
Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
You have left! (?) (thinking…)
che shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

For applications that require cross document join, please consider the Gremlin API: https://docs.microsoft.com/en-us/azure/cosmos-db/create-graph-dotnet, which has primitives for joins, traversals, and other graph operations.

We are evaluating expanding the SQL grammar to support graph functionality, which will provide the ability to perform cross-document JOINs. Please upvote this item to help us prioritize this work.

25 comments

Sign in
(thinking…)
Sign in with: Microsoft
Signed in as (Sign out)
Submitting...
← Previous 1

Feedback and Knowledge Base