[Pulp-dev] Integer IDs in Pulp 3

David Davis daviddavis at redhat.com
Thu May 24 15:45:29 UTC 2018


The link you sent about bulk_create seems to indicate only that the primary
key attribute on the model doesn’t get set unless you are PostgreSQL. This
ticket seems to confirm this:

https://code.djangoproject.com/ticket/19527

That seems like a big caveat but not a showstopper that would prevent us
from using bulk_create.


David

On Thu, May 24, 2018 at 11:22 AM, Austin Macdonald <amacdona at redhat.com>
wrote:

> I have a few concerns, but they all may be addressable.
>
> 1. URLs and security. If this integer is in the url, it is easy to guess
> other urls. Hopefully, our security model won't depend on obscurity, so
> maybe this isn't much of a concern.
> 2. bulk_create. Apparently, bulk_creates would work, but only with
> postgreSQL. If we accept this change, any bulk_create would make lock us in
> with postgres. [0]
> 3. Max size = 2,147,483,647? Is it conceivable that a Pulp would have more
> than 2 billion of anything?
>
> [0]: https://docs.djangoproject.com/en/1.10/ref/
> models/querysets/#bulk-create
>
> On Wed, May 23, 2018 at 2:26 PM, David Davis <daviddavis at redhat.com>
> wrote:
>
>> Before the release of Pulp 3.0 GA, I think it’s worth just checking in to
>> make sure we want to use UUIDs over integer based IDs. Changing from UUIDs
>> to ints would be a very easy change at this point  (1-2 lines of code) but
>> after GA ships, it would be hard if not impossible to switch.
>>
>> I think there are a number of reasons why we might want to consider
>> integer IDs:
>>
>> - Better performance all around for inserts[0], searches, indexing, etc
>> - Less storage required (4 bytes for int vs 16 byes for UUIDs)
>> - Hrefs would be shorter (e.g. /pulp/api/v3/repositories/1/)
>> - In line with other apps like Katello
>>
>> There are some downsides to consider though:
>>
>> - Integer ids expose info like how many records there are
>> - Can’t support sharding or multiple dbs (are we ever going to need this?)
>>
>> [0] http://kccoder.com/mysql/uuid-vs-int-insert-performance/
>>
>> David
>>
>> _______________________________________________
>> Pulp-dev mailing list
>> Pulp-dev at redhat.com
>> https://www.redhat.com/mailman/listinfo/pulp-dev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20180524/ec6283c1/attachment.htm>


More information about the Pulp-dev mailing list