Limitations of dynamoDB & GraphQL

0

1. Paginating a query:

When I'm using ModelQuery.list(Todo.class,Todo.DESCRIPTION.contains("hi"), ModelPagination.limit(10) it is returning less than 10 items. It seems like it is returning Todo those DESCRIPTION contains hi from first 10 itmes in DynamoDB Todo table(It is filtering the itmes form the 10 itmes). If there is no items with DESCRIPTION contains hi in first 10 items of table it will return null.

My table have 25 items with description=hi

My expectation: It should return exactly 10 items which should have description=hi whether it is in the first 10 items of table or not.

2. Getting the highest like comments & total comment count:

For example we can take a YouTube video. When we open YouTube video comment section it will show us the comments with highest likes. We can't do that with graphQL and DynamoDB with an easy way. We have to do lot more to get highest liked comments.

There is no way to count the comments:

Look at the schema below:

type Post @model {
  id: ID!
  title: String!
  comments: [Comment] @hasMany
}

type Comment @model {
  id: ID!
  content: String!
  post: Post @belongsTo
}

We can't count the total number of comments on the post.

**Lets say we have to make a query for get post : we can directly retrieve the comments with post as we have created a relationship. Look at my YouTube video example like that how can we retrieve the comments with highest likes.

**DynamoDB query max size is 1mb lets say a post has 1 million comments if we will query get post with 1 million comments, the response data may reach 1mb and the latency of response also become very high. For that pagination is provided I know, then after getting the nextToken we have to make a separate comment query for that post.

3. NextToken issue:

If I'm querying items with pagination( limit=10) it is returning a next token. For the next query we can use next token to get next 10 items. If I I'm creating a new items in the table . It is creating in between the items that are present before next Token.

I have descrribed it here in a better way:

https://stackoverflow.com/questions/73669620/how-to-code-a-simple-algorithm-to-fetch-list-of-data-through-pagination-in-a-fre

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions