It can, but I was more getting at why if you have a single process responsible for initiating all of these, why you're calling 300 separate queries when they don't need to be - or can be procesed without the overhead of locks in different sessions.
I'm trying to figure out how you've ended up in a situation where you have hundreds of queries needing to be executed as the result of any single event, such that they can't be batched - unless they're a synchronous chain
okay, but what's the process flow look like such that those calls can't be batched to justify writing a single service endpoint if you have a situation that necessitates making a large number of calls to the d1 db (which you're currently doing via a worker for each?)
the performance hit you're likely complaining about here is not that sqlite can't handle 300 (or N) queries in quick succession. It's that you have potentially that many separate processes trying to obtain a connection and lock on that db which have to be handled in a queue.
I'm trying to see if I can find the tech architecture article on how workers and D1 DBs are exposed to a worker and kept in sync - that might make it make more sense as to why you would run in to issues with what you're trying to do here.
So yes, from the limited detail you've given, it sounds more like an appropriate use-case for a more persistent DB.
Hi, i am new to D1, i would like to use D1 for my production application. Can you guys please give a clarification on the below doubts 1. Is D1 Production Ready? 2. Saw that D1 has a maximum size limit of 10GB per Database in paid plan. Can we upgrade that?
Production ready: yes, D1 is Generally Available. Maximum limit: no, cannot be raised. The intention is that you use multiple smaller DBs (i.e. one per customer) instead of one large one, as the infrastructire is designed for many smaller individual DBs.
You can either use a Worker or the Cloudflare REST API (which is rate-limited and slower than a Worker binding). There's no "connection string" or similar though, because SQLite doesn't have a standardized connection protocol. You'll need to write anything that connects to D1 outside a Worker yourself.
the reason theres a limit and you will be forced to use dynamic bindings is just filesize. its not practical to load a 10gb file for a database for every request