2 ms·
Hey, I'm the author of the post. Thanks for the feedback! I will update the article with some of the insights from here. I wrote the post when I was investigat
by ignaciochiazzo 4y ago
Hey, I'm the author of the post. Thanks for the feedback! I will update the article with some of the insights from here.
I wrote the post when I was investigating cursor-based pagination, which I had to implement at Shopify. We decided to use Cursor-based pagination since offset performance wasn't good enough. The larger the offset, the slower the query.
We decided to add the cursors to the LINK header page of each request response. The header contains two URLS: the previous and next page.
We saw a tremendous impact! In some cases, iterating over the pages sequentially using Cursor was much faster than sending parallel requests using Page-based pagination.
I built a library where you can compare the performance of Cursor vs Offset for a Shopify Store iterating on specific resources. This helped validate the approach at Shopify and prove to partners that it was worth migrating to Cursors!
More information here https://twitter.com/IgnacioChiazzo/status/1530711741226573824 https://twitter.com/IgnacioChiazzo/status/153071174122657382...