Data Commons is now powered by Google Cloud Spanner Graph

When we first built Data Commons, our goal was to aggregate massive, disparate public datasets using the tools available at the time. The platform relied on Google Cloud Bigtable, one of the first no-SQL databases, as its storage and analytics layer. This was an effective strategy for handling large-scale lookups in the absence of native graph database technology.

Over a year ago, we started to experiment with transitioning our data to a native graph model using the newly launched Cloud Spanner Graph. Spanner Graph brings the convenience of a SQL-like interface and graph expressiveness to Spanner, with its high availability, horizontal scale-out, multi-region transactional consistency, and native ISO/IEC 39075 Graph Query Language (GQL) support. The database consists of tables for nodes, edges, observations and timeseries, and a graph of nodes and edges.

Earlier this summer, we completed our migration to Spanner. While much of this transition happened under the hood, re-architecting our core storage and query engine around Spanner directly unlocks new capabilities, better reliability, and faster improvements across Data Commons:

  • More flexible graph exploration and API queries: On Bigtable, Data Commons relied on pre-computed caches built offline for specific lookup patterns. While effective for fast key-value lookups, this meant we could only support multi-hop traversal and filtering on a couple of pre-baked properties (such as geographic containment). Because Spanner Graph lets us traverse relationships and filter edges dynamically at query time using GQL, we were able to lift those long-standing restrictions. As shared in our recent post on REST V2 API extensions, you can now run recursive multi-hop (+) queries across any property in any direction, combine multiple property filters in /v2/node, and look up DCIDs for any type of entity—not just places—using any property in /v2/resolve.
  • Unified semantic search and knowledge graph lookups: Previously, natural-language search for statistical variables and topics lived in separate search indices outside our main database, requiring extra steps to cross-reference search matches with graph metadata and place availability. With Spanner’s built-in vector search capabilities, vector embeddings for variables and topics now live in the same database as nodes, edges, and observations. Keeping embeddings in sync with the graph in a single engine powers the new semantic indicator lookup in our updated Resolve API (complete with confidence scores and matched descriptions) and helps AI agents discover relevant indicators more accurately.
  • Faster metadata discovery and more reliable regional comparisons: Moving to Spanner’s relational-graph model allowed us to redesign how we store statistical data—separating series-level metadata (such as data sources, measurement methods, and date ranges) from raw time-series observations. For users and AI agents, this means you can quickly inspect what data sources and date ranges exist for an indicator without scanning billions of data points. We also leverage Spanner’s columnar engine and tailored query plans for large place hierarchies. This allows us to run large “contained-in-place” comparisons (like comparing a metric across all counties in a state or all countries in a region) more reliably.
  • Support for multi-entity observations: Previously, observations in Data Commons were structured around a single place or entity. The new Spanner schema natively supports observations that connect multiple entities—such as bilateral trade exports or financial aid flowing from one country to another. Together with metadata and hierarchy improvements, this schema powers the new tools in our recent MCP server update (including get_multi_entity_observations).
  • Fresher data with consistent, zero-downtime updates: In our legacy architecture, updating a dataset required rebuilding large pre-computed caches across the graph. Spanner enables targeted, incremental updates to specific datasets without refreshing the entire database. By pairing incremental ingestion with Spanner TrueTime and stale reads, Data Commons serves every query from a clean, version-consistent snapshot of the graph. Users get more frequent data updates while never encountering partial or inconsistent data mid-import.