Remix.run Logo
gls2ro 13 hours ago

Why is SQLite bad for production database?

Yes, it has some things that behave differently than PostgreSQL but I am curious about why you think that.

trick-or-treat 12 hours ago | parent [-]

For read only it can be a great option. But even then I would choose D1 which has an amazing free tier and is sqlite under da hood.

saltmate 12 hours ago | parent [-]

But then you don't get the benefits of having the DB locally, with in-process access.

trick-or-treat 10 hours ago | parent [-]

It's local to the worker? I don't understand what you mean.

sgarland 8 hours ago | parent [-]

Unless your Cloudflare worker and the DB are scheduled onto the same physical server, they are not local to one another. I don’t know much about D1, but the overwhelming majority of cloud infra makes no such guarantees, nor are they likely to want to architect it in that manner.

kentonv 6 hours ago | parent [-]

Cloudflare's Durable Objects puts your Worker and SQLite DB on the same physical server (and lets you easily spawn millions of these pairs around the world).

D1 is a simplified wrapper around DO, but D1 does not put your DB on the same machine. You need to use DO directly to get local DBs.

https://developers.cloudflare.com/durable-objects/

(I am the lead engineer for Cloudflare Workers.)

sgarland 6 hours ago | parent [-]

Very cool, thanks for the response!