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

    johtso

    03/09/2023, 4:35 PM
    A deployment screwup where your worker doesn't get updated?
  • j

    johtso

    03/09/2023, 4:38 PM
    Oh wait.. trpc doesn't even actually do runtime validation?
  • k

    Kevin W - Itty

    03/09/2023, 4:41 PM
    If you think of a DO as a stateful object, I don’t think validation there makes much sense personally… as the real point of contact between an external source and any form of input is really at the Worker level. I’d put validation there.
  • j

    johtso

    03/09/2023, 4:43 PM
    Right I guess DOs are 2 things, a database and an api
  • k

    Kevin W - Itty

    03/09/2023, 4:44 PM
    yeah I guess so… I forget that’s the way they intended it, haha
  • k

    Kevin W - Itty

    03/09/2023, 4:44 PM
    To me the API is just the exposed classes
  • j

    johtso

    03/09/2023, 4:44 PM
    When you update a DO you have to worry about the schema of your data changing, and also the interface of your api
  • j

    johtso

    03/09/2023, 4:45 PM
    And there's potential for a worker to have a different idea of what the DO api is, if the deployments aren't perfect
  • k

    Kevin W - Itty

    03/09/2023, 4:46 PM
    yeah, for sure… migrating DOs is no joke sometimes. I usually write a temporary self-transform method, then run it across the DOs to sync them w new structure
  • u

    Unsmart | Tech debt

    03/09/2023, 4:46 PM
    I find DOs way easier to migrate than anything because you just do it when a request comes in 🤷
  • j

    johtso

    03/09/2023, 4:46 PM
    My goal is to never write a DO that's complicated enough for it to be a problem 😂
  • k

    Kevin W - Itty

    03/09/2023, 4:47 PM
    Totally agree, it just depends on the depth of your changes!
  • k

    Kevin W - Itty

    03/09/2023, 4:47 PM
    Def a good goal!
  • j

    johtso

    03/09/2023, 4:48 PM
    Also if your DOs are all quite short lived that helps too
  • u

    Unsmart | Tech debt

    03/09/2023, 5:10 PM
    If you only do storage ops DOs use a very minimal duration 🙂 As an example I have a DO that only does storage ops... Total of 34,486,510 requests and only 83,293 GB-sec for last month
  • u

    Unsmart | Tech debt

    03/09/2023, 5:12 PM
    If I did my math correct thats $1 of duration charges for 34.5 million requests
  • j

    johtso

    03/09/2023, 5:17 PM
    By short lived I mean the data is short lived
  • j

    johtso

    03/09/2023, 5:17 PM
    Like a DO representing a payment process
  • u

    Unsmart | Tech debt

    03/09/2023, 5:17 PM
    I see
  • j

    johtso

    03/09/2023, 5:18 PM
    So more like a function that might take a little while to complete, but needs to be durable in the case of temporary failure
  • k

    Kevin W - Itty

    03/09/2023, 6:49 PM
    Let’s hope you did the math correctly then! 😅
  • k

    Kevin W - Itty

    03/09/2023, 6:53 PM
    A small amount of DOs being frequently accessed seems pretty safe… the danger I’ve found is when you’re creating a LOT of DOs. For instance, on itty.sh, I originally spun up a DO a for every entry created, just for a setAlarm to destroy it at expiration. That worked like a dream, but was gonna eat my lunch in the bill for every 128MB DO spun up. Instead, I had to create a a series of expiration managers, basically load balanced expiration DOs, each handling potentially many expirations.
  • k

    Kevin W - Itty

    03/09/2023, 6:53 PM
    so much more complex, sadly
  • u

    Unsmart | Tech debt

    03/09/2023, 7:21 PM
    🤷 I do 2 requests per minute per DO I have which is what the 34.5 million requests are
  • s

    Subh

    03/10/2023, 1:12 PM
    Hey team! What is the expected latency for a read and write to DO using wrangler POST api?
  • d

    dctanner

    03/10/2023, 2:14 PM
    Where is best to submit a suggestion for the docs?
  • d

    dctanner

    03/10/2023, 2:15 PM
    I couldn't find any mention of receiving SSE responses within a worker or DO, using the fetch api instead of EventSource. Eventually I found https://github.com/julienmachon/sse-client which works pretty well. It'd be nice if the docs just mentioned receiving SSE is possible in a DO.
  • d

    dctanner

    03/10/2023, 2:15 PM
    I'm sure you can guess what this is for.... receiving streaming ChatGPT api responses 🙂
  • s

    Skye

    03/10/2023, 4:00 PM
    Making an issue on the docs repo is generally the place
  • s

    Subh

    03/10/2023, 9:09 PM
    I am trying to create a auth system using DO. but the response time is around ~1.5s. Can you help me with suggestions to improve? Right now I have 3 DOs. Both talking to each other using internal fetch call in worker. 1. App 2. User 3. Token https://github.com/subhendukundu/authc1-do
1...513514515...567Latest