Skip to content

cloudflare 实现限流/锁功能 #14

@ilyydy

Description

@ilyydy

KV 不同节点同步需要时间,适合常读少写的场景。

https://developers.cloudflare.com/workers/learning/how-kv-works/

KV achieves this performance by being eventually-consistent. Changes are usually immediately visible in the Cloudflare network edge location at which they are made but may take up to 60 seconds to be visible in other network edge locations as their cached versions of the data time out. In particular, visibility of changes takes longer in locations which have recently read a previous version of a given key (including reads that indicated the key did not exist, which are also cached locally). Workers KV is not ideal for situations where you need support for atomic operations or where values must be read and written in a single transaction.

对于限流/锁这种需要高频写/原子性操作的,看起来用 Durable Objects,但是要开付费才能用

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions