A Pattern for a Searchable, Encrypted JSON Document Service: David E Wheeler - PGCon 2023

A developer presents a pattern for a searchable, encrypted JSON document service, showcasing best practices for implementation, including encryption, search, and query optimization.

Key takeaways
  • Implement a key ring utility in Go to handle encryption and decryption of JSON documents
  • Use JSON-LD for canonical resource IDs
  • Employ a simple key-value design for document storage
  • Apply HMAC message authentication and AEAD encryption
  • Optimize query performance using SQL JSON Path
  • Implement searching and indexing for efficient query execution
  • Use a searchable, encrypted JSON document service to store data
  • Utilize the UUID in the database for unique key identification
  • Store intermediate results and opt for compact indexing
  • Apply hash-based encryption and use SHA-1 and SHA-256 hashers
  • Define extensions for additional data storage
  • Utilize the JSON schema for validation and enforcement of data types
  • Recursively find matches within a hash node tree
  • Combine multiple sub-schemas to compose additional documents
  • Apply JSON merge patch for incremental updates
  • Use placeholder values for searchable data
  • Store essential information in the head section of the JSON object
  • Utilize SQL JSON Path syntax to perform queries and indexing
  • Implement a system of record for entity information