Utilities for encoding and decoding records for database storage.