A UUID is a globally unique universal identifier. These are extremely useful in a CRM-like environment, because they can express descendant/ancestor relationships without the need to traverse a join chain of intermediate relationships. You can get everything "belonging" to a particular user/record/account/whatever in a single SELECT
statement with no JOINS
.
for every row in the database across ALL tables:
- assign a database-wide unique UUID
record.uuid
- the first two digits of the UUID identify the table to which the record belongs
- add an array field called
ancestor_uuids
containing the UUIDs of all ancestor records (up to Account)
so a Task
record might have UUIDs for a RepeatingTask
, User
, and Account
in its ancestor_uuids
array
Now what can we do with this? *