News for hackers. Stuff that matters.
Re:Deno Queues by zoogeny on Wednesday September 27, 2023 @12:41PM (#37677339)
I think what Deno is aiming for here is actually very forward thinking.

I'm using Go for the first time this year and some aspects of the language are very C like. Of the list of things that isn't C like (e.g. GC allowing one to return what look like stack allocated pointers from functions) there is the obvious inclusion of things like `map[string]string`. I bring this up because it struck me that inventing a language in 2023+, it would seem almost insane not to have built in syntax for the language to handle map types.

And so it seems logical that a web-server focused eco-system would start to garner libraries and even language syntax (maybe one day) for the kind of primitives we frequently use on web-servers. I mean, I can't even recall the last time I worked on a distributed web server that didn't have a KV store as a cache, or a locking mechanism, or even an ad-hoc queue. A distributed system without a KV store feels vaguely isomorphic to a computer language without a map type. It is such a Swiss army knife kind of technology.

One potential issue is that Deno is going alone down this path. Currently, I don't feel confident that the new features they are adding will be available on competing platforms. Even if they open source the API (it is on a `Deno` namespace), I'm not sure it will just work on AWS if I wanted to switch out FoundationDB for e.g. Redis.

For that reason, I feel I want to avoid Deno. Even if the syntax and exposed features are really attractive, I'm worried about becoming locked in and then having to do a lot of surgery to code to make it deployable on multiple cloud infrastructures. That is a requirement from a lot of clients. E.g. maybe I want to sell to Oracle or Salesforce one day but they mandate I have to run my systems on-prem. I'm now on the hook trying to figure out how to adapt whatever available KV store they have to the features I'm using from the `Deno` package.

It is a double edged sword. Maybe they will succeed in pushing forward this vision to a broader audience. For now I'll probably remain cautious.

Re:Deno Queues by paxys on Wednesday September 27, 2023 @12:45PM (#37677402)
I disagree. Tying a language runtime to a specific KV interface which is tied to a specific hosted service is the opposite of forward thinking. In fact the tech industry has made a lot of progress away from vendor locked-in stacks, and this just reminds me of those.

What is really the difference between Deno.KV being shipped as part of the runtime vs adding an `import KV` statement at the top of the file (which could come from Deno or wherever else you want)?

And what are the chances that the Deno team is going to ship bindings for any language besides their own?

If Google started adding Google Cloud specific primitives natively to Go would you call that forward thinking as well?

Re:Deno Queues by zoogeny on Wednesday September 27, 2023 @12:58PM (#37677601)
> What is really the difference between Deno.KV being shipped as a standard library vs adding an `import KVService` statement at the top of the file?

The same difference between `#include "myStringMap.h"` and `map[string]string` in C vs.g Go. There is some advantage to everyone in an ecosystem using the same primitives. That kind of language-level standardization goes a long way.

For example, it might increase the ecosystem of available distributed system libraries that only need KV stores. If I can compose several libraries, all of which use the same underlying KV interface and implementation - I can imagine that might result in some interesting use-cases.

As for the rest of your comment, I would humbly ask if you read the entirety of my comment? We seem to agree that as long as Deno KV is locked into their cloud that people should be very wary of lock in. And I myself will likely avoid it for the time being until the dust settles. There is some chance the rest of the community will just come along and fill in the gaps on popular cloud platforms. Or maybe they won't. Time will tell.

Re:Deno Queues by pests on Wednesday September 27, 2023 @04:57PM (#37681204)
> difference between `#include "myStringMap.h"` and `map[string]string` in C vs.g Go.

Except one is a language feature with custom syntax and the other is a library that could be implmented as a library just the same.

Not everyone in the ecosystem is going to use this because its not forced on them through syntax and espically because its inside deno and not node so barely anyone at all will use it.

Re:Deno Queues by coffeebeqn on Wednesday September 27, 2023 @12:51PM (#37677496)
If they want to have these primitives then I’d prefer to have a “universal” queue API that would work with SQS, Kafka, etc. with some magic. But the developer API could be just deno.Queue or whatever
Re:Deno Queues by paxys on Wednesday September 27, 2023 @12:56PM (#37677571)
Why try to standardize the interface at all? This isn't the job of a programming language, and there is no way it can anticipate all the possible use cases. Let each service publish their own bindings, and you can a programmer can consume whichever ones you want.
Re:Deno Queues by dkn on Wednesday September 27, 2023 @01:47PM (#37678336)
Deno is not a programming language though. It's a JavaScript (TypeScript) runtime.

Deno is basically trying to be an infrastructure framework for JavaScript.

Re:Deno Queues by dsherret on Wednesday September 27, 2023 @02:17PM (#37678840)
> Tying a language runtime to a specific KV interface which is tied to a specific hosted service is the opposite of forward thinking.

This is not the case. The Deno runtime itself is not tied to the Deno Deploy hosting service. The KV feature in the Deno runtime can be used without the hosting service.

You can read the details about how Deno KV works in the Deno runtime here: https://til.simonwillison.net/deno/deno-kv (as has been posted in other comments)

Re:Deno Queues by zja on Wednesday September 27, 2023 @03:06PM (#37679639)
> The KV feature in the Deno runtime can be used without the hosting service.

But one writes to foundation, and the other writes to a sqlite file. You wouldn’t be able to self host an app written for Deno Deploy and have it work out of the box.

Are there any plans to open source the KV backend so that people could host their own KV databases? Now that you can connect to remote Kv databases, I suppose someone could implement their own?

Re:Deno Queues by andyferris on Wednesday September 27, 2023 @05:16PM (#37681438)
Self-hosting should work with a change of configuration, no?

As someone mentioned elsewhere, they have documented the protocol, so yes you could reimplement your own remote KV store.

Re:Deno Queues by coding123 on Wednesday September 27, 2023 @06:51PM (#37682532)
This is what Java did - JCP created, APIs invented to be implemented by Tomcat, JBoss, fill in your favorite here. Configure your actual instance - in the past this was done with beautiful UIs - total waste of time considering we're in the era of Yaml (FBFW?) configuration.
Re:Deno Queues by endisneigh on Wednesday September 27, 2023 @05:21PM (#37681496)
This is not true, you cannot run your own foundationdb server and use the kv service without reimplementing yourself in fdb
Re:Deno Queues by BoorishBears on Wednesday September 27, 2023 @06:19PM (#37682183)
This instantly reminded me of Next.js, which is open source but has a special build format for serverless environments.

The 1st party implementation is closed source: 3rd parties start on the back foot trying to implement alternatives and have to keep up with a 1st party that can move in lockstep.

And sure enough, like every other time I see this kind of behavior: Deno was invested in by the CEO of Vercel.

"Javascript is taken over by venture capital" wasn't on my 2023 bingo.

Re:Deno Queues by dackerlunghack on Wednesday September 27, 2023 @06:33PM (#37682340)
Vercel needs to stop with this bullshit. It is straight up predatory ”open” source. Like a trapper’s cage, there’s a convenient, tasty bait and then it’s too late.
Re:Deno Queues by BoorishBears on Wednesday September 27, 2023 @07:04PM (#37682686)
Is it too cynical to say this might be a lesson devs need to learn the hard way?

Right now the JS community has whipped themselves into a frenzy into building on VC backed technology.

- They refuse to acknowledge that the loudest voices in the room are openly sponsored and invested in by the same VCs who own the companies behind said tech

- They see no issue with a lack of diversity in implementations, instead settling for "it's a standard". Of course, defining a standard without a healthy variety of implementations means you end up with standards that don't benefit from a wide range of voices until well after they land (see RSC)

At the end of the day, those two alone are a pretty harsh combo: A VC-backed network effect machine built across multiple brands, and high technical costs to building something that meets the collection of standards.

I don't think anyone but FAANG can really compete with that without also getting VC dollars, thus reinforcing the loop.

Re:Deno Queues by AgentME on Wednesday September 27, 2023 @07:14PM (#37682786)
You can build a Next.js app and run it on a docker container or regular linux host almost anywhere. Vercel has some nice continuous deployment stuff built-in but I'm not sure how a Next.js app is locked into it at all.
Re:Deno Queues by BoorishBears on Wednesday September 27, 2023 @08:24PM (#37683521)
This is often repeated but misguided.

Next.js and Vercel heavily push serverless deployment: 13 reworked the built-in API support to leverage Web Standards, which discarded interop with the a much larger server ecosystem in order to enable better edge support.

Serverless deploys require providers to support the Next.js Build API: https://nextjs.org/docs/pages/building-your-application/depl...

There is no open implementation of this API (unlike Remix for example)

This means projects like Open Next start from 0: https://open-next.js.org/

The end result is significantly fractured support for a headline feature of the framework and a lot of unnecessary pain (https://betterprogramming.pub/beware-of-next-js-on-aws-ampli...) trying to leverage it on any non-Vercel platform.

Re:Deno Queues by aledalgrande on Wednesday September 27, 2023 @09:15PM (#37683935)
Yeah on the same note I developed a moderately complex app on Next but I hit a roadblock when I needed background job support, which is not natively supported (or at least at the time wasn't) on Vercel/other Next platforms and so it was never a priority for Next. Pushing serverless so hard also made deployments janky and production bugs weird when you tried to use things not supported by the underlying platform, AWS (don't remember the details now, but Node version was one of those).
Re:Deno Queues by willsmith72 on Wednesday September 27, 2023 @07:16PM (#37682800)
Yep, part of why I looked for alternatives and settled on Remix. It's never sat right with me
Re:Deno Queues by rprwhite on Wednesday September 27, 2023 @11:47PM (#37685002)
This sentiment has been repeated in a few comments. But, why can’t the deno deploy implementation be reimplemented, by yourself, by running a foundationDB server with mvSQLite[1]? That shouldn’t require any changes to the code.

[1] https://github.com/losfair/mvsqlite

Re:Deno Queues by endisneigh on Thursday September 28, 2023 @05:02AM (#37687095)
That is not the same thing, still. Like you said it would be a reimplementation, not the same thing.
Re:Deno Queues by paulddraper on Wednesday September 27, 2023 @02:50PM (#37679406)
> Tying a language runtime to a specific KV interface which is tied to a specific hosted service is the opposite of forward thinking.

Yeah, I'm hella confused.

Isn't Deno the Node.js replacement?

But now it's a database as well?

It's jumped the shark for sure.

Re:Deno Queues by giraffe_lady on Wednesday September 27, 2023 @04:42PM (#37681011)
I think people are hung up on a distinction between language and runtime that isn't that valuable and maybe doesn't even reflect normal use.

For example erlang ships a persistent KV store, queue, relational database and much more as part of its standard library. I've never heard anyone complain about this or wish it were otherwise.

Re:Deno Queues by 59nadir on Saturday September 30, 2023 @05:05AM (#37713805)
OTP isn't part of a cloud solution and there is zero lock-in to any kind of commercial offering as part of the batteries that are included in it.
Re:Deno Queues by realPubkey on Wednesday September 27, 2023 @02:53PM (#37679451)
This. It could have been a npm package, why build it directly into Deno?
Re:Deno Queues by vineyardmike on Wednesday September 27, 2023 @03:05PM (#37679622)
> If Google started adding Google Cloud specific primitives natively to Go would you call that forward thinking as well?

Go actually ships with a quite forward thinking SQL interface. It's an abstract interface over a DB, and you just import the "driver" that powers it. The driver conforms to a standard interface, so all of them behave roughly the same.

I think this is what everyone wants from Deno/etc - why can't there also be a KV interface that's universal, or a Queue interface that's universal?

People attempted this w/ go [1], where it attempts to use the same nice experience of the SQL logic, but it never seemed to gain traction.

https://gocloud.dev

Re:Deno Queues by hueho on Wednesday September 27, 2023 @09:05PM (#37683862)
> Go actually ships with a quite forward thinking SQL interface

SQL is low hanging fruit in this regard, because you just need to standardize the lowest common denominator flavors of SQL types for deserialization and then it's just juggling SQL queries around.

JDBC for Java does the same as database/sql and it's from 1997. ODBC is from 1992.

Re:Deno Queues by 59nadir on Saturday September 30, 2023 @05:04AM (#37713799)
I don't think GP is saying that this is forward thinking, revolutionary level stuff, but rather that it's generally speaking a better thing to do than ship specific implementations that wall people into your solutions.
Re:Deno Queues by jadbox on Wednesday September 27, 2023 @12:52PM (#37677506)
I love Deno but I'm cautious on adopting for the same reasons. It seems like Deno can only win if they fully support their hosting competitors as well. At the same time, they will need to be as-good or better at hosting as the industry leaders. Alternatively Deno could decide to drop their own hosting and offer a multi-cloud solution with a slim margin over their hosting partner adapter. With this path, Deno wouldn't have to directly compete as a hosting provider.
Re:Deno Queues by ecnahc515 on Wednesday September 27, 2023 @01:29PM (#37678060)
> e.g. GC allowing one to return what look like stack allocated pointers from functions

I think this is due to having escape analysis and SSA rather than having a GC.

Re:Deno Queues by johnspurlock on Wednesday September 27, 2023 @02:59PM (#37679537)
In this case, they've also documented the remote connection protocol: "KV Connect" https://github.com/denoland/deno/tree/main/ext/kv#kv-connect

I kicked the tires on this with a pure TS implementation of the protocol called kv-connect-kit that gives you the KV client api in any Javascript runtime (including Cloudflare workers, which does not have anything Deno namespace related)

- github: https://github.com/skymethod/kv-connect-kit

- npm: https://www.npmjs.com/package/kv-connect-kit

- deno/x: https://deno.land/x/kv_connect_kit

- demo: https://keyspace.deno.dev/

protocol seems to works as described on the tin, and it would be pretty straightforward to write another backend

Re:Deno Queues by jamesmcintyre on Wednesday September 27, 2023 @04:01PM (#37680441)
This library looks really cool, love the idea of unifying the api across various envs is great!
Re:Deno Queues by ljm on Wednesday September 27, 2023 @03:20PM (#37679848)
Deno is just trying to compete with other JS/TS SaaS with this. Vercel/NextJS has a KV service now; Cloudflare has it; in other cases it's Firebase.

I contend that this is not actually forward thinking, but monetising Deno as a SaaS, which every man and his dog is doing in the JS world lately with their 'cloud' offerings (reselling AWS with a framework). That's why there is a pricing page attached to this.

If Deno's KV depends on FoundationDB then they're hardly going to build adapters over other databases - switching DB tech is always a massive ordeal because they all have different use-cases and performance characteristics.

Re:Deno Queues by papichulo2023 on Thursday September 28, 2023 @07:37PM (#37697405)
Postgres connector actually supports encoding and decoding map[string]interface{} to json and jsonb data types, quite cool.