What are TROs, TWOs and TCOs

I’m newer on fauna.
I wonder what is TROs, TWOs, and TCOs meaning

Hi @cesarhilario - welcome to Fauna!

The short version, pulled from the section Metering details on the pricing page:

  • TRO - Transactional read ops - How much data your transaction read. Each 4KB of data read in a transaction is one TRO.
  • TWO - Transactional write ops - How much data your transaction wrote. Each 1KB of data written in a transaction is one TWO.
  • TCO - Transactional compute ops - How many compute operations your transaction performed. Every 50 function calls is one TCO.

They all vary based on the details of each transaction.

For a longer explanation, see the Billing docs and the following examples.


Examples

  • You get a 58KB document by reference (Get, Ref), update a single 0.5KB field in the document (Update, Ref), and return the updated document.

    • TRO - 15 Ceiling(58KB / 4KB)
    • TWO - 1 Ceiling(0.5KB / 1KB)
    • TCO - 1 (4 FQL calls: Get, Ref * 2, Update)
  • You call the following user-defined function (UDF) that does nothing but compute and does not read or write any data.

    Query(
    Lambda(
      ["x", "y"],
      Let(
        { sum: Add(Var("x"), Var("y")) },
        Concat(
          [
            "The sum of",
            ToString(Var("x")),
            "and",
            ToString(Var("y")),
            "is",
            ToString(Var("sum"))
          ],
          " "
        )
      )
    ))
    
    • TRO - 0
    • TWO - 0
    • TCO - 1 (Query, Lambda, Let, Add, Var * 5, Concat, ToString * 3 = 13 FQL function calls)
  • You call a recursive UDF that uses 10 function calls per iteration, passing a single value (one iteration).

    • TRO - 0
    • TWO - 0
    • TCO - 1 (10 function calls)
  • You call the same recursive UDF, passing an array that causes 28 iterations.

    • TRO - 0
    • TWO - 0
    • TCO - 6 (10 function calls per iteration * 28 iterations = 280 function calls, Ceiling(280 / 50 = 6))

Thank’s rob, you solved my answer.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.