Live data from Hacker News

Deno Queues

deno.com

61–70 of 168 posts

Re: Deno Queues

#61
post #59

Pricing? I thought Deno was some sort of node.js replacement. What am I missing and can I use this either locally and/or self hosted without paying for it?

This is the same trick as the rest of Deno KV: the open source version uses SQLite, but when you deploy to their cloud product you get Foundation DB (proprietary) instead: > Since Queues are built on Deno KV, it uses SQLite when running locally and FoundationDB when running on Deno Deploy for maximum availability and throughput. I wrote a bit more about this pattern here: https://til.simonwillison.net/deno/deno-kv

Simon, I love reading your TILs. What's your process? Is there a TIL on writing TILs? :)

Re: Deno Queues

#62
post #43

Earlier quoted context omitted.

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

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.

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

#63

Under the hood, does DenoKV implement an abstraction that specializes locally to SQLite and to Deno Deploy in the cloud? Or are DenoKV local and DenoKV cloud two separate products with a common public API?

When deployed to Deno Deploy, KV is a wrapper around FoundationDB, selected for its use in the distributed/edge environments that Deno operates in. When used locally, it's a wrapper around SQLite.

The API is standardized for both.

Re: Deno Queues

#64
I never liked Agenda (Persisted delayed task queue using MongoDB). This example[1] using Deno Queues & KV is easy enough to be a replacement for Agenda.

Re: Deno Queues

#65

I wonder how this differs from BroadcastChannel[1] which Deno already implements and DenoDeploy seems to support. [1]: https://docs.deno.com/deploy/api/runtime-broadcast-channel

persistance?

Re: Deno Queues

#66
post #61
post #59

Earlier quoted context omitted.

This is the same trick as the rest of Deno KV: the open source version uses SQLite, but when you deploy to their cloud product you get Foundation DB (proprietary) instead: > Since Queues are built on Deno KV, it uses SQLite when running locally and FoundationDB when running on Deno Deploy for maximum availability and throughput. I wrote a bit more about this pattern here: https://til.simonwillison.net/deno/deno-kv

Simon, I love reading your TILs. What's your process? Is there a TIL on writing TILs? :)

Partly it's about building habits around them. I watch out for any time I have to spend half an hour or more figuring something out - that's generally a sign that it's worth tidying up my notes into a TIL, since the internet is clearly missing that piece of information!

I keep very detailed notes on everything I'm doing already - either as a VS Code scratch document or Apple Notes or often a GitHub Issues thread. A lot of my TILs start by me pasting those notes into a Markdown file and tidying them up.

Re: Deno Queues

#67
I dug into the internals of the local, SQLite version of this just now and wrote up some notes here: https://til.simonwillison.net/deno/deno-kv#user-content-deno...

The most interesting detail is probably the schema they're using for that:

    CREATE TABLE queue (
      ts integer not null,
      id text not null,
      data blob not null,
      backoff_schedule text not null,
      keys_if_undelivered blob not null,
      primary key (ts, id)
    );
    CREATE TABLE queue_running(
      deadline integer not null,
      id text not null,
      data blob not null,
      backoff_schedule text not null,
      keys_if_undelivered blob not null,
      primary key (deadline, id)
    );
    CREATE INDEX kv_expiration_ms_idx on kv (expiration_ms);

Re: Deno Queues

#68
post #47
post #14

Earlier quoted context omitted.

I have tried to be excited about Deno, but just don't see it. What are they doing that hasn't already been done a hundred times in the past? Deno itself is essentially Node.js + automatic TS compilation (which would otherwise have been 1 extra config file). When the project launched they made a big deal about escaping from the messy NPM ecosystem, but then ended up having to turn around and add support for it, taking…

I think you're underestimating just how much tooling Deno has built-in. It's not just automatic TS compilation, but formatting, linting, testing, and benchmarking at the bare minimum. I use those for almost every project. Each of those would probably be at least another configuration file. About Deno Deploy, I completely disagree with the analysis that it's just like any other lambda service. It's not just about easy…

> There are no cold starts and they don't just do that by keeping a vm up all the time. It's really magical.

Do you know how they're doing that, technically? Is it running on Cloudflare under the hood, or if not does it have a similar set of tradeoffs and benefits vs Lambda? Or is it a third completely different way with different tradeoffs/benefits?

Re: Deno Queues

#69
post #50

Earlier quoted context omitted.

Node is not a language.

Since you're going to be pedantic, I will be too. Language is more than syntax. Language is the combination of Syntax and Meaning; its a system of communication. The word "Fooloofol" is syntactically correct English, but meaningless within the English language; and thus is not English. The english word "bark" is syntactically identical across more than one meaning; a dog barks next to the tree bark. Language isn't ju…

Node is a JavaScript runtime with some framework stuff on top. Not more, not less. The language is the implemented ECMAScript version. If you want to add a new (key)word to the language, there is a long commitment process. "Fooloofol" will give `Uncaught ReferenceError: fooloofool is not defined` in English and Node. :-D

Re: Deno Queues

#70
I don't know if Ryan and the rest of the Deno team are lurking here, but given "Anchored on the robust capabilities of FoundationDB" what I think would be absolutely fricking cool is to get full access to the underlying FoundationDB engine, which would surface the "model any data model you want the way you want it" capabilities of FoundationDB directly to Deno developers.

In case anyone wonders what this would make possible out of the box: https://apple.github.io/foundationdb/design-recipes.html

Post reply on HN