ppazos / cabolabs-ehrserver

Open platform to manage and share standardized clinical data, designed by @ppazos at CaboLabs Health Informatics.
https://cabolabs.com
Apache License 2.0
179 stars 110 forks source link

Change type of UIDs to store just the 128 bytes of the UUID and use the string format on UI/API #931

Closed ppazos closed 6 years ago

ppazos commented 6 years ago

UUIDs are 128 bit numbers (16 bytes), the string format requires 36 bytes (12-4-4-4-8). Actually we are storing the string format.

It would save a lot of space if we can store the 128 bit numbers are use column types of exactly 128 bits long.

If used on the API, each UUID that comes from there should be transformed into it's correspondent number.

ppazos commented 6 years ago

The issue is that Java doesn't have one number datatype that can store 128bits. Longs are 64 bits long and we'll need two long fields to store one UUID.

Other solutions using specific types would make it DBMS dependent and would decrease portability.

This is a wontfix for now.