You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More of a curiosity for something very long-term ...and by long term I mean years and in terms of simplifying netbox to be easier to manage and establish multi-region clusters and eventual consistency.
One of the thoughts I had was about primary key conflicts between independent PG clusters. Other applications that cluster well don't use integer PKs because of the potential for conflicts between clusters and as such they tend to look at globally unique IDs... UUIDs or GUIDs.
My experience of this, however, is that there's a significant cost to using UUIDs as the PK for objects, since the database has to recaculate the indexes a lot more to support the less character efficient encoding of UUIDs, lack of stable mac addresses (v1/v2), suitable mechanisms for setting the random seed (v3/v5) and data structure fragmentation and randomness (v4).
I personally favour ULIDs for this purpose since it would allow for 1.24e+24 unique ULIDs per milisecond, it's lexigraphically sortable and encoded into a neat 26 character string among other benefits, one of which being monotonic sort order.
Are there any plans afoot to change the PK for objects from the standard int in Django to something like ULID?
I recognise that this would be a massive departure and an extremely complex change to manage, but looking into the future, simplifying and removing roadblocks for resilience would inevitably be a massive benefit to the wider community. I note that Netbox already has the foundation of a replication mechanism using Diode, gRPC et al. Add in a message-bus like RabbitMQ, NATS or Kafka and there's a vague whisp of an extremely resilient multi-region, clusterable application...
I suspect this discussion will disappear into pit of discussions.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
More of a curiosity for something very long-term ...and by long term I mean years and in terms of simplifying netbox to be easier to manage and establish multi-region clusters and eventual consistency.
One of the thoughts I had was about primary key conflicts between independent PG clusters. Other applications that cluster well don't use integer PKs because of the potential for conflicts between clusters and as such they tend to look at globally unique IDs... UUIDs or GUIDs.
My experience of this, however, is that there's a significant cost to using UUIDs as the PK for objects, since the database has to recaculate the indexes a lot more to support the less character efficient encoding of UUIDs, lack of stable mac addresses (v1/v2), suitable mechanisms for setting the random seed (v3/v5) and data structure fragmentation and randomness (v4).
I personally favour ULIDs for this purpose since it would allow for 1.24e+24 unique ULIDs per milisecond, it's lexigraphically sortable and encoded into a neat 26 character string among other benefits, one of which being monotonic sort order.
Are there any plans afoot to change the PK for objects from the standard int in Django to something like ULID?
I recognise that this would be a massive departure and an extremely complex change to manage, but looking into the future, simplifying and removing roadblocks for resilience would inevitably be a massive benefit to the wider community. I note that Netbox already has the foundation of a replication mechanism using Diode, gRPC et al. Add in a message-bus like RabbitMQ, NATS or Kafka and there's a vague whisp of an extremely resilient multi-region, clusterable application...
I suspect this discussion will disappear into pit of discussions.
~ R
Beta Was this translation helpful? Give feedback.
All reactions