Database

A database is often referred to as a “logical database” because it consists of multiple libSQL databases.

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.

Turso Database Groups and Replication

A single group with replicas

Creating more than one group is limited to paid plans. You can add additional groups if you have overages enabled.

Locations

Turso optimizes data access with control over data storage and replication across global locations. Your databases form a group with a primary and optional replica locations, ensuring low latency. Turso handles synchronization 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.