---
title: "Discussion on \"Migrating large D1 to Turso\" | Hashnode"
description: "Discussion on \"Migrating large D1 to Turso\". Began with Cloudflare's D1 however high latency and upper limit pushed me to Turso. Migration wasn't without lessons. Here they are."
url: "https://hashnode.com/posts/migrating-large-d1-to-turso/65d0689f4668b6f16155a217"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Migrating large D1 to Turso](https://lukasnotes.dk/migrating-large-d1-to-turso?utm_source=hashnode&utm_medium=feed)

Began with Cloudflare's D1 however high latency and upper limit pushed me to Turso. Migration wasn't without lessons. Here they are.

Feb 17, 2024 · 9 min read · lukasnotes.dk  
Updated May 5, 2024  
Read the article

-   [#cloudflare](https://hashnode.com/tag/cloudflare)

## Written by

[Lukas](https://hashnode.com/@flexchar)

@flexchar · Copenhagen, DK

  
[View profile](https://hashnode.com/@flexchar)

A developer you can trust.

I've discovered coding back in 2013 and three years later I spent all my summer building my first Laravel app which is still in production by the non-profit I've built for. Now I'm struggling to find the balance between enjoying the power of "I can build this myself" and not chocking myself to death trying to build everything myself. As it is common for developers to be less articulate, I decided to leverage writing about my endeavours, to keep me up.

## Responses 2

Markdown supported · ⌘↵ to post

[Moisés Rubio Santos](https://hashnode.com/@mrubio)

[May 26, 2024](https://hashnode.com/posts/migrating-large-d1-to-turso/65d0689f4668b6f16155a217/comment/66538ca06181d7179b27a4e2)

Hi Lukas, I may have gotten a little lost because I am not fluent in English.

But I wanted to ask you a question, the big breakthrough you have achieved with Turso is to have local copies in the clients and in that sense I understand the difference.

But knowing that D1 is no longer beta and that you talk about 2 gigs of maximum space but now I think it is 10 gigs, if you could not have those local copies, would you think about D1? I am developing a saas and I am worried about what you said about the latency and how long D1 takes when it is supposed to be designed to scale and that it would seem at first glance similar to D1.

I'm going to use cloudflare as serverless and that's why my initial idea to stay in the ecosystem but I was very concerned reading you.

Best regards

[Lukas](https://hashnode.com/@flexchar)

[May 28, 2024](https://hashnode.com/posts/migrating-large-d1-to-turso/65d0689f4668b6f16155a217/comment/66538ca06181d7179b27a4e2#reply-6655e573f4ad55f498ad038e)

Hi Moisés, Sorry it took so long to respond!

It is really specific to your project. The latency, if you use Cloudflare Workers for accessing the database, is very low. My problem was because I was using the SQL API from a separate application. That is why Turso local copies became so valuable.

Furthermore, I didn't know when D1 will out of beta. I am happy with turso because there is no size limit, whereas D1 still has 10GB limit. My current database is already bigger than 10GB.

Another point for me is that I don't want to be vendor locked in. The perception (which really may just be a trivial illusion) that I can download the sqlite file from Turso is what makes me believe that I could move out from Cloudflare in an hour - package my worker into a Bun.serve() docker container and deploy it on my server. I may never need to do that but who knows.

I am a big fan of Cloudflare and I don't see them being bad in any way as long as it fits what you're doing. :)

Hope that helps!

[Md Rakib Hossain](https://hashnode.com/@muhammadrakib)

[May 4, 2024](https://hashnode.com/posts/migrating-large-d1-to-turso/65d0689f4668b6f16155a217/comment/6635ca5ee9171aa406b40a83)

How is your experience with turso so far?

I also switched from D1 to turso recently, and would like to know if you encountered any issues or limitations in the last 2 months?

[Lukas](https://hashnode.com/@flexchar)

[May 5, 2024](https://hashnode.com/posts/migrating-large-d1-to-turso/65d0689f4668b6f16155a217/comment/6635ca5ee9171aa406b40a83#reply-6637c154630cd4f2e1993b77)

Hey Rakib, actually none.

I am really loving the embedded sync function. There is no native php driver for libsql(turso) so the fact that I can get sqlite file and use Laravel native methods made it a 100x deal.

I did however hit a couple "issues" when I was optimizing indices where I caused a lot of GBs to be synced (around 50GBs over the billing period). I had a call with Gauba, founder of Turso, and he was very kind to waive it and further hear me how I am using it. I wouldn't call it a limitaion.

Frankly, if it fits your use case, it's quite cheap. Although I have seen that Cloudflare finally introduced sqlite download support.

What are you building if I may?

[Md Rakib Hossain](https://hashnode.com/@muhammadrakib)

[May 6, 2024](https://hashnode.com/posts/migrating-large-d1-to-turso/65d0689f4668b6f16155a217/comment/6635ca5ee9171aa406b40a83#reply-663849e0fffa7bee02adfec6)

Thanks [Lukas](https://hashnode.com/@flexchar), for sharing your experience. I really loved reading your blog.

I'm building a SaaS app using Turso, Drizzle, Zod, and Next.js. I'm hosting the app with Cloudflare Pages.

Switching from Turso to D1 is quite easy due to Drizzle, and I might switch in future but it still needs a lot of improvements. What do you recommend, should I stick with Turso?

[Lukas](https://hashnode.com/@flexchar)

[May 6, 2024](https://hashnode.com/posts/migrating-large-d1-to-turso/65d0689f4668b6f16155a217/comment/6635ca5ee9171aa406b40a83#reply-663886d42692e0f0c33327b7)

[Md Rakib Hossain](https://hashnode.com/@muhammadrakib)

Sounds like a very light project, you will do great no matter where but...

I would totally stick with Turso. The latencies are marginal and you are getting a lot more for your bucks. A company doing one thing will always out do the one doing many things.

Though the key reason for me is that fact that I am not vendor locked in. If you ever want to host at Vercel, Netlify or just spin up your own Docker container with Bun as a web server and drop it on the ridiculously cheap Hetzner VPS, you just do that. Where as with D1 you would be tied and have a work-demanding migration.
