SpiceDB Documentation
Concepts
Cloud Spanner

Cloud Spanner

Usage Notes

  • Requires a Google Cloud Account with an active Cloud Spanner instance
  • Take advantage of Google's TrueTime. The Spanner driver assumes the database is linearizable and skips the transaction overlap strategy required by CockroachDB.

Developer Notes

Configuration

  • The Cloud Spanner docs (opens in a new tab) outline how to set up an instance
  • Authentication via service accounts: The service account that runs migrations must have Cloud Spanner Database Admin; SpiceDB (non-migrations) must have Cloud Spanner Database User.

Required Parameters

ParameterDescriptionExample
datastore-enginethe datastore engine--datastore-engine=spanner
datastore-conn-urithe cloud spanner database identifier--datastore-conn-uri="projects/project-id/instances/instance-id/databases/database-id"

Optional Parameters

ParameterDescriptionExample
datastore-spanner-credentialsJSON service account token (omit to use application default credentials (opens in a new tab))--datastore-spanner-credentials=./spanner.json
datastore-gc-intervalAmount of time to wait between garbage collection passes--datastore-gc-interval=3m
datastore-gc-windowSets the window outside of which overwritten relationships are no longer accessible--datastore-gc-window=1s
datastore-revision-fuzzing-durationSets a fuzzing window on all zookies/zedtokens--datastore-revision-fuzzing-duration=50ms
datastore-readonlyPlaces the datastore into readonly mode--datastore-readonly=true
datastore-follower-read-delay-durationAmount of time to subtract from non-sync revision timestamps to ensure stale reads--datastore-follower-read-delay-duration=4.8s
© 2025 AuthZed.