!feat(server): EO Pages 切换存储为 Blob#978
Merged
Merged
Conversation
Contributor
审阅者指南将 EdgeOne Pages 服务器实现从基于 KV 的存储层迁移到基于 Blob 的存储层,同时内联之前在 KV 中进行的评论过滤逻辑,并相应调整构建流程、入口文件、依赖和文档。 文件级变更
提示与命令与 Sourcery 交互
自定义你的体验访问你的 dashboard 以:
获取帮助Original review guide in EnglishReviewer's GuideMigrates EdgeOne Pages server implementation from a KV-based storage layer to a Blob-based storage layer, inlining comment filtering logic and adjusting build, entrypoint, dependencies, and documentation accordingly. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体层面的反馈:
- Blob 数据库层使用了一个内存中的
commentsCache,并基于读-改-写操作但没有任何并发控制,这在并发请求或多实例场景下可能导致更新丢失;建议改为每次操作都重新读取,或者使用版本号/锁机制来代替共享的可变数组。 - 所有评论查询(
getComments、countComments)目前都会把整个comments:all集合加载到内存中并在进程内过滤,随着数据增长,这可能会导致性能和内存问题;建议增加一些基础的分片或按键存储(例如按 URL 或按时间分桶),并在服务端实现限制/分页。
供 AI 代理使用的提示词
Please address the comments from this code review:
## Overall Comments
- The Blob database layer uses an in-memory `commentsCache` plus read-modify-write operations without any concurrency control, which can lead to lost updates under concurrent requests or multiple instances; consider using per-operation reads or a version/lock mechanism instead of a shared mutable array.
- All comment queries (`getComments`, `countComments`) currently load the entire `comments:all` collection into memory and filter in-process, which may cause performance and memory issues as data grows; consider adding some basic sharding or keyed storage (e.g., per-url or time buckets) and server-side limiting/pagination.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English
Hey - I've left some high level feedback:
- The Blob database layer uses an in-memory
commentsCacheplus read-modify-write operations without any concurrency control, which can lead to lost updates under concurrent requests or multiple instances; consider using per-operation reads or a version/lock mechanism instead of a shared mutable array. - All comment queries (
getComments,countComments) currently load the entirecomments:allcollection into memory and filter in-process, which may cause performance and memory issues as data grows; consider adding some basic sharding or keyed storage (e.g., per-url or time buckets) and server-side limiting/pagination.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The Blob database layer uses an in-memory `commentsCache` plus read-modify-write operations without any concurrency control, which can lead to lost updates under concurrent requests or multiple instances; consider using per-operation reads or a version/lock mechanism instead of a shared mutable array.
- All comment queries (`getComments`, `countComments`) currently load the entire `comments:all` collection into memory and filter in-process, which may cause performance and memory issues as data grows; consider adding some basic sharding or keyed storage (e.g., per-url or time buckets) and server-side limiting/pagination.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary by Sourcery
将 EO Pages 服务器实现从基于 KV 的存储迁移到基于 Blob 的数据库,并调整构建和打包配置以使用新的云函数入口点。
新特性:
增强内容:
cloud-functions目录并集成 Blob 存储。文档:
Original summary in English
Summary by Sourcery
Migrate the EO Pages server implementation from KV-based storage to a Blob-backed database and adjust build and packaging to use the new cloud function entrypoint.
New Features:
Enhancements:
Documentation: