Data location
Learn how the location of data stored in D1 is determined, including where the leader is placed and how you optimize that location based on your needs.
By default, D1 will automatically create your primary database instance in a location close to where you issued the request to create a database. In most cases this allows D1 to choose the optimal location for your database on your behalf.
Location hint is an optional parameter you can provide to indicate your desired geographical location for your primary database instance.
You may want to explicitly provide a location hint in cases where the majority of your writes to a specific database come from a different location than where you are creating the database from. Location hints can be useful when:
- Working in a distributed team.
- Creating databases specific to users in specific locations.
- Using continuous deployment (CD) or Infrastructure as Code (IaC) systems to programmatically create your databases.
Provide a location hint when creating a D1 database when:
- Using
wrangler d1
to create a database. - Creating a database via the Cloudflare dashboard ↗.
To provide a location hint when creating a new database, pass the --location
flag with a valid location hint:
wrangler d1 create new-database --location=weur
To provide a location hint when creating a database via the dashboard:
- Log in to the Cloudflare dashboard ↗ and select your account.
- Go to Workers & Pages > D1 ↗.
- Select Create database.
- Provide a database name and an optional Location.
- Select Create to create your database.
D1 supports the following location hints:
Hint | Hint description |
---|---|
wnam | Western North America |
enam | Eastern North America |
weur | Western Europe |
eeur | Eastern Europe |
apac | Asia-Pacific |
oc | Oceania |
With read replication enabled, D1 creates and distributes read-only copies of the primary database instance around the world. This reduces the query latency for users located far away from the primary database instance.
When using D1 read replication, D1 automatically creates a read replica in every available region, including the region where the primary database instance is located.
Refer to D1 read replication for more information.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark