{"id":2285,"date":"2009-07-15T13:36:18","date_gmt":"2009-07-15T21:36:18","guid":{"rendered":"http:\/\/mozillalabs.com\/?p=2285"},"modified":"2009-07-15T13:36:18","modified_gmt":"2009-07-15T21:36:18","slug":"weave-usernames-and-case-sensitivity","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/labs\/2009\/07\/weave-usernames-and-case-sensitivity\/","title":{"rendered":"Weave usernames and case-sensitivity"},"content":{"rendered":"<p>We&#8217;ve noticed that a majority of users who complain about not being able to change their password or even login are unable to do so because Weave treats usernames in a case-sensitive manner. If you don&#8217;t happen to remember the exact capitilization of your username at the time of registration, there is very little you can do short of creating a new account. We recognize that this is an important issue and are looking to address it. Case-insensitive usernames should result in fewer confused users and an all-round better experience for anyone dealing with Weave accounts.<\/p>\n<p>As Weave is continously growing, doing this is no longer a trivial task. We service thousands of users everyday, so our main goals for making the switch are to minimize distruptions, not cause any data loss and have the change be completely transparent to end-users.<\/p>\n<p>Let&#8217;s take a look at what needs to happen to implement this &#8212; this also presents an opportunity for us to talk about how Mozilla&#8217;s servers are architected to provide <a href=\"https:\/\/services.mozilla.com\/\">services.mozilla.com<\/a>. Currently, we have one &#8220;cluster&#8221; of servers servicing around 28,000 users. Each &#8220;cluster&#8221; consists of an OpenLDAP instance &#8211; a replica of our master LDAP server which stores user information, and a set of database servers running MySQL that store user data. The frontend to each cluster runs the <a href=\"http:\/\/hg.mozilla.org\/labs\/weaveserver\/\">weaveserver<\/a> code, while authentication against LDAP is managed by internal scripts. We&#8217;re going to merge these two into the weaveserver codebase for 0.5, but until then, we&#8217;re managing authentication (including account creation) and storage seperately.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-2364 alignnone\" src=\"http:\/\/blog.mozilla.org\/labs\/files\/2009\/07\/weave_server_arch.png\" alt=\"Architecture of the Weave Servers\" width=\"444\" height=\"387\" srcset=\"https:\/\/blog.mozilla.org\/labs\/files\/2009\/07\/weave_server_arch.png 561w, https:\/\/blog.mozilla.org\/labs\/files\/2009\/07\/weave_server_arch-300x261.png 300w\" sizes=\"(max-width: 444px) 100vw, 444px\" \/><\/p>\n<p>This cluster approach allows us to scale &#8212; users are assigned clusters based on a hash of their usernames. Though we&#8217;re running just a <a href=\"https:\/\/sj-weave01.services.mozilla.com\/\">single cluster<\/a> now, we&#8217;re going to be adding more as we push towards a 1.0 release for Weave, and as the number of users grow.<\/p>\n<p>In order to migrate all of our users to case-insensitive usernames, we need to:<\/p>\n<ul>\n<li>Update the registration script to generate correct LDAP entries upon account creation.<\/li>\n<li>Update existing LDAP entries by lowercasing usernames.<\/li>\n<li>Update existing MySQL entries by lowercasing usernames.<\/li>\n<li>Update the authentication and weaveserver code so that it lowercases all usernames in incoming requests.<\/li>\n<\/ul>\n<p>We chose this strategy because it means we can make usernames case-insensitive without changing any client-side code &#8212; no updated versions of the Weave Sync extension are needed and the server-side changes will be transparent to our users. We do need to take the service down for a couple of hours while we perform changes on the database(s). Based on activity logs we&#8217;ve determined that the service is least active on weekends and thus, we are going to perform the switch this <strong>Sunday, 7\/19 from 10:00A.M. PDT<\/strong>.<\/p>\n<p>We&#8217;re tracking the process in <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=502738\">this bug<\/a>. Feel free to chip in with comments here or on the bug, we&#8217;d love to hear what you think!<\/p>\n<p><strong>UPDATE: <\/strong>The migration process is now complete. If you run into any issues, please do let us know \ud83d\ude42<\/p>\n<p><em>\u2013 Anant Narayanan, on behalf of the Weave development team<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve noticed that a majority of users who complain about not being able to change their password or even login are unable to do so because Weave treats usernames in a case-sensitive manner. If you don&#8217;t happen to remember the &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/labs\/2009\/07\/weave-usernames-and-case-sensitivity\/\">Continue reading<\/a><\/p>\n","protected":false},"author":246,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[22912],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/posts\/2285"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/users\/246"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/comments?post=2285"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/posts\/2285\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/media?parent=2285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/categories?post=2285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/labs\/wp-json\/wp\/v2\/tags?post=2285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}