Can you please refer me to an article that explains how’s Fauna keeping code like this performant?
The naive implementation of such code will have to find the result in the index twice, but I assume this is not how it really works.
Even if the first result is cached, how does this code make minimum disk/network io calls? Where does it actually run?
@danbars I am afraid we may not have any docs/blogs to explain how our Query Coordinator works.
To summarize above expression in all is one Fauna query aka transaction. Coordinator receives an expression, parses, evaluates, identifies read and/or write effects , delegates requests to nodes owning respective data, uses cache as needed and bundles the response back.
Not sure if that was helpful but I will reach out to team to see if someone can write up in more detail.
@danbars, you can use the Let function. Perhaps you knew that and was why you said “naive implementation”. Sorry if that’s the case. But to share anyway: