Database Encryption: At Rest, In Transit, In Use

Database encryption is table stakes; the layer specifics matter for both threat model and compliance.

Three encryption layers

Database encryption splits across three layers. Each protects a different threat surface; mixing them up leads to either over-engineering or false confidence.

Threat model per layer

Each encryption layer maps to a specific attacker and attack surface. Without naming the threat, the layer is decoration.

Performance cost

Encryption is not free, but the cost has shrunk every year. The real question is whether the workload notices, not whether overhead exists.

Regulatory drivers

Encryption requirements come from compliance frameworks. Knowing which framework drives which layer prevents over- or under-shipping.

Antipatterns

What to do this week

Three moves. (1) Apply this pattern to your most-loaded table. (2) Measure query latency / write throughput before/after. (3) Document the win and the constraint so the next refactor inherits the knowledge.