what do you think of uuid+bigserial for primary key

56 views
Skip to first unread message

geraldo dev

unread,
Apr 29, 2018, 8:17:20 AM4/29/18
to citus-users
Hi,

What are the pros/cons of uuid for parition column + bigserial for uniqueness ?

It seems that citus supports bigserial, serial columns.

On a new application, do you advise the use of bigserial ?

Regards,

Geraldo



Eren Başak

unread,
Apr 30, 2018, 9:15:52 AM4/30/18
to geraldo dev, citus-users
Geraldo,

I think both are totally fine for Citus. Maybe except serial (instead of bigserial) if you expect to store a lot of data.

As an application developer though, I would go with UUID as PK or partition column, because they tend to cause less confusion between entities and easier to use in case of  multiple data sources.

Best,
Eren

--
You received this message because you are subscribed to the Google Groups "citus-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to citus-users...@googlegroups.com.
To post to this group, send email to citus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/citus-users/b3811f78-7419-4107-ae37-1e7cb4a485d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Best,
Eren

geraldo dev

unread,
Apr 30, 2018, 9:23:10 AM4/30/18
to Eren Başak, citus-users
What I like about the combination of uuid for tenant_id + biginteger or integer is the ability to use the index as natural order for browsing data.


2018-04-30 10:15 GMT-03:00 Eren Başak <er...@citusdata.com>:
Geraldo,

I think both are totally fine for Citus. Maybe except serial (instead of bigserial) if you expect to store a lot of data.

As an application developer though, I would go with UUID as PK or partition column, because they tend to cause less confusion between entities and easier to use in case of  multiple data sources.

Best,
Eren

On Sun, Apr 29, 2018 at 3:17 PM geraldo dev <geral...@gmail.com> wrote:
Hi,

What are the pros/cons of uuid for parition column + bigserial for uniqueness ?

It seems that citus supports bigserial, serial columns.

On a new application, do you advise the use of bigserial ?

Regards,

Geraldo



--
You received this message because you are subscribed to the Google Groups "citus-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to citus-users+unsubscribe@googlegroups.com.

To post to this group, send email to citus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/citus-users/b3811f78-7419-4107-ae37-1e7cb4a485d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Best,
Eren

Eren Başak

unread,
Apr 30, 2018, 9:28:26 AM4/30/18
to geraldo dev, citus-users
Again, not as a Citus engineer but as an app developer, I would prefer to do any kind of ordering via a timestamptz column. If that is not possible for you, then using a biginteger with a unique index should be fine. 

On Mon, Apr 30, 2018 at 4:23 PM geraldo dev <geral...@gmail.com> wrote:
What I like about the combination of uuid for tenant_id + biginteger or integer is the ability to use the index as natural order for browsing data.

2018-04-30 10:15 GMT-03:00 Eren Başak <er...@citusdata.com>:
Geraldo,

I think both are totally fine for Citus. Maybe except serial (instead of bigserial) if you expect to store a lot of data.

As an application developer though, I would go with UUID as PK or partition column, because they tend to cause less confusion between entities and easier to use in case of  multiple data sources.

Best,
Eren

On Sun, Apr 29, 2018 at 3:17 PM geraldo dev <geral...@gmail.com> wrote:
Hi,

What are the pros/cons of uuid for parition column + bigserial for uniqueness ?

It seems that citus supports bigserial, serial columns.

On a new application, do you advise the use of bigserial ?

Regards,

Geraldo



--
You received this message because you are subscribed to the Google Groups "citus-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to citus-users...@googlegroups.com.

To post to this group, send email to citus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/citus-users/b3811f78-7419-4107-ae37-1e7cb4a485d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Best,
Eren

--
Best,
Eren
Reply all
Reply to author
Forward
0 new messages