Reads outside of transactions
- If you need to write, depending on the value of one or more reads, you should execute the read as part of a read-write transaction. Read more about read-write transactions.
- If you are making multiple read calls that require a consistent view of your data, you should execute the reads as part of a read-only transaction. Read more about read-only transactions.
Có 02 loại read sau:
- A strong read is a read at a current timestamp and is guaranteed to see all data that has been committed up until the start of this read. Spanner defaults to using strong reads to serve read requests.
- A stale read is read at a timestamp in the past. If your application is latency sensitive but tolerant of stale data, then stale reads can provide performance benefits.