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

    Skye

    11/29/2022, 7:47 PM
    I explained why the cache api doesn't work in condition 2
  • u

    Unsmart | Tech debt

    11/29/2022, 7:47 PM
    Well KV is just the cache api under the hood basically so its the same thing. As you currently have
  • s

    Skye

    11/29/2022, 7:48 PM
    I'm not sure where you get that assumption from? The cache api is colo-specific (meaning my writes in one colo don't take place elsewhere) whereas KV is global (beyond the normal 60s that kv caches)
  • u

    Unsmart | Tech debt

    11/29/2022, 7:50 PM
    What I mean is it would basically be the same if you just used the cache api instead because of the fact on read kv caches data for 60s. It does have a central store yes but your main central store is D1 which means cache api + D1 is basically the equal of KV.
  • s

    Skye

    11/29/2022, 7:50 PM
    My reasoning for using KV at all is it's a lot more long-lasting than the cache api will be
  • n

    nclevenger

    11/29/2022, 7:51 PM
    yah, but when it's not is really slow ... not much faster than D1
  • s

    Skye

    11/29/2022, 7:51 PM
    From my testing I'm getting around 1/3rd of the response time from KV cold to D1 - which is significant enough a difference
  • b

    brett

    11/29/2022, 7:54 PM
    I agree with the global store of KV being important here. If you had a lot of requests and a cache miss and they all went to D1 it might be a bad time. But KV can handle it
  • b

    brett

    11/29/2022, 7:55 PM
    But D1 is new and will get better there
  • h

    HardAtWork

    11/29/2022, 7:55 PM
    Why not cache D1 with a DO?
  • s

    Skye

    11/29/2022, 7:55 PM
    Oh for sure! I've seen it improve massively since the early alpha
  • s

    Skye

    11/29/2022, 7:56 PM
    That's the entire conversation we're having šŸ˜… Debating whether that gives enough of a perf change from KV
  • h

    HardAtWork

    11/29/2022, 7:56 PM
    Where’s the nearest core to IAD? I would assume that the difference would probably be in the 10s of ms then?
  • s

    Skye

    11/29/2022, 7:57 PM
    looks like 2000 miles to PDX (pretty sure that's the KV one?) šŸ˜…
  • b

    brett

    11/29/2022, 7:58 PM
    D1 is on DOs so it sounds more like your problem is that your D1 isn't in IAD? I've lost the context tbh
  • h

    HardAtWork

    11/29/2022, 7:58 PM
    So it should be at least a little bit of a performance benefit, as long as the Worker-to-DO connection isn’t super slow
  • h

    HardAtWork

    11/29/2022, 7:59 PM
    Basically, use DOs as cache for D1, since a vanilla DO will almost always respond faster
  • s

    Skye

    11/29/2022, 7:59 PM
    There's no controls for D1 location either atm
  • h

    HardAtWork

    11/29/2022, 7:59 PM
    Or DOs really either
  • n

    nclevenger

    11/29/2022, 7:59 PM
    but you can create them from other DOs in specific locations
  • n

    nclevenger

    11/29/2022, 8:00 PM
    so create your D1 from something like iad.colo.do
  • b

    brett

    11/29/2022, 8:00 PM
    If a single DO (a single thread) can handle the request load then it seems like it'd eliminate your cold KV read issue
  • s

    Skye

    11/29/2022, 8:00 PM
    This is what I'm thinking -- will have to play around with it
  • b

    brett

    11/29/2022, 8:01 PM
    You could also hash among N DOs or whatever
  • b

    brett

    11/29/2022, 8:01 PM
    But yeah Cache API -> DO shards -> D1 doesn't seem like a terrible plan to me šŸ¤·ā€ā™‚ļø
  • h

    HardAtWork

    11/29/2022, 8:02 PM
    What’s the backing for the DO DB?
  • b

    brett

    11/29/2022, 8:02 PM
    Can't say
  • b

    brett

    11/29/2022, 8:02 PM
    And subject to change
  • h

    HardAtWork

    11/29/2022, 8:02 PM
    Aw darn…
  • s

    Skye

    11/29/2022, 8:02 PM
    Thanks for the thoughts all! Will do some playing around
1...450451452...567Latest