[wp-hackers] Time to change GUID to UUID?
eric at eam.me
Sun May 8 14:38:47 UTC 2011
Lynn, using your example the only real way to guarantee global uniqueness
for the GUIDs would be to use some kind of external service that keeps
track. I say this, because even hashes can (theoretically) repeat for
Some suggestions I've seen for making GUIDs into real GUIDs (in this thread
and in the past:
- Use the UUID feature of MySQL
- Hash the URL of the post
- Hash the URL of the post with a hash of the content
- Hash the URL of the post with the site name as a salt
In isolation, none of these can be guaranteed as unique against other sites.
If we were to use one of any of them, we'd still potentially run into your
problem of person B taking over an abandoned site and ending up with a GUID
that duplicates a value used by the previous site owner. True, it'd be a
rare case, but a real possibility.
I agree that we should make GUIDs resemble something other than a URL and
that they should be unique across a site ... but do we also want them to be
unique across an entire multisite network? Across all WordPress blogs? If
we want to make them unique between different sites ... what's the best way
to do that?
On Sat, May 7, 2011 at 7:51 AM, Lynne Pope <lynne.pope at gmail.com> wrote:
> On Sat, May 7, 2011 at 5:14 AM, Andrew Nacin <wp at andrewnacin.com> wrote:
> > On Fri, May 6, 2011 at 12:19 AM, Lynne Pope <lynne.pope at gmail.com>
> > > Does anyone know why this isn't being changed? Are there only a very
> > of
> > > us that see non-unique GUID's?
> > It's definitely been considered, especially since we've now bumped our
> > required versions. MySQL UUIDs, though, have issues when it comes to
> > replication. Ultimately, a post's GUID can't be considered globally
> > Just unique across the site/network. Given that GUIDs are only used for
> > feeds, this is acceptable. If a plugin may wish to leverage their
> > "GUID-ness" for something else, then your mileage may vary.
> > Nacin
> The problem is, as things stand, they are not unique across even a site.
> It's not difficult to get duplicate GUID's within a site. However, also
> consider this (it's a real world scenario).
> Person A has a WordPress blog on example.com. The blog is moved to
> example2.com and example.com is abandoned.
> Person B gets their new domain, example.com. B has no clue that the domain
> has ever had WordPress installed. B starts a blog on example.com.
> Person A has had GUID's of http://example.com/?p=123
> Person B has GUID's of http://example.com/?p=123
> These are not unique GUID's, even to that domain. They represent different
> content with different owners.
> Currently, the only way to avoid this happening is for someone to
> delete all content from a domain and keep their site around long enough for
> the feed readers to remove the content from their cache.
> I don't mean to come across as though I am beating a dead horse however
> is right about the replication issue and, ultimately, I can see great
> benefits (and reduction of confusion for users) in moving to real UUID's.
> I hope that this will be reconsidered.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers