https://discord.cloudflare.com logo
Join Discord
Powered by
# durable-objects
  • h

    HardAtWork

    12/15/2022, 3:23 PM
    While DOs are generally made to be created multiple times, sometimes you only need one, and want to hard-code it into a script. You could use a name, but that requires the global check, which may take longer to run. Is there some way to expose the algorithm that generates ID strings, so you could pre-generate one hard-coded to a certain colo/colo group?
  • h

    HardAtWork

    12/15/2022, 3:24 PM
    Would also make it easier to force a specific location for a DO.
  • b

    brett

    12/15/2022, 3:27 PM
    Hrm, there are per-namespace secrets involved that we don't plan to expose to anyone. We can make
    newUniqueId({locationHint: "wnam"})
    work, but you'd need to run that in your worker once and then you could hardcode the resulting ID. All of that only matters if the possibility of a cache-miss is really bad for your app, though.
  • h

    HardAtWork

    12/15/2022, 3:29 PM
    Since(afaik) there is a part of the ID that denotes the colo itself, not just the region, will there be a way to say “only spawn in SIN”, and throw an error(maybe?) if SIN is down or unavailable?
  • h

    HardAtWork

    12/15/2022, 3:34 PM
    Also, when was the scheduled rollout for location hints?
  • b

    brett

    12/15/2022, 3:34 PM
    You really want it to be unavailable if SIN is offline? What's the usecase?
  • b

    brett

    12/15/2022, 3:35 PM
    locationHint on
    get
    is rolling out now, just depends on the health of the release otherwise
  • h

    HardAtWork

    12/15/2022, 3:36 PM
    I mean, I might redirect it somewhere else, but just knowing that the colo is down. For example, if 99% of my traffic is from a single colo(for example, a small country), I want to, if at all possible, keep all data/traffic as close as possible, rather than accidentally being rerouted to somewhere farther away(even if it is in the same region).
  • h

    HardAtWork

    12/15/2022, 3:38 PM
    Also, for a ping monitor, it would be cool to say, “Spawn a DO in LHR”, so the uptime pings have a consistent location
  • b

    brett

    12/15/2022, 3:40 PM
    We haven't made any plans to expose location on a more granular level. I think people might be surprised how often colos go offline for maintenance or upgrades, and people shouldn't really be thinking about the system at that granular of a level. Or at least that's our goal?
  • t

    toby357

    12/15/2022, 3:41 PM
    This would be amazing, an issue I have (which I've been harping on about) is I'm based in SG but have customers in Europe. If I want to create a R2 bucket, DO, D1 DB I need to VPN to Europe to get it placed in the right place. If we could say Region with preferred location ( EU with CPH as preferred) that would be geat
  • b

    brett

    12/15/2022, 3:42 PM
    https://github.com/cloudflare/cloudflare-docs/pull/7021/files
  • b

    brett

    12/15/2022, 3:42 PM
    As for "never, ever leave SIN" I think the closest we could really do is add a bunch of Jurisdictions, since that's what those are really for. But I think the smallest level would realistically be regions like APAC
  • h

    HardAtWork

    12/15/2022, 3:42 PM
    Do the big clusters regular get taken fully offline? For the ones with a lot of datacenters(LHR), I seem to remember seeing rolling maintenance, where there was at least one physical datacenter up at all times, as the rest of LHR was under maintenance.
  • t

    toby357

    12/15/2022, 3:43 PM
    @brett thanks, looks great
  • b

    brett

    12/15/2022, 3:43 PM
    Yeah I think it's a goal that all of LHR doesn't go offline at once, but no promises. And also DOs don't currently work in a way where they hop between those colos - -but that's an impl detail.
  • t

    toby357

    12/15/2022, 3:45 PM
    @brett quick question, is there any docs on which cities/colos belong to each location?
  • t

    toby357

    12/15/2022, 3:45 PM
    My case is Tiblisi which could be easter europe or asia
  • b

    brett

    12/15/2022, 3:46 PM
    Well, DOs only run in certain colos, which I think mostly fit into those locationHint buckets cleanly: https://where.durableobjects.live/
  • t

    toby357

    12/15/2022, 3:48 PM
    Thanks
  • h

    HardAtWork

    12/15/2022, 4:16 PM
    I mean, the big thing wouldn’t be a guarantee that a DO would always run in a certain colo, but a guarantee that, is it not currently possible to spawn a DO in a certain colo, then I will at least be notified, and I am then able to take some action in my Worker
  • h

    HardAtWork

    12/15/2022, 4:18 PM
    So the Worker could be like “OK, LHR is down, so I’ll temporarily redirect to MAN”, or “LHR is down, so I will log it to AE, and take no further action”
  • j

    Jacob Wright

    12/15/2022, 9:21 PM
    I like that. I couldn't find if there where restrictions on characters supported in names, but another idea is to prefix names in the string with a restricted character(s). E.g.
    NS.idFromName("eu/foo")
    or
    NS.idFromName("eu::foo")
  • j

    Jacob Wright

    12/15/2022, 9:27 PM
    For my connection pooling solution, I create a DO whose only job is to return the PoP it is in. Then I use that string to get the DO responsible for coordinating all the pools in that PoP to assign the connection to a pool that has availability or to create a new pool if needed. A more supported way to do this would be nice. Having more insight into the data centers DOs are available in, or rather, what the closest one is, would be helpful in this case. I'm not sure if it is a common use-case though.
  • h

    HardAtWork

    12/15/2022, 9:52 PM
    This is based on public data, but you could use https://where.durableobjects.live/ to see which datacenters spawn DOs where
  • j

    Jacob Wright

    12/15/2022, 9:53 PM
    That's helpful in planning things, but not for programmatically accessing the closest coordinator DO to assign a connection to a pool. Nice work on that, btw!!
  • j

    Jacob Wright

    12/15/2022, 9:54 PM
    What was the issue with the links? Looks like you got it figured out.
  • h

    HardAtWork

    12/15/2022, 9:54 PM
    You could use the JSON endpoint to create a colo to colo map, and then insert DO IDs into them?
  • h

    HardAtWork

    12/15/2022, 9:55 PM
    I have way too many security headers. One of the CSP headers caused the entire thing to run as an iframe without the external pop ups permission
  • j

    Jacob Wright

    12/15/2022, 9:55 PM
    Ahh, I was looking at those to see if I could help, but I didn't spot the culprit (I don't know the CSP headers well)
1...457458459...567Latest