Deno KV - a global database for global apps
source link: https://deno.com/kv
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Read your data in milliseconds, worldwide. Enjoy seamless data consistency with ACID transactions. Develop and test locally using Deno CLI, where KV is built right in.
Open a KV store in any Deno program with one line of code.
It doesn't matter whether your code runs locally, or in 35+ data centers around the world. Deno KV works anywhere, with zero setup and zero provisioning.
Deno KV is built for JavaScript and TypeScript. Store any JavaScript value, from strings to objects, without having to worry about serialization.
The intutive promise-based API makes storing, retrieving, and deleting data a breeze.
const kv = await Deno.openKv();
const key = ["users", crypto.randomUUID()];
const value = { name: "Alice" };
await kv.set(key, value);
const result = await kv.get(key);
result.value; // { name: "Alice" }">
Go from a side project to an enterprise platform with zero config, zero provisioning, zero orchestration. We'll handle it.
Deno KV is built on FoundationDB, capable of handling millions of operations per second. You know what else is built on FoundationDB? iCloud, Snowflake, and more.
Deno KV writes data using ACID transactions, so you never have to worry about partial writes or inconsistent data. Even when you are mutating multiple keys at once.
Data is instantly durable once a transaction is committed, so you can be sure that your data is safe at all times.
const kv = await Deno.openKv();
const change = 10;
const bob = await kv.get(["balance", "bob"]);
const liz = await kv.get(["balance", "liz"]);
if (liz.value < change) {
throw "not enough balance";
}
const success = await kv.atomic()
.check(bob, liz) // balances did not change
.set(["balance", "bob"], bob.value - change)
.set(["balance", "liz"], liz.value + change)
.commit();">
Find the right balance between latency and consistency for your application with our customizable consistency levels. Deno KV can adapt to your unique needs, so you can focus on your users.
await kv.get(key, { consistency: "eventual" });">
Read with eventual consistency from the nearest region. Reads are fast, but may return stale data.
await kv.get(key, { consistency: "strong" });">
Read with strong consistency from the primary region. Reads are slower, but always return the latest data.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK