Skip to content

[spec] Aggregate queries #1

@GertSallaerts

Description

@GertSallaerts

To allow for more efficient cross-service queries, it would help if AQL provided some way to aggregate results.

Say, you have two micro-services in a social media platform. One of them stores your users. The other stores posts. You would like to ask the user service for a list of users who have commented on post A.

So you construct an AQL query and send it to the user service. In the current AQL spec, the user service would have to request all comments of post A and then start extracting a list on unique user-id's from the comments. With this list it can create a filter on its own datastore saying it only wants people who's ID is in the list of commenters.

The problem here is that one person can leave multiple comments. What follows is that a lot of redundant data is communicated between both services. It might also mean lots of extra requests if paging is involved.

If however, the AQL query allowed you to specify that you only wanted a list of unique comment.authorId values that match your query (comments on post A). The resulting data-flow could be significantly smaller.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions