HNHacker News
TopNewBestAskShowJobs

ignaciochiazzo

6 karma · joined October 24, 2021

Staff software Engineer at Shopify

Opinions are my own.

https://twitter.com/IgnacioChiazzo ignaciochiazzo.com

submissionscomments
ignaciochiazzo··on Show HN: Ruby WhatsApp SDK Gem
Hey, thanks.

It should be easier to get started with Whatsapp Cloud API. I have been using the gem for a while and it's working for me.

ignaciochiazzo··on Paginating Requests in APIs (2020)
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/153071174122657382...

ignaciochiazzo··on Paginating Requests in APIs (2020)
Sometimes the data is so big, and performance is critical that you don't have any other option than not to use offset.
ignaciochiazzo··on Paginating Requests in APIs (2020)
I strongly suggest not doing this since the application will be implementing `offset` in that scenario. This is the same as having Page-based pagination but with a cursor that acts a filter/sorting blob.
ignaciochiazzo··on Paginating Requests in APIs (2020)
Hey! Nice! I do think clients shouldn't store the cursor. This technique is neat, I will add it as an option to the Article (I’m the author).
ignaciochiazzo··on Paginating Requests in APIs (2020)
Hey thanks for the feedback. I will update the article.
ignaciochiazzo··on Paginating Requests in APIs (2020)
Query Limit +1 and then check the presence of the last item (Limit +1 item). Never use `count`. They are usually slow, and you might need to add more filters in the future. I will add this to the article.