How to count read requests?

Question:
Does anyone know how read requests are counted in the following scenarios:

  • If 1 dataset is used on a page, does each time page loads and dataset is populated with data from a collection counts as 1 read request?
  • If multiple datasets are used on a page, does loading of each dataset counts as a separate read request? For example, if 5 datasets are used on a page, when page loads, would that count as 5 read requests?
  • If queryReferenced() function is called on a multi-reference field that contains 200 referenced items, for example, and next() function is used to retrieve all 200 referenced items, how many read requests would that be?
  • Does running refresh() function on a dataset counts as making a read request?
  • Does using using getCurrentItem() function on a dataset counts as making read request?
  • Does running getItems() function on a dataset counts as making a read request?


Product:
Editor X and Wix Studio

What are you trying to achieve:
Clear understanding of how read requests are counted.

Additional Details
Velo: Data Platform Features documentation mentions that queryReferenced() counts as 1 request, but it doesn’t specify if using next() to retrieve complete list of referenced items counts as additional requests.

That documentation doesn’t mention anything about datasets counting towards read requests but I’d like to confirm whether or not they do.

Working on getting answers to these. In the meantime I do have clarity on a few:

Edit: Combined the below posts into a single answer.

Yes this is correct.

This is also correct.

Every queryReferenced call is 1 read request as is each call to next(). It’s dependent on the number of calls made; not the number of items returned.

  • refresh does a read request to the backend
  • getCurrentItem does not do a request, it loads the data from cache
  • getItems - depends on if the requested range is already cached by previous requests. If this range was already loaded before, the request is not done and is instead loaded from cache. If it’s not in the cache it will do a read request.
1 Like

Thanks @anthony! I’ll wait to hear back on what you’ll find out. I appreciate you looking into it!

1 Like

Welcome! And confirming that queryReferenced() and next() are each one read request whenever called. So in your example that’s 2 total read requests.

Based on all this I’d assume the rest of your inquiries are similar (1 call == 1 request) but will let you know if I hear back further.

That’s good to know! I am still curious about getCurrentItem() and getItems() functions as those are built for datasets and not for collections.

My understanding is that a dataset is a data that was delivered to front-end. If dataset is data that exists on front-end, I would imagine that that querying datasets wouldn’t count towards read quota, but I’m not sure about that.

I would really appreciate it if you can share what if anything you’ll learn about whether or not querying datasets with functions like getItems() counts towards read/write quota. And thanks again for providing answers to the other points!

Understood. Will keep you updated.

1 Like

On these it depends on whether or not the user’s browser has already retrieved the data. Specifically:

1 Like