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