AppSync/GraphQL : Pagination on DynamoDB data: Curser based pagination
AWS , Cloud , Uncategorized / April 14, 2020

What is AppSync? AWS AppSync helps you create a flexible API to securely access, manipulate, and combine data from one or more data sources.AppSync uses GraphQL. AppSync can be used along with Amazon services like Lambda, DynamoDB, etc.. What is GraphQL? GraphQL is a language for APIs that enables you to query and manipulate data easily through an intuitive and flexible syntax. GraphQL provides a syntax to describe data requirements and interactions, allowing you to ask for exactly what you need and get back predictable results. This article aims at providing strategy on how to query data in the DynamoDB table with sorting and pagination. The pagination strategy used is called cursor-based pagination. Curser based pagination helps to avoid the problems of limit-offset pagination. Shifting of data on insertion and on deletion occurs while paginating in a limit-offset way, this is not ideal for real-time data. Whats is curser based pagination? Cursor-based pagination works using a pointer to a specific item in the dataset. By using this strategy major pitfalls of limit-offset pagination can be avoided.     Achieving pagination on DynamoDB data with AppSync/GraphQL Consider a case where we have an Entity Employees and each employee has multiple  Tasks. It’s a…

Share this page in social media platforms