Better HN
topnewbestaskshowjobs
Log inSign up

ignaciochiazzo

6 karma · joined Oct 24, 2021 (5y ago) · 10 submissions

Staff software Engineer at Shopify

Opinions are my own.

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

Submissions

1.

Lean GraphQL Resolvers with Rich Models in Ruby: A Clean Architecture Approach(ignaciochiazzo.medium.com ↗)

1 points · by ignaciochiazzo · 1y ago · discuss

comment 3y ago · link · parent

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.

3.

Show HN: Ruby WhatsApp SDK Gem(github.com ↗)

6 points · by ignaciochiazzo · 3y ago · 2 comments

4.

Performance: Six steps required when working on performance optimizations(ignaciochiazzo.medium.com ↗)

3 points · by ignaciochiazzo · 4y ago · discuss

comment 4y ago · link · parent

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...

comment 4y ago · link · parent

Sometimes the data is so big, and performance is critical that you don't have any other option than not to use offset.

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

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).

comment 4y ago · link · parent

Hey thanks for the feedback. I will update the article.

comment 4y ago · link · parent

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.