TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Deno KV Is in Open Beta

129 点作者 samuba超过 1 年前

10 条评论

simonw超过 1 年前
I poked around with this a few months ago to figure out how it works locally. The answer is SQLite: <a href="https:&#x2F;&#x2F;til.simonwillison.net&#x2F;deno&#x2F;deno-kv" rel="nofollow noreferrer">https:&#x2F;&#x2F;til.simonwillison.net&#x2F;deno&#x2F;deno-kv</a><p>I&#x27;m finding the business model aspect of Deno KV absolutely fascinating.<p><pre><code> const kv = await Deno.openKv(); </code></pre> That&#x27;s a Deno core API. It works fine in the open source version of Deno using a local SQLite database file.<p>But as soon as you deploy your application to their proprietary hosted service, that core API feature gets massively more powerful. It&#x27;s no longer a SQLite database, it&#x27;s now a globally distributed key&#x2F;value store backed by FoundationDB, replicated around the world.<p>It looks like they&#x27;ve extended that idea further with the latest version - you can now do this:<p><pre><code> export DENO_KV_ACCESS_TOKEN=&quot;personal access token&quot; const kv = await Deno.openKv( &quot;https:&#x2F;&#x2F;api.deno.com&#x2F;databases&#x2F;your-database&#x2F;connect&quot;, ); </code></pre> And your local code is now able to manipulate that remote FoundationDB database as well.<p>I&#x27;m having trouble thinking of a precedent for this - an open source project that has a core API which is effectively a lead generator for their proprietary cloud service.<p>I&#x27;m not entirely sure how I feel about it. I think I like it: open source projects need a business model, and the openKv() method is still a supported, useful part of the open source offering.<p>Kind of fascinating pattern though.<p>UPDATE: I just found this page of docs <a href="https:&#x2F;&#x2F;github.com&#x2F;denoland&#x2F;deno&#x2F;blob&#x2F;be1fc754a14683bf640b7bf0ecf6e286d02ee118&#x2F;ext&#x2F;kv&#x2F;README.md">https:&#x2F;&#x2F;github.com&#x2F;denoland&#x2F;deno&#x2F;blob&#x2F;be1fc754a14683bf640b7b...</a> - which describes the &quot;KV Connect&quot; protocol they are using. It looks like this evens the playing field, in that anyone could implement their own alternative backend to Deno Deploy if they wanted to.<p>This firmly establishes me on the &quot;I think this is cool&quot; side of the fence.
评论 #37396353 未加载
评论 #37397897 未加载
评论 #37396290 未加载
评论 #37397688 未加载
评论 #37397071 未加载
评论 #37400514 未加载
评论 #37397901 未加载
joshstrange超过 1 年前
I continue to watch Deno with excitement. I haven&#x27;t had a good use case to play with it yet (all my free programming time has gone into my side business and I&#x27;m not ready to chance it on Deno yet) but I&#x27;ll keep looking.<p>I find the way they handle secondary indexes very interesting. I mean under the hood I think DynamoDB does pretty much the same thing (stores the data multiple times) but instead of explicitly writing the data multiple times you define fields on the data that the secondary indexes use so the data is written there at the same time it&#x27;s written to the primary (I could be a little mistaken, I&#x27;m working at a higher abstraction layer so I don&#x27;t think about that). I can&#x27;t decide which approach I like more. I will say that I don&#x27;t think I&#x27;d need anything but my own abstraction layer to work with Deno KV vs DynamoDB. That said I still think DynamoDB is way more powerful overall.<p>As always I&#x27;m rooting for Deno to succeed.
评论 #37398924 未加载
lucacasonato超过 1 年前
I worked on some of this - happy to answer questions :)
评论 #37396947 未加载
评论 #37396512 未加载
评论 #37398221 未加载
评论 #37396114 未加载
paxys超过 1 年前
Is &quot;Deno KV&quot; a feature of Deno the runtime or Deno the hosting provider? The docs aren&#x27;t clear about what it actually is, and that makes me a bit wary when deciding to use it.
评论 #37396572 未加载
评论 #37396564 未加载
dang超过 1 年前
Related:<p><i>Deno KV</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=35743446">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=35743446</a> - April 2023 (11 comments)
tabeth超过 1 年前
How has using foundationdb been?<p>What have been the biggest pros? The biggest cons? Would you use it again (one alternative could have been TikV).
predictabl3超过 1 年前
Genuine question, are there folks hyped about Deno that don&#x27;t come from a nodejs background?
评论 #37404707 未加载
评论 #37413291 未加载
sgammon超过 1 年前
congrats to the deno team on launching this :)
评论 #37397468 未加载
debrateo超过 1 年前
Congrats on the launch!
windowshopping超过 1 年前
I don&#x27;t know enough about this to make any real nuanced comments, but I hope they clean up this import cuz this is ugly:<p>&gt; import { Semaphore } from &quot;<a href="https:&#x2F;&#x2F;deno.land&#x2F;x&#x2F;semaphore@v1.1.2&#x2F;semaphore.ts&quot;;" rel="nofollow noreferrer">https:&#x2F;&#x2F;deno.land&#x2F;x&#x2F;semaphore@v1.1.2&#x2F;semaphore.ts&quot;;</a><p>Should just be~<p>&gt; import { Semaphore } from &quot;deno&#x2F;utils&quot;;<p>Or something like that.
评论 #37397288 未加载
评论 #37397723 未加载