Database

Each database is equipped with its own schema and data, situated in a primary location along with possibly several replica locations within its designated group. This setup ensures that the schema and data are seamlessly copied from the primary location to all replica sites in the group.

Databases are identified by a distinct libSQL URL. When accessed through the libSQL client SDKs, this URL directs the client to the database instance that offers the lowest latency, thereby reducing the overall duration of read operations.

Learn more about data and connections.

Schema Database

Turso provides a feature called Multi-DB Schemas that let you share schema across many databases in a group. This is useful for creating a multi-tenant application where each tenant has their own database.

Instance

A database instance represents a single element of a logical database situated at a specific location.

This instance operates under a managed libSQL server setup hosted on an individual machine. Instances belonging to various logical databases within the same group are managed by a single libSQL server process running on the same piece of hardware.

Instances are categorized into two types: primary and replica.

Groups

All databases are part of a “group”, dictating their primary storage location and replication across distinct VMs (locations), each replica (volume) is capped at 100GB. This setup ensures databases share resources yet remain isolated.

Enterprise plans can have higher limits on storage.

A single group with replicas

Creating more than one group is limited to Scaler, Pro and Enterprise plans. You can add additional groups if you have overages enabled.

Locations

Depending on your chosen cloud provider, Fly or AWS, you can deploy to a variety of locations. Your databases form a group with a primary and optional replica locations. Turso handles synchronization from the primary to replicas automatically across its data edge.

  • Primary
    • All databases have a primary location (region) where data is stored, and can’t be changed. You can configure the primary location for groups using the Turso CLI and Turso Platform API.
  • Replicas
    • Databases can be replicated to other regions closer to your users by adding more locations to the group your database belongs to.

You can fetch the list of supported locations as JSON when building with the Platform API or using the Turso CLI.