网站大,用户多,如何唯一识别用户
大多数网站要求用户名是唯一的。我注意到 SO 允许重复的用户名,当您拥有像 SO 这样的非常大的网站时,这可能会很好(我猜他们这样做是为了避免像 chris123、chris213、chris321 这样的用户名,这些用户名本身看起来很混乱)。但允许重复的用户名通常是一个相对较差的实现吗?从具有相同用户名的 2 个用户那里获得 2 个答案可能会令人困惑。
那么,对于拥有大量需要相互交互的用户的大型网站,还有哪些其他替代方案呢?我在想一些甚至不基于用户名的事情,但不确定是什么。
Most websites require that the username be unique. I'm noticing that SO allows duplicate usernames, which could be good when you have a very large website like SO (which I'm guessing they do to avoid usernames like chris123, chris213, chris321 which start to look confusing themselves). But is allowing duplicate usernames generally a relatively poor implementation? It can be confusing to get 2 answers from 2 users that have the same username.
So what other alternatives are there for large sites that have a large number of users that need to interact with each other? I'm thinking something that's not even username-based, but not sure what.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
虽然拥有不同的用户名(通常用于登录)几乎是绝对的要求,但只要有可辨别的方法来识别使用该系统的其他个人的实际用户,就没有理由要求显示别名是唯一的。这是讨论论坛中相当常见的做法,因为那里确实有很多“杰夫·史密斯”。例如,SO 使用用户的声誉并链接回其个人资料作为区分所涉及的实际用户的机制。不过,登录本身必须具有某种唯一性。
作为澄清我的评论的补充:
天空(和你的想象力)确实是如何唯一识别别名的限制。在标准配置文件链接之外,您可以添加其他独特的特征(如果您希望别名相对明确)。举个我没见过的例子:重新生成别名时使用独特的字体或颜色...蓝色的 sanscript Jeff Smith 与黄色的 arial Jeff Smith 不同(只是一个示例方法)
While having distinct usernames (typically used for login) is a near absolute requirement, there is no reason that the display alias has any requirement to be unique so far as there are discernable methods to identify the actual user for other individuals using the system. This is a fairly common practice among discussion forums since really there are many "Jeff Smith"'s out there. SO for example, uses the reputation of a user and links back to their profile as mechanisms in differentiating the actual users involved. The logins themselves though, must have a form of uniqueness to them.
As an addenum to clarify my comment:
The sky (and your imagination) really are the limit on how to uniquely identify an alias. Outside of the standard profile link you could add on other unique characteristics (should you want the alias to be relatively unmistakable). As an example of some I havne't seen: use unique fonts or colors when renering the alias ... the blue sanscript Jeff Smith is different than the yellow arial Jeff Smith (just an example method)
我过去在自己的网站上遇到过这种情况,我发现最好的方法是通过电子邮件地址来识别用户。
这是一个非常简单的方法,因为它允许多个用户名(或名称,就像 Facebook 一样),并且您始终可以通过数据库中的用户 ID 来识别唯一性,并在网站上显示这一点,甚至可能显示他们的用户名、头像可能还有他们的位置。
例子:
I have come across this in the past with my own website, and I find the best way is to identify a user is by their email address.
This is a very simple method, because it allows multiple usernames (or names, just like Facebook), and you can always identify uniqueness by their User ID in the database, and to show that on the website, maybe even show their username, avatar and possibly their location.
example:
我相信你有两个不同的问题;授权和个性化。
大多数网站都会坚持使用电子邮件来唯一授权某人,因为这些已经保证是唯一的。 SO 使用开放身份验证,这意味着我很长一段时间没有指定“用户名”来进行身份验证。我的 OpenID 有我的电子邮件和密码,并处理 SO 的授权部分。
另一部分是个性化,如果用户愿意,肯定应该允许他们选择重复的名称。这需要与身份验证详细信息相关联,并且通常使用站点专门生成的单独的唯一编号来完成。然后链接用于授权的用户名和要显示的用户名。我猜想这也构成了存储用户的任何数据库结构中主键的一部分。
如果您检查每个个人资料名称的链接,您将在网址中看到一个数字,这是在网站上唯一标识您的信息并与您联系
twitter
发送至您的电子邮件/用户名,以便通过号码629665
登录。您的用户页面链接是 https://stackoverflow.com/users/629665/twitter虽然我可以清楚地看到您选择的显示姓名和您在网站上的唯一 ID 我不知道您的授权身份,您可以将其保密并有助于确保您的安全。
I believe you have two distinct issues; authorisation and personalisation.
Most sites will stick with using emails for uniquely authorising someone as these are already guaranteed to be unique. SO uses open authentication which means I haven't specified a 'username' for authentication with them in a long time. My OpenID has my email and my password and handles the authorisation part for SO.
The other part is personalisation which should most certainly allow users to choose duplicate names if they so desire. This needs to be tied to the authenticating details and would normally be done using a separate unique number generated specifically by the site. This then links the username for authorisation and the username to display. I would guess that this also forms part of the primary key in whatever database structure users are stored in.
If you check the links for each profile name you will see a number in the url and this is what uniquely identifies you on the site and ties
twitter
to your email/username for login by the number629665
. Your user page link is https://stackoverflow.com/users/629665/twitterWhilst I can clearly see your chosen display name and your unique id on the site I don't know your authorising identity which you get to keep private and helps to keep you secure.
-->选择用户名并不是什么好主意。
-->也许你可以获取电子邮件 ID 和用户名。
--> Choosing username, isnt something great idea.
--> may be u can go for email id and username.
嗯,你的问题很模糊,我编辑了标题以使其更清楚。
毫无疑问如何识别用户。如果您查看 stackoverflow 用户 linfo 链接,您会注意到旧的良好自动增量唯一编号。没问题。
因此,我想你的问题是一个用户如何识别另一个用户。我认为这没什么大不了的,因为冲突非常罕见,而且人们总是可以通过用户声誉和 ID 来判断。
Well, your question is quite ambiguous, I've edited the title to make it more clear.
There is no question how to identify a user. If you look at stackoverflow user linfo link, you'll notice old good autoincremented unique number. No problem with it.
Thus, I suppose your question is how one user can recognize another. I think it's not that big deal as collisions very rare and one can always tell by user reputation and that ID.