That being said, was wondering whether you can take advantage of this without using deno deploy, or if you'd be locked in by using deno kv. Also, wondering how many bugs will only show up when deployed due to the different backbends.
That being said, was wondering whether you can take advantage of this without using deno deploy, or if you'd be locked in by using deno kv. Also, wondering how many bugs will only show up when deployed due to the different backbends.
Is having a database that happens to be a product you sell as part of your runtime good, or are you creating some mixed incentives here?
Are you a database vendor now?
If not, don’t build a database.
If this is a mature product that someone else is looking after, and it’s good and free and we’ll maintained like redis or SQLite, sure.
…but it seems like building cloud databases is not the core competency of a group building a javascript runtime.
Once money is involved, it’ll either be a distraction from their core mission, or become their core mission.
A KV db you can use for quick hacks? Sure. Awesome!
A scalable production database you’re selling to people? O_o why are you doing that?
Deno Inc. has enough expertise in running a global service that two other companies rely on their work to offer edge functions to their customers (Netlify and Supabase). Adding a database to the service makes sense. And to be clear, they don’t develop a brand new database. They build atop of SQLite and FoundationDB.
Sure.
> But they want the friction reduced to a simple `await Deno.openKv()`.
Do “they”?
If so, who’s using it to solve that problem? …because it seems the big uses of deno deploy are not using it, fine with that and it’s pretty unclear who the “they” is in this circumstance.
Still, if it’s a thin layer over foundation db or some other established database product and this is just part of the lock-in for their cloud offering, fair enough.
It’s not like others (eg firebase) don’t do the same thing.
The messaging “we’re building a database” and “we’re offering a hosted database service based on existing mature reliable technology” are different things though.
The latter all cloud vendors do.
The former is ridiculous, and it really really wasn’t clear that wasn’t what was happening.
Not saying this is for everything and everyone, but there's so much competition on this space that I can understand why somebody would like to try something different.
If Deno were nothing but "Deno CLI" (the equivalent of the 'node' executable, that runs as a typical server process on a Unix box) then you would be right. But there are two separate Deno runtimes (CLI and Deploy).
Database providers, cloud application platforms should be agnostic of the language their users are using. There are many such decisions deno is making where they want to be the end-to-end service. That is not a good sign. It creates perverse incentives for the company to devise lock-in mechanisms at each stage and discourage compatibility with the rest of the programming ecosystem, perhaps even undermine the rest of the ecosystem. I would stay away for this reason.
The API is extremely simple. It's little more than a hash map. That's hardly opinionated.
> All the good programming advice will tell you such a coupling is a bad idea.
That advice is outdated. Virtually any modern application will want a database, and this API can serve as a foundation for it – a foundation that conveniently already has many of the features (esp. global replication and consistency) that you will want and that are incredibly difficult to get right if you build them yourself. Think of this as the application's "file system". PaaS today usually doesn't provide direct disk access, so this is the low-level abstraction for persistent storage that is available. An abstraction that, in many cases, will in fact be all your application ever needs.
If you do deploy to deno cloud it's trivial to migrate because there are many competing offerings of kv stores.
I'm not that familiar with either technology, but as an example, deno kv claims strong consistency as the default; while dynamodb requires you to explicitly ask for strong consistency in queries and does not support strongly consistent reads on secondary indexes.
In that case, why does Deno have to provide this? Can't users simply create their own hashmap?
* The Erlang runtime has Mnesia and ETS built in. Batteries included. It's awesome.
* Python has a built-in persistent key-value store, dbm.
* Ruby has one as well, pstore.
Now, you can always decide to use something else! 99% of the time m not going to use dbm, or pstore, but they are nice to haves. (Mnesia and ETS rocks though, and I use those all the time.)
Yeah maybe you'd prefer to do that with an agnostic solution like Redis (which afaik is possible in Deno) but everything has pros and cons. An e2e solution is coupled but otoh it has many objective advantages. And it's not like Deno will force you to use their cloud service after all.
How often does that happen?
So it's backed by SQLite on the OS local version.
I'm intrigued if there will be a way to swap out the backend for other cloud providers.
I think fast searchable file backed data structures should be primitives of any computer language and runtime.
Isn't it part of the standard library rather than the language? Anyways, Erlang has mnesia [0] and ETS [1]. ETS is practically a KV store, which can also be persisted to disk.
[0] https://www.erlang.org/doc/man/mnesia.html [1] https://www.erlang.org/doc/man/ets.html
For that application at least no changes to the runtime would be necessary
Deno is not and has never been an "alternative runtime" to node.
So first of all, _you_ can use whatever ORM or database solution you like in general so _you_ specifically choose which technology you want to invest in. If you want to hand craft your kubernetes cluster for your database nodes and put them on GCP or Azure, then go for it. You want redis? Go for it. If you want to use supabase, firebase, planetscale or whatever, use that. If you want to choose a KV store that's built into your runtime then that's great. Believe it or not but people use lowdb in production and their database is literally a json file. I would argue whichever you choose, switching from one hosting provider, database solution, managed or unmanaged platform to another will always incur cost and how high that is will depend on your depth of integration and familiarity with it. I am most likely going to use this feature and I am happy it exists. Also let's not ignore that there is a large breadth of different needs that developers have. Would I build a massive modular corporate CRM system with BI features with it? Probably not. Am I going to build my next D&D game tool, habit tracker or Tinder for sneaker trading for it? Maybe!
I sincerely wonder what specifically you loose from this feature simply existing.
Watch as the same happens with Bun.
In this relationship of 3 years and counting, they are the positive contributor because they give you something useful for free and you presumably haven't given them anything.
The KV store has two backbends: local sqlite and distributed deno cloud.
If you choose the deno cloud backend you're signing up for a closed source cloud service from the start. There's no trickery.
Also, local KV obviously won't work for compute lambdas, as the KV isn't shared across instances.