Hey,
So far I’m loving FaunaDB (!) and would love to continue using it for my application, which I hope to launch in the next few months.
I was recently trying to understand how many byteReadOps I was using. I wanted to reduce this amount as I found the number displayed in the dashboard to be strangely high (almost 200k).
After playing around in the shell, I noticed some behaviour that I thought was odd, and it would be good to get some clarification on this.
Here’s what I did, in order:
-
I first created a document with a small nested array of strings/numbers.
-
I queried in the shell for this document; it costed 1 byteReadOp and 293 storageBytesRead, as expected.
-
I then added more elements to the array, and I queried for the document as before. It then costed 2 byteReadOps and an appropriate number of storageReadBytes (just under 8kb). Again, this was expected.
-
However, after this, I then removed some entries from the document, and I queried again. To my surprise, the number of byteReadOps increased to 3, and the number of storageBytesRead increased to 11kb, even though the size of the document decreased (?).
-
To investigate further, I then removed all the extra data so that the document was the same as it was in step 1. I queried again, and the number of byteReadOps remained at 3 (?), although the number of storageBytesRead did slightly decrease to just over 8kb.
So reading the same document with the same data is now requiring 3x the number of byteReadOps.
- As a final sanity check, I then copied the data in this document and made a new document. Again, I queried from the shell, and it costed 1 byteReadOp, as expected.
Here is a screenshot from the shell showing this behaviour. (I’m limited to posting only one screenshot as I’m new.)
A simple document, retrieved with a simple Get(Ref(Collection(“Test”), “333389064662155855”)) operation, requiring 3 byteReadOperations.
I really like Fauna, and I hope to use it in production soon, but it would be nice if I could understand this further.
Is this a bug or am I misunderstanding something?
All the best,
Oliver