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

    jed

    01/01/2023, 10:16 PM
    oh really? maybe, but this would be surprising… if anything i would expect DOs to be a superset of workers.
  • d

    DanTheGoodman

    01/01/2023, 10:18 PM
    I guess so https://github.com/cloudflare/workers-rs
  • d

    DanTheGoodman

    01/01/2023, 10:21 PM
    I don’t think you can use wasm within a do though
  • j

    jed

    01/01/2023, 10:49 PM
  • d

    DanTheGoodman

    01/01/2023, 10:50 PM
    Like I can’t then invoke a wasm binary in rust
  • d

    DanTheGoodman

    01/01/2023, 10:50 PM
    I don’t believe that would be supported
  • k

    Kai

    01/01/2023, 11:08 PM
    It is supported I believe. workers-rs just uses some glue code to call into rust, you still need to use JS in workers & DOs.
    Copy code
    js
    import wasmModule from "./index.wasm";
    import * as imports from "./index_bg.js";
    
    const instance = new WebAssembly.Instance(wasmModule, { "./index_bg.js": imports });
    export default instance.exports;
    is the glue for worker-rs, but I'd expect you can import / load any number of WASM files
  • e

    eidam | SuperSaaS

    01/02/2023, 1:27 AM
    If I understand your issue correctly, you don’t need migrations for DO class code changes
  • e

    eidam | SuperSaaS

    01/02/2023, 1:28 AM
    It was supposed to be reply to this
  • p

    p0

    01/02/2023, 8:35 AM
    I'm probably being stupid here but: Why would anyone ever use KV over Durable Objects? Aren't durable objects always cheaper? One could theoretically make a KV engine USING Durable Objects. Duration basically costs nothing because all the durable object needs to do is modify storage. again, I'm probably missing something huge here which is why I'm asking this question
  • p

    p0

    01/02/2023, 8:48 AM
    According to my calculations, even if the durable object uses 15 ms of time at 128mb per request (which is an extreme case for KV situations), it will still only cost 0.1734375 per million
  • p

    p0

    01/02/2023, 8:48 AM
    which is much less than KV pricing (reads: 0.5/million | writes: 5/million)
  • p

    p0

    01/02/2023, 8:50 AM
    They should make a cheaper version of KV that only stores the data at one datacenter like durable objects so I don't have to implement my own hacky KV system using durable objects.
  • p

    p0

    01/02/2023, 8:51 AM
    seriously, I need an explanation on this odd pricing 🤣
  • k

    kian

    01/02/2023, 8:52 AM
  • k

    kian

    01/02/2023, 8:52 AM
    Duration is definitely not the only part of DO storage pricing
  • p

    p0

    01/02/2023, 8:52 AM
    that's what I was missing
  • p

    p0

    01/02/2023, 8:52 AM
    lmfao
  • p

    p0

    01/02/2023, 8:52 AM
    I knew I was missing something
  • p

    p0

    01/02/2023, 8:53 AM
    Still, that seems much cheaper than KV
  • k

    kian

    01/02/2023, 8:53 AM
    Depends what you're writing
  • p

    p0

    01/02/2023, 8:54 AM
    This is what I'm writing: A basic User object The key: uuid The props: createdAt email hashedPassword(sha256) API key (hashed) Tier would you suggest I use kv or durable objects for this?
  • k

    kian

    01/02/2023, 8:55 AM
    If you only care about pricing, calculate the size of the values you're writing.
  • k

    kian

    01/02/2023, 8:55 AM
    DO isn't plain read/writes, it's 4 KB units
  • k

    kian

    01/02/2023, 8:55 AM
    If you write a 128 KB value, you're paying for 32 units - and it's $1m for a million write units
  • k

    kian

    01/02/2023, 8:55 AM
    aka $32 per 1 million writes
  • p

    p0

    01/02/2023, 8:58 AM
    I think mine will only be one unit (4 kb)
  • p

    p0

    01/02/2023, 8:59 AM
    I'm slightly confused about the unit system... would this be 5 units?
  • p

    p0

    01/02/2023, 8:59 AM
    despite all of these being in one request
  • p

    p0

    01/02/2023, 8:59 AM
    and the sum of all of the sizes being less than 4kb
1...472473474...567Latest