EnableAtRestRecordEncryption defaults to true in 2.2.0 (false in 2.0.0.x): ~40% point-read regression, undocumented
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- csharp
调研方向
首先查阅 DatabaseConfig.EnableAtRestRecordEncryption API 文档以及 2.2.0 的发布说明或变更日志。确认默认值变更是否是有意为之,然后记录其对读取性能的影响、与 EnableBatchEncryption 的交互,以及可用的基于工作负载的选项。当行为变更可被发现,且使用者无需更改默认值就能理解安全性与性能之间的权衡时,这项工作即告完成。
由索引模型根据 Issue 内容生成。
描述
Summary
In 2.2.0 DatabaseConfig.EnableAtRestRecordEncryption defaults to true; in 2.0.0.3 it defaults to false. Because every point read decrypts the record envelope, this costs about 40% of read throughput (1.66x on the same store). The flip is not called out in the 2.2.0 release notes/changelog we could find, and the property docs do not quantify the cost — so consumers upgrading from 2.0.0.x see a read regression with no obvious cause.
How it was found
ServiceMq's SharpCoreDB provider moved from SharpCoreDB 2.0.0.3 (net10.0) to 2.2.0 (net11.0). Point reads dropped from 132,592 to 101,616 ops/sec (−23%) while every other operation improved. Enumerating new DatabaseConfig() by reflection in both packages:
2.0.0.3: EnableAtRestRecordEncryption = False
2.2.0 : EnableAtRestRecordEncryption = True
Other defaults also changed in 2.2.0 (FixedWidthInlineValueBytes 0 → 24, EnableDeferredDeleteIndexes false → true, new EnableBufferedAppends false, AppendBufferFlush*), but only this one produced a measurable read regression.
Isolated on the same store (5,000 rows, median of 3, net11.0, NTFS; the provider seals payloads itself with AES-256-GCM):
EnableAtRestRecordEncryption |
point reads | durable writes |
|---|---|---|
true (2.2.0 default) |
84,296 ops/sec | 2,189 ops/sec |
false |
139,825 ops/sec | 2,252 ops/sec |
So ~1.66x read throughput; writes effectively unchanged when the caller already encrypts payloads.
It is a real protection, not free to drop
Scanning the store files for a distinctive queue key and payload:
EnableAtRestRecordEncryption = true: neither the key nor the payload appears in plaintext in the data files;false: the payload stays sealed (the provider encrypts it), but the record key, area and timestamps are plaintext in the data file.
So the secure default is defensible as a posture; this issue is mainly about documentation and expectations, not necessarily about flipping it back.
Questions / asks
- Confirm the flip is intentional on the 2.2.0 line and add it to the release notes/changelog as a behaviour and performance change (~40% of point reads).
- Document the interaction with
EnableBatchEncryption: when batch encryption already encrypts the table file (ServiceMq forces it on), what does per-record at-rest encryption add, and what does it cost? If it is a second layer inside an already-encrypted file, one sentence in the docs ("envelope protection, costs ~40% of reads") would let consumers decide. - Consider whether
StorageEngineType/WorkloadHintshould influence the default (read-heavy → off), or at least surface the trade-off in theDatabaseConfigdocs.
Reproduction is a two-line config comparison plus a read loop over an existing store; happy to share the harness and raw output.
- 主要语言
- C#
- 星标
- 42
- 派生
- 6
- 平均合并
- 4 天 12 小时
- 30 天内合并 PR
- 24
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MPCoreDeveloper/SharpCoreDB 的其他 Issue
-
难度 3/5 半天 新手友好度 78/100
MPCoreDeveloper/SharpCoreDB#532 · 1 条评论 ·
维护者通常 2 天内回复
-
Future idea with more examples/samples/tool可能重新可做 @MPCoreDeveloper 于 230 天前认领,目前没有进行中的 PR。 未关闭area:docs area:security area:viewer documentation enhancement good first issue
MPCoreDeveloper/SharpCoreDB#171 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 MPCoreDeveloper/SharpCoreDB 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
martin-stromberg/FinanceManager#628 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
builtbybel/FluentCleaner#266 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 62/100
维护者通常 2 天内回复