KV or DB?

Hello community, I am familiar with KVs and also do know what the difference between a KV and a DB is and that KVs are way more efficient when it comes to reading with the cost of being not that efficient when writing. However, i am always unsure what to use when i have following: At the moment i store a large JSON which is just an array of a small structure (disabled (bool), gameName (str), gameDescription (str), ID (int)) (10kb) inside a KV because 99% of the query times i just read the contents and 1% is writing into the JSON. However, these 1% still can be a couple thousand queries a week, and currently im still on the free plan and i feel like a DB would work out better. But whenever i change something in the JSON its just a few small fields like "disabled" to true/false, so 99% of the data in the JSON is still the same. This also sounds like something that would be smarter to do in a DB, but then i have the 99% of times where its more efficient to just use the KV. Any ideas what would be smarter to use?
2 Replies
Erisa
Erisa5mo ago
If performance is your main concern then at the moment KV would be the best option since its replicated and D1 doesn't have replicas yet. When D1 has replicas it may be smarter to move to D1
Spuckwaffel
Spuckwaffel5mo ago
alright thank you
Want results from more Discord servers?
Add your server