Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-04-06 Thread Mike Bayer
On 04/05/2017 11:02 AM, gordon chung wrote: On 05/04/17 09:00 AM, Monty Taylor wrote: Please do NOT use uuid as a primary key in MySQL: * UUID has 36 characters which makes it bulky. you can store it as a binary if space is a concern. this is highly inconvenient from a datadump /

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-04-06 Thread Mike Bayer
On 04/05/2017 11:00 AM, Monty Taylor wrote: On 04/05/2017 09:39 AM, Akihiro Motoki wrote: I noticed this thread by Monty's reply. Sorry for my late :( I think we need to think 'id' separately for API modeling and DB modeling. In the API perspective, one of the important things is that 'id'

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-04-05 Thread Monty Taylor
On 04/05/2017 09:39 AM, Akihiro Motoki wrote: I noticed this thread by Monty's reply. Sorry for my late :( I think we need to think 'id' separately for API modeling and DB modeling. In the API perspective, one of the important things is that 'id' is not predictable and it rarely conflict. From

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-04-05 Thread gordon chung
On 05/04/17 09:00 AM, Monty Taylor wrote: > > Please do NOT use uuid as a primary key in MySQL: > > * UUID has 36 characters which makes it bulky. you can store it as a binary if space is a concern. > * InnoDB stores data in the PRIMARY KEY order and all the secondary keys > also contain

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-04-05 Thread Akihiro Motoki
I noticed this thread by Monty's reply. Sorry for my late :( I think we need to think 'id' separately for API modeling and DB modeling. In the API perspective, one of the important things is that 'id' is not predictable and it rarely conflict. From this perspective, UUID works. In the DB

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-04-05 Thread Monty Taylor
On 02/21/2017 07:28 AM, gordon chung wrote: On 21/02/17 01:28 AM, Qiming Teng wrote: in mysql[2]. Can someone remind me the benefits we get from Integer over UUID as primary key? UUID, as its name implies, is meant to be an identifier for a resource. Why are we generating integer key values?

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-02-21 Thread Pradeep Singh
I also agree to use 'uuid' as primary key as that makes more sense as compared to id. On Tue, Feb 21, 2017 at 9:40 PM, Hongbin Lu wrote: > Gordon & Qiming, > > Thanks for your inputs. The only reason Zun was using 'id' is because the > data model was copied from other

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-02-21 Thread Hongbin Lu
Gordon & Qiming, Thanks for your inputs. The only reason Zun was using 'id' is because the data model was copied from other projects and those projects are using 'id', but I couldn't think of a reason why they were using 'id' at the first place. By aggregating the feedback so far, I think it

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-02-21 Thread gordon chung
On 21/02/17 01:28 AM, Qiming Teng wrote: >> in mysql[2]. > Can someone remind me the benefits we get from Integer over UUID as > primary key? UUID, as its name implies, is meant to be an identifier for > a resource. Why are we generating integer key values? this ^. use UUID please. you can

Re: [openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-02-20 Thread Qiming Teng
On Mon, Feb 20, 2017 at 02:14:20PM +0800, Wenzhi Yu wrote: > Hi team, > > I need your advice on this patch[1], 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 >

[openstack-dev] [Zun]Use 'uuid' instead of 'id' as object ident in data model

2017-02-19 Thread Wenzhi Yu
Hi team, I need your advice on this patch[1], 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