Skip to content

Evaluating types for serialized UUIDs #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
justend29 opened this issue Apr 15, 2025 · 0 comments
Open

Evaluating types for serialized UUIDs #175

justend29 opened this issue Apr 15, 2025 · 0 comments

Comments

@justend29
Copy link

In many cases, UUIDs are handled directly in their serialized text representation. Examples may include:

  1. Logging - Instead of serializing a uuid every time, storing the serialized version and logging this is much more efficient.
  2. Databases - Storing UUIDs in text form in certain databases, such as DynamoDB, is often advantageous.
  3. Serialization - Consider JSON/XML/YAML serialization & deserialization. Parsing the text UUIDs can be avoided and is often not necessary.

I deal with serialized UUIDs so frequently that I've created type-safe Serialized_uuid & Serialized_uuid_view types for my own usage. I'm wondering if the boost.uuid library authors would be interested in accepting these types - I'd be happy to contribute the code.

The idea with these types is that they can be constructed from serialized UUID text, guaranteeing the format of the string to uphold the invariants.
With this, they store/reference the UUID text, providing efficient access to the validated UUID text for subsequent logging or whatever. They essentially increase type-safety around the serialized format of UUIDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant