But yes, I think the next step is then some sort of sharding. Sharding by user would be an obvious approach for many apps. I think we should build a framework to help manage this, so apps would only need to provide some callbacks e.g. to compute shard key for a particular query.
Alternatively, apps that want full control will be able to use Durable Objects directly. We'll soon (in a few months, probably?) enable the new storage engine for all Durable Objects which means every object will have a private SQLite database.
(I'm the tech lead for Workers in general, and currently focused on this project in particular.)
Much like R2 has an S3 compat API as well as a way to retrieve files outside of workers (IIRC) will this be true of all forms of storage on the platform?
Sometimes it'd be nice to prime the cache with KV for example, without having to invoke a worker
For D1, yes — on the roadmap is a native HTTP API. KV has a HTTP API as well, so you can write directly.
See also: https://archive.is/e7u9x / https://www.the-paper-trail.org/post/2020-04-06-physalia
You can't. D1 won't let you create databases at runtime. At least that was the case last time I tried it, and it's what killed it for me.
wrangler d1 create customer28 --experimental-backend
wrangler d1 execute customer28 --file=schema.sqlTherefore, creating a database per user as part of the user signup flow is not possible.
I suppose you could make something to write the bindings to the toml and trigger a redeploy, but that's definitely not pretty.