I have not thought a lot about it yet, but will need to address it in the 8.x branch shortly.

How should Relation take advantage of UUID's?
Should a UUID field be added to the field schema?
Should relations entities have a UUID?

Comments

naught101’s picture

Trying to get up to scratch: #1252486: Low level UUID API in core, but it looks pretty complex, so I asked a few questions over at #1988166: Drupal 8 status?, in particular, do all entities have a UUID by default in core D8?

If we have UUIDs, then we can ditch the entity_type storage in endpoints, right?

What would the performance gain/loss be?

Yes, relation entities should have UUIDs. Why not?

dpi’s picture

do all entities have a UUID by default in core D8?

All core entities have UUID. But not all entities have UUID. An entity type must explicitly define a `uuid` key in its base table to have UUID's.

If we have UUIDs, then we can ditch the entity_type storage in endpoints, right?

UUID are optional. endpoints would still need entity_type and entity_id.

To keep the schema consistent, when a module is creating a relation:

if a entity_type supports UUID, and only entity_type and entity_id are passed then should Relation lookup the UUID and fill in the UUID? Consistency from 3rd parties is my concern.

relation entities should have UUIDs

No complaints here.

dpi’s picture

I think some issues could be created if Relations are moved from one site to another, but entity_type / entity_ids vary.

Therefore a relation should only get a UUID if all entities on its endpoints have a UUID?

Perhaps dixon_ has some thoughts? *

naught101’s picture

can only entities have UUIDs?

Are there any objects that should be relatable that should not have UUIDs? Because if not, it might be reasonable to make a relation UUID-only for storage, if it means significant performance benefits.

However, we do still need to be able to define relation types by targetable bundle, and I guess UUID wouldn't help there?

dpi’s picture

I think all the entities that people care about already have uuids. But there may be entities that do not implement them.

I'm not sure *replacing* entity_id with UUID endpoints would solve any kind of performance issues or provide meaningful benefits. The cross site features are what I am interested in.

alexverb’s picture

I don't want to bring this off topic. But just to know, are there any plans for integration with UUID and Features for D7? I tried a go at it myself, but since this is a complex entity with a lot of relations going on I didn't get really far.

I know there are Migrate possibilities. But my whole project is based around on UUID and Features...

alexverb’s picture

So, to keep up with my promise. I will take my buisness elsewhere :)
Integration with UUID and UUID Features for Drupal 7