Implenting Batching + per request caching (dataloader) in AppSync

0

In AppSync, what are modern best practices to implement dataloader (aka, per-request batching + caching) patterns?

Most answers on the internet date from ~2018-19, and there's no clear answer as to the current capabilities of the product to emulate standard dataloader patterns you would implement in node/elixir/ruby/rust.

Specifically:

  • Is BatchInvoke still limited to resolving 5 items at a time (turning N + 1 into N/5 + 1)?
  • Are resolutions de-duplicated in a request? (for example, if I field resolve Post.Author.id = 5, and later field resolve Comment.Author.id = 5, does AppSync attempt to cache the earlier lookup associated with Post, or does it make two requests to resolve Author.id = 5 (first for Post then for Comment)?
  • What role does the paid caching solution play in solving these problems and how does per-resolver caching interact with any baked-in dataloading capabilities (i think whole-request caching is pretty clear).
  • Where are / are additional dataloading capabilities in the product roadmap?

There is an older related discussion on the forums here: https://forums.aws.amazon.com/message.jspa?messageID=897682

已提問 2 年前檢視次數 82 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南