Develop with Spanner Omni

Develop applications with Spanner Omni using supported Spanner features. While many capabilities are shared with Spanner, Spanner Omni has differences in client libraries, the command-line interface (CLI), and console functionality.

Supported Spanner development capabilities include:

Key differences

While much of the Spanner development experience applies, the following areas differ in Spanner Omni:

  • Supported client libraries: Spanner Omni supports the Java, Go, and Python client libraries.

  • Command-line interface (CLI): The Spanner Omni CLI is a dedicated tool that is distinct from the Google Cloud CLI. While it shares a similar syntax, you don't need to provide the --instance flag when running commands.

  • Console limitations: The Spanner Omni console is read-only, so you can't use it to modify deployments or databases.

The following Spanner features and best practices apply to Spanner Omni.

Best practices and use cases

Follow these best practices and use cases to design and optimize your applications for Spanner Omni.

  • Spanner as a gaming database: Use Spanner's scalability and consistency for gaming backends.

  • SQL best practices: Optimize your queries for performance and efficiency. Most concepts apply to Spanner Omni. Because Spanner Omni doesn't support tiered storage, concepts such as timestamp predicate pushdown might not fully apply. Also, Spanner Omni doesn't have query plan visualization capabilities.

Language frameworks

Integrate Spanner Omni with popular language frameworks:

Hibernate ORM

Use Hibernate Object-Relational Mapping (ORM) to map your Java objects to Spanner Omni tables. For more information, see the following:

GORM

Integrate Spanner Omni with GORM, an object-relational mapping (ORM) tool for the Go programming language. To use the object-relational mapping capabilities of GORM in your Go applications. For more information, see the following:

Transactions and concurrency

Spanner Omni supports the following transaction management features:

Isolation levels

Understand the different isolation levels that Spanner Omni supports to ensure data consistency.

Optimization

Use these techniques to optimize your transaction performance and throughput.

Locking

Learn how to use explicit locking to manage concurrent access to your data.

Data access and modification

Access and modify your data using standard Spanner methods, including the client libraries, CLI, and DML.

To learn how client libraries manage sessions, see Sessions. While the underlying session concepts apply to Spanner Omni, it supports multiplexed sessions only.

Reading data

Read data from Spanner Omni using various methods, including stale reads and directed reads.

Modifying data

Modify your data using DML, mutations, or the CLI.

Data types

Spanner Omni supports the following data types to represent your application's data:

Development and testing

Configure your development environment and application behavior to ensure reliable performance and error handling.

Stream out data changes

Spanner change streams track database changes like inserts, updates, and deletes in near real-time. Managed using DDL, they capture details like primary keys and commit timestamps for entire databases or specific tables. While functionality is nearly identical between Spanner and Spanner Omni, Dataflow is not supported in Spanner Omni.

To learn more, see:

Use Spanner full-text search (FTS) to search tables for words, phrases, or numbers. FTS reads the latest committed data.

Key features of FTS include:

To use FTS, create search indexes on the columns you want to search. Spanner breaks down data in these columns into individual words. It updates the index instantly when new data is added.

FTS searches offer advanced capabilities beyond standard text matching, such as:

FTS functionality is consistent between Spanner and Spanner Omni.

Full-text differences in Spanner

Spanner supports the core FTS functionality that's in Spanner with the following differences:

What's next