EnableAtRestRecordEncryption defaults to true in 2.2.0 (false in 2.0.0.x): ~40% point-read regression, undocumented
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 76/100
- Tipo de issue
- Documentação
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- csharp
- Domínio
- databases, documentation, performance
Direção de pesquisa
Comece pela documentação da API DatabaseConfig.EnableAtRestRecordEncryption e pelas notas de versão ou changelog da 2.2.0. Confirme se a alteração do valor padrão foi intencional e documente seu impacto no desempenho de leitura, sua interação com EnableBatchEncryption e as opções disponíveis baseadas na carga de trabalho. O trabalho será concluído quando a mudança de comportamento for descobrível e os consumidores,并能 entender o equilíbrio entre segurança e desempenho sem alterar o valor padrão.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- C#
- Estrelas
- 42
- Forks
- 6
- Merge médio
- 4d 12h
- PRs com merge (30d)
- 24
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de MPCoreDeveloper/SharpCoreDB
-
Dificuldade 3/5 Meio dia Facilidade para iniciantes 78/100
MPCoreDeveloper/SharpCoreDB#532 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Future idea with more examples/samples/toolTalvez livre de novo @MPCoreDeveloper assumiu há 230 dias e não há nenhum pull request aberto. Abertaarea:docs area:security area:viewer documentation enhancement good first issue
MPCoreDeveloper/SharpCoreDB#171 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 2 dias
Todas as issues de MPCoreDeveloper/SharpCoreDB
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
martin-stromberg/FinanceManager#628 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Left Hand Margin Too NarrowAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
builtbybel/FluentCleaner#266 ·
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 2 dias