Generally no. Images should go in some kind of object storage, like R2. Once you've stored them externally you can keep a link or the path to the image in your database.
It should be fine assuming you arent reading the key before its uploaded. KV should also be faster especially since it is replicated... but more expensive.
My flow is upload file -> worker forward formData to my external service -> return base64 encoded string -> worker create D1 row -> worker set KV value to encoded string.
Hi! I just started exploring D1 in a Nuxt 3 project. Could someone explain me what exactly is the best approach using a DB during local development? I successfully deployed Nuxt 3 project on CF Pages and bind D1 database to it. This database is used in production... what about during development? Running wrangler pages dev -- yarn devwrangler pages dev -- yarn dev also bind the production database, right? Should I have different D1 database for local development? Just sqlite... or what would be the best approach?
D1 has fully-featured support for local development, running the same version of D1 as Cloudflare runs globally. Local development uses Wrangler, the …
I found this tutorial very helpful: https://sat0shi.dev/posts/drizzle-intro/ Especially to understand how to use D1 for local development and how migrations work.