惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
Jina AI
Jina AI
博客园_首页
宝玉的分享
宝玉的分享
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
T
Tailwind CSS Blog
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
月光博客
月光博客
罗磊的独立博客
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
阮一峰的网络日志
阮一峰的网络日志
I
InfoQ
Simon Willison's Weblog
Simon Willison's Weblog
D
DataBreaches.Net
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Scott Helme
Scott Helme
B
Blog
M
MIT News - Artificial intelligence
K
Kaspersky official blog
H
Help Net Security
V
Vulnerabilities – Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
Engineering at Meta
Engineering at Meta
博客园 - 【当耐特】
L
Lohrmann on Cybersecurity
P
Privacy & Cybersecurity Law Blog
Project Zero
Project Zero
The Hacker News
The Hacker News
B
Blog RSS Feed
T
Tor Project blog

Deno

Deno 2.8 | Deno Claw Patrol: an open-source security firewall for agents | Deno Fresh 2.3: Zero JS by default, View Transitions, and Temporal support | Deno Deno 2.7: Temporal API, Windows ARM, and npm overrides | Deno Build a dinosaur runner game with Deno, pt. 6 | Deno Build a dinosaur runner game with Deno, pt. 5 | Deno Deno Deploy is Generally Available | Deno Introducing Deno Sandbox | Deno Build a dinosaur runner game with Deno, pt. 4 | Deno Build a dinosaur runner game with Deno, pt. 3 | Deno Build a dinosaur runner game with Deno, pt. 2 | Deno React / Next.js Denial-of-Service Vulnerability: Deno Deploy users protected | Deno Deno 2.6: dx is the new npx | Deno Build a dinosaur runner game with Deno, pt. 1 | Deno React Server Functions / Next.js Vulnerability: Deno Deploy users protected | Deno My highlights from the new Deno Deploy | Deno Deno's Other Open Source Projects | Deno How Deno protects against npm exploits | Deno Help Us Raise $200k to Free JavaScript from Oracle | Deno Deno 2.5: Permissions in the config file | Deno Fresh 2.0 Graduates to Beta, Adds Vite Support | Deno Deno 2.4: deno bundle is back | Deno JavaScript™ Trademark Update | Deno What's coming to JavaScript | Deno A brief history of JavaScript | Deno Reports of Deno's Demise Have Been Greatly Exaggerated | Deno An Update on Fresh | Deno How Plaid migrated 100 services to a new database platform 5x faster with Deno | Deno Deno 2.3: Improved deno compile, local npm packages, and more | Deno Add JSR packages with pnpm and Yarn | Deno Zero-config Debugging with Deno and OpenTelemetry | Deno Exploring Art with TypeScript, Jupyter, Polars, and Observable Plot | Deno Deno v Oracle Update 3: Fighting the JavaScript Trademark | Deno Build a custom RAG AI agent in TypeScript and Jupyter | Deno How to get deep traces in your Node.js backend with OTel and Deno | Deno toranoana.deno #20 登録受付中(2025年3月14日) | Deno Node just added TypeScript support. What does that mean for Deno? | Deno The Dino 🦕, the Llama 🦙, and the Whale 🐋 | Deno Publish a lint rule, get a prize | Deno Deno 2.2: OpenTelemetry, Lint Plugins, node:sqlite | Deno If you're not using npm specifiers, you're doing it wrong | Deno How Deno's documentation is evolving | Deno Oracle justified its JavaScript trademark with Node.js—now it wants that ignored | Deno Introducing the JSR open governance board | Deno Intro to Wasm in Deno | Deno Announcing OpenAI on JSR | Deno Deno in 2024 | Deno Goodbye WinterCG, welcome WinterTC | Deno Build a SolidJS app with Deno | Deno Run your Next.js SSR app on Deno Deploy | Deno Solve Advent of Code 2024 with Deno and Win Prizes! | Deno Deno v. Oracle: Canceling the JavaScript Trademark | Deno Deno 2.1: Wasm Imports and other enhancements | Deno Build a Typesafe API with tRPC and Deno | Deno Self-contained Executable Programs with Deno Compile | Deno Build a Database App with Drizzle ORM and Deno | Deno Introducing your new JavaScript package manager: Deno | Deno Announcing Growthbook on JSR | Deno Build an Astro site with Deno | Deno How to convert CommonJS to ESM | Deno Announcing Deno 2 | Deno The Final Touches: What’s New In v2.0.0-rc.10 | Deno Announcing Stable V8 Bindings for Rust | Deno Deno 2.0 Release Candidate | Deno Secure, efficient private npm registries with Cloudsmith and Deno | Deno Painting the Plane as We Fly It: Designing JSR | Deno Introducing Web Cache API support on Deno Deploy | Deno Deno 1.46: The Last 1.x Release | Deno Protect your cloud spend with new Deno Deploy spend limits | Deno What we got wrong about HTTP imports | Deno Benchmarking AWS Lambda Cold Starts Across JavaScript Runtimes | Deno Announcing Supabase on JSR | Deno Deno 1.45: Workspace and Monorepo Support | Deno Introducing KV Backup for Deno Subhosting | Deno A Gentle Intro to TypeScript | Deno Announcing Hono on JSR | Deno How We Made the Deno Language Server Ten Times Faster | Deno How the Guardian uses Deno to audit accessibility and performance across their 2.7 million articles | Deno Introducing More Flexible Domain Association for Deno Subhosting | Deno The stabilization process of the Standard Library has begun | Deno Deno 1.44: Private npm registries, improved Node.js compat, and performance boosts | Deno How we built a secure, performant, multi-tenant cloud platform to run untrusted code | Deno The Deno Standard Library is now available on JSR | Deno How to document your JavaScript package | Deno Your Low Code Solution Needs an Escape Hatch | Deno Deno 1.43: Improved Language Server performance | Deno How Slack used Deno to save months of engineering effort in launching their new platform | Deno JSR Is Not Another Package Manager | Deno Announcing the Hookdeck SDK on JSR | Deno Announcing the Neon Serverless Driver on JSR | Deno An intro to TSConfig for JavaScript Developers | Deno How we built JSR | Deno How Netlify used Deno Subhosting to build a successful edge functions product | Deno Introducing Simpler Project Creation in Deno Deploy | Deno Deno 1.42: Better dependency management with JSR | Deno Introducing deployctl, the command line interface for Deno Deploy | Deno Introducing JSR - the JavaScript Registry | Deno How to add Monaco to a Next.js app and securely run untrusted user code | Deno Survey Results and Roadmap | Deno Deno 1.41: smaller deno compile binaries | Deno
Announcing Deno KV | Deno
2023-05-01 · via Deno

