https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • u

    Unsmart | Tech debt

    04/30/2023, 7:22 PM
    The TL;DR of the storage offerings is pretty much just: KV: fairly simple key - value store with cache and eventual consistency R2: Use for files / large data blobs DO: A bit more complex key - value store with transactions and good list operations
  • z

    Zakum

    04/30/2023, 7:34 PM
    I took a look at setting up KV on the site real quick, but it looked, as you said, simple/not suitable for thousands of lines of objects. The 60mb is split between 200-300 files of more or less equal size, would you still recommend R2 in that case?
  • z

    Zakum

    04/30/2023, 7:34 PM
    hopefully my use case is clear šŸ˜… kinda outside rn
  • s

    Skye

    04/30/2023, 7:35 PM
    That would fit easily in KV from the sounds of it, as it's separate files
  • s

    Skye

    04/30/2023, 7:35 PM
    It's just less suitable for things that you're updating frequently, and need consistency with, or things passed the size limit
  • z

    Zakum

    04/30/2023, 9:42 PM
    Hmm okay so just checked and there are over 300 files though I'm currently only using 27. I'm still piecing together data from these so it could go up but unlikely to pass 50.
  • b

    Burrito

    04/30/2023, 9:46 PM
    Haven't checked for almost a year, any interesting things happened with worker lately?
  • z

    Zakum

    04/30/2023, 9:50 PM
    Updates are very infrequent (every few months or so) and manual (it's read-only, no user can write to it) so consistency shouldn't be an issue. šŸ‘ Would you set it up so that 1 namespace = 1 file?
  • u

    Unsmart | Tech debt

    04/30/2023, 9:50 PM
    1 namespace for every file
  • z

    Zakum

    04/30/2023, 9:58 PM
    cool will give it a try
  • z

    Zakum

    04/30/2023, 9:58 PM
    thanks you two!
  • d

    dave

    05/01/2023, 1:32 AM
    @HardAtWork Do you use Supabase?
  • u

    Unsmart | Tech debt

    05/01/2023, 1:36 AM
    Supabase cloud doesn’t scale very well at least their real-time stuff unless something has changed recently
  • d

    dave

    05/01/2023, 1:42 AM
    only planning on using it for auth
  • e

    embed

    05/01/2023, 5:53 AM
    How would I go about trying to push a fix to @cloudflare/worker-types? The type for
    FormData.get
    is
    string | null
    when it should be
    string | File | null
  • e

    embed

    05/01/2023, 5:53 AM
    the types are auto generated so i am not sure how one would try and make a pr to fix this.
  • d

    Dani Foldi

    05/01/2023, 6:25 AM
    What version and entry point are you using? New ones have it correctly
  • e

    embed

    05/01/2023, 6:26 AM
    I have just found I can add /experimental for newest version in tsconfig. fixed ;p
  • s

    sathoro

    05/01/2023, 6:43 AM
    yeah we use it for just auth and CRUD stuff. no real-time and nothing that needs to be fetched on every request
  • s

    sathoro

    05/01/2023, 6:43 AM
    works really well for us
  • d

    dave

    05/01/2023, 6:44 AM
    How do you handle the situation where a long duration JWT for a user needs to be revoked?
  • s

    sathoro

    05/01/2023, 6:46 AM
    we aren't handling that right now since we cache the JWT response from Supabase indefinitely (using DO). but will add in some revocation stuff using DO too
  • s

    sathoro

    05/01/2023, 6:47 AM
    I think will just need to send a revoke request when user changes password and then store that in DO and check on each request
  • d

    dave

    05/01/2023, 6:47 AM
    Ahhh interesting, I was planning on using the regular cache api to do something similar, but DO makes more sense.
  • s

    sathoro

    05/01/2023, 6:48 AM
    we use DO for several basic caching strategies and it works great. with itty-durable it's only a few lines of code
  • d

    dave

    05/01/2023, 6:48 AM
    Thanks, didn’t know about itty-durable!
  • d

    dave

    05/01/2023, 6:49 AM
    @sathoro do you offer your users long lasting API keys? I need to give our customers a key for our AWS compatible endpoints, but ideally a way of revoking if they stop paying lol.
  • s

    sathoro

    05/01/2023, 6:50 AM
    we do yeah. they are stored in DO too lol
  • d

    dave

    05/01/2023, 6:50 AM
    Aren’t you worried about the api keys being lost with DOs?
  • s

    sathoro

    05/01/2023, 6:51 AM
    the storage is persistent. should be more solid than a regular DB
1...242724282429...2509Latest