Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

I ended up using `env DO CLASS get key `

I ended up using env.DO_CLASS.get(key), is that okay or should I use proxyDurable?

Really weird What do you get if you just

Really weird. What do you get if you just console.log(request.url), without any formatting?

DOs cannot store values as large as KV

DOs cannot store values as large as KV. Limit of 128KiB per value vs 25MiB. DOs are also not replicated like KV is (KV has 2 central stores, one US one EU). And of course there are different throughput limits KV has unlimited throughput (other than write 1 per second to the same key). DOs limits as an exclusive key value store should be pretty high for both write and read (you can extend read far beyond write if you use the cache api as well). With DOs I would also make sure you are using multip...

I was just hit with a much larger than

I was just hit with a much larger than expected bill, suggesting crazy high DO runtime... yet looking through each project, and each DO, I can't find one that could even be close to being the culprit. Is there a way to diagnose where the spend/compute time is coming from??

To answer my own question for others

To answer my own question for others: - yes, a Worker requesting a socket response from a DO must follow the same protocol as an end client/original request, including a GET method, and "upgrade" header. Omit either of those, and you'll throw/crash. - itty-durable is being modified (transparently) to handle all that in a seamless manner....

When you initially create it yes but

When you initially create it, yes, but after that, the alarm handler can call itself

Weird question Is it possible to run

Weird question: Is it possible to run arbitrary external code from within a durable object? Like if wanted to give users their own durable objects and expose an interface for their to iterate over rows and run JS over them, but not let them write, delete, etc.

pretty sure calling it with 128 keys

pretty sure calling it with 128 keys multiple times over will still be single transaction as long as you dont await, otherwise its probably not possible

I was hoping for some updates to Durable

I was hoping for some updates to Durable Objects announced this week. Have all the announcements been posted now? Is there anything for DOs that I missed?

Is it possible to put a durable object

Is it possible to put a durable object in a separate file, other than index.ts? I already tried setting script_name but no luck so far.

Paper - Erwin

As in list all values in this DO?

The time is updated on every IO

The time is updated on every IO interaction, so (for example) for every incoming request. This also holds for regular workers, although it is less noticeable there.

DO moving

Can I plan my application around the idea that DOs will move around in the future to lower latency?

I m having a strange bug with wrangler

I'm having a strange bug with wrangler in local mode working, but deploying the code or running without --local results in the DurableObject script being 'not found'

jurisdictions

Does anyone have a good domain model for how I should use data jurisdictions? Would you typically ask new users to share what their country of residence is, and store their country and derive the jurisdiction based on that? Or should we just ask if they are part of a specific subset of data jurisdiction relevant countries? Any guidance or simplified guides on this would be great!

```interface SESSIONInterface

```interface SESSIONInterface { session: TokenResponse | null; created: boolean; createdDate: Date; endOfLife: number;...

Transactional outbox

I wrote another library in the "Make building reliable DOs easier" series.. this time it is to help create DO that use the Transactional Outbox pattern: https://github.com/evanderkoogh/do-transactional-outbox. Would love any feedback about how easy it is to setup and if you come across any edge-cases I haven't thought of..

Has anyone combined trpc with durable

Has anyone combined trpc with durable objects to create a nicer wrapper around the DO API?

A DO is always active if it has a socket

A DO is always active if it has a socket connected to it so in the specific case koudelka wanted it will always be more expensive.