• Wide Area Transactions
  • Spanner provides externally consistent reads and writes, as well as globally-consistent reads at a timestamp

Organization

  • Universe
  • Zone
  • Spanserver
    • Locktable
    • ZoneMaster
  • Tablet (data shard) image

TrueTime

MethodReturns
TT.now()TTinterval: [earliest, latest]
TT.after(t)true if t has definitely passed
TT.before(t)true if t has definitely not arrived

Transactions

Read Only Transaction

R/W Transaction

  • 2PC + MVCC + Timestamp Ordering + Paxos Groups
  1. Clients start the txn
  2. One Paxos leader is selected as txn leader
  3. txn leader ask all relevant Paxos leaders in all shards to prepare for the commit, thus lock the required resources. (prepare phase)
  4. Commit wait for TrueTime api
  5. Commit the txn if success (commit / abort phase)
  • How the txn leader is selected?