Skip to content

Latest commit

 

History

History
96 lines (70 loc) · 4.17 KB

concepts.mdx

File metadata and controls

96 lines (70 loc) · 4.17 KB
sidebarTitle title
Concepts
Turso Concepts

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.

![Turso Database Groups and Replication](/images/concepts/database-group.png) 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.
Code Location
ams Amsterdam, Netherlands
arn Stockholm, Sweden
bog Bogotá, Colombia
bos Boston, Massachusetts (US)
cdg Paris, France
den Denver, Colorado (US)
dfw Dallas, Texas (US)
ewr Secaucus, NJ (US)
fra Frankfurt, Germany
gdl Guadalajara, Mexico
gig Rio de Janeiro, Brazil
gru São Paulo, Brazil
hkg Hong Kong, Hong Kong
iad Ashburn, Virginia (US)
jnb Johannesburg, South Africa
lax Los Angeles, California (US)
lhr London, United Kingdom
mad Madrid, Spain
mia Miami, Florida (US)
nrt Tokyo, Japan
ord Chicago, Illinois (US)
otp Bucharest, Romania
qro Querétaro, Mexico
scl Santiago, Chile
sea Seattle, Washington (US)
sin Singapore, Singapore
sjc San Jose, California (US)
syd Sydney, Australia
waw Warsaw, Poland
yul Montreal, Canada
yyz Toronto, Canada

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