We’re thrilled to introduce Deno KV, a strongly consistent key-value database, globally replicated for low-latency reads across 35 worldwide regions.

Deno Deploy aims to provide the simplest and fastest way to deploy and run JavaScript, TypeScript, and Wasm at the edge. However, creating stateful apps on Deno Deploy previously required connecting to external cloud databases, which involved additional configuration steps, local testing challenges, and potentially undermined the benefits of using the edge if the datastore wasn’t geographically replicated.

With today’s announcement, we’re bringing a globally integrated database to Deno that allows you to effortlessly develop full-featured apps while overcoming these obstacles.

In this post, we’ll discuss key aspects of Deno KV:

  • Run locally or managed
  • Simple but powerful
  • Atomic transactions
  • Consistency and performance
  • Use cases and examples
  • What’s next

If you’re interested in using Deno KV, please join the waitlist.

Note: Deno KV is currently in beta, and long-term data durability is not guaranteed. Please keep this in mind when using Deno KV for production applications.

Note: Deno KV is currently in open beta.

Run locally or managed

Deno KV is seamlessly integrated into the open-source Deno runtime, allowing you to run it locally or deploy it as a managed service with zero configuration.

When running locally, Deno KV is backed by SQLite, providing a lightweight and easy-to-use solution for local development, testing, or for single region production systems.

When you deploy your application to Deno Deploy, the Deno KV database is automatically backed by FoundationDB. This managed solution is operated by the Deno company, ensuring high performance and reliability without the need for manual configuration or maintenance on your part.

Simple but powerful

Deno KV is a first-class primitive and exposes only a handful of methods that you can use to store, retrieve, delete, and enumerate data. Designed for JavaScript, Deno KV can store any JavaScript structured serializable value, such as Objects, Arrays, BigInts, Dates, and more.

const kv = await Deno.openKv();

const key = ["users", crypto.randomUUID()];
const value = { name: "Alice", created: new Date() };
await kv.set(key, value);

const result = await kv.get(key);
console.log(result.value);

Use the kv.list() operation to list all keys matching a specific selector. In the example below, all keys starting with a particular prefix are selected.

await kv.set(["users", "alice"], { birthday: "January 1, 1990" });
await kv.set(["users", "sam"], { birthday: "February 14, 1985" });
await kv.set(["users", "taylor"], { birthday: "December 25, 1970" });


const iter = kv.list({ prefix: ["users"] });
for await (const entry of iter) {
  console.log(entry.key);
  console.log(entry.value);
}

The list operation retrieves data from the store in batches, defaulting to 500 keys. To implement pagination, pass the iter.cursor property back into subsequent calls of kv.list().

Learn more about the available methods in the documentation.

Atomic transactions

For many applications, reliable database transactions are necessary. This is possible in Deno KV using kv.atomic() to create transactions with strong consistency across multiple keys that are immediately durable by default:

const kv = await Deno.openKv();
const change = 10;

const bob = await kv.get(["balance", "bob"]);
const liz = await kv.get(["balance", "liz"]);
if (bob.value < change) {
  throw "not enough balance";
}

const success = await kv.atomic()
  .check(bob, liz) 
  .set(["balance", "bob"], bob.value - change)
  .set(["balance", "liz"], liz.value + change)
  .commit();

Learn more about how we handle transactions.

Consistency and performance

Deno KV is a strongly-consistent database, providing external consistency, which includes:

  • Serializability: The highest level of isolation for transactions, ensuring that concurrent transaction execution results in a system state equivalent to a sequential order of these transactions.
  • Linearizability: Guarantees that operations, such as read and write, appear instantaneous and occur in real-time. Once a write operation completes, all subsequent read operations return the updated value, ensuring a strong real-time ordering.

You can relax consistency constraints with the consistency: "eventual" option for individual read operations:


await db.get(["my-key"], { consistency: "eventual" });


await db.get(["my-key"], { consistency: "strong" });

This option allows the system to serve the read from global replicas and caches for minimal latency.

Here are average latency figures for the beta in our most popular regions. Improvements are expected for the public beta and GA release.

Region Latency (Eventual Consistency) Latency (Strong Consistency)
North Virginia (us-east4) 7ms 7ms
Frankfurt (europe-west3) 7ms 94ms
Netherlands (europe-west4) 13ms 95ms
California (us-west2) 72ms 72ms
Hong Kong (asia-east2) 42ms 194ms

Use cases and examples

Deno KV is a versatile solution for managing application state, making it ideal for various use cases. Here are some examples of applications showcasing the potential of Deno KV:

  • Real-time collaboration: Deno KV can store and synchronize data across multiple clients, enabling seamless collaboration on tasks such as document editing or multiplayer gaming. Often with real-time applications, Deno’s BroadcastChannel is used to help synchronize state.
  • User data management: Store and manage user-generated content, such as blog posts and comments, with Deno KV. By using a globally replicated database, you can ensure quick accessibility, regardless of the user’s location.
  • Authentication: Deno KV can store user credentials, roles, and permissions, enabling secure and efficient authentication for your applications.

As a basic example, explore this playground to see how simple it is to create a globally consistent, persistent counter using Deno KV:

import { serve } from "/std@0.155.0/http/server.ts";

const db = await Deno.openKv();

serve(async (req: Request) => {
  await db.atomic().sum(["views"], 1n).commit();
  const res = await db.get(["views"]);
  const views = res.value.value;
  return new Response(`Views: ${views}`);
});

Here are some more advanced demo apps we have built to illustrate Deno KV’s capabilities:

  • Multiplayer Tic-Tac-Toe (source, demo): A simple online multiplayer game.
  • Pixel-page (source, demo): A collaborative drawing app that demonstrates real-time synchronization and user data management.
  • Shared Todo list (source, demo): A task management application illustrating Deno KV’s ability to store and manage user-generated data.
  • KV sketchbook (source, demo): A web-based sketchbook that highlights Deno KV’s ability to store and retrieve user-created sketches, showcasing user data management.

These examples provide a glimpse of what you can achieve with Deno KV. With its simplicity, scalability, and global replication, Deno KV is a powerful tool for developers looking to build stateful applications with ease.

What’s next

Our mission is to make Deno Deploy the go-to platform for deploying and running API servers, web apps, and edge functions. Providing globally replicated, persistent data storage is a major step towards that goal. In the coming months, we’ll be introducing features to further simplify the process of building and deploying applications with just a few lines of code.

During the beta period, users can enjoy up to one gigabyte of storage for free. We will announce pricing details soon.

Other resources:

If you’re interested in using Deno KV, please join waitlist.

Don’t miss any updates — follow us on Twitter.