[openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model
wenzhi_yu at 163.com
Mon Feb 20 06:14:20 UTC 2017
I need your advice on this patch, which aims to implement etcd DB data model and API
for 'ResourceClass' object.
As you may know, in mysql implementation, mysql will generate a 'id' field, which is an
unique and auto increase integer. The 'id' is also used as 'primary key' or 'foreign key'
However, in etcd implementation, etcd will NOT generate this 'id' itself, so I intend to
use the 'uuid' attribute of the object instead of 'id', and modify the DB API method to use
'uuid' as object ident instead of 'id', like. Personally I feel using 'uuid' is more
reasonable because 'id' is a specific field in DB like mysql, seems it does not have actual
meaning in data model, right?
An alternative way Hongbin suggested is to generate an unique 'id' like mysql by ourselves
and insert the 'id' into etcd data model. But he said he's OK with the idea to replace 'id'
with 'uuid' if it does not break anything.
What's your opinion on this issue? Thanks in advance!
Wenzhi Yu (yuywz)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev