Closed Bug 875945 Opened 12 years ago Closed 12 years ago

Change login server DB backend to MySQL with live migration, change UUID from email to a number

Categories

(Webmaker Graveyard :: Login, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sedge, Assigned: sedge)

References

Details

(Whiteboard: s=20130722 p=1)

Attachments

(1 file)

There are two things that must be reviewed with regards to the Login server's persistent data storage: 1) Should we be using MongoDB? 2) Should we be using the user's email as their UUID in the database we choose? Currently, we ARE using MongoDB, and we ARE using a Webmaker's email as their UUID. There are going to be implications to changing either or both of these, and this bug should clear those up.
1) Nah, we're not really storing data like that 2) No, just an auto-incrementing ID
To sum up: 1) Let's get the login tests landed (bug 873091) 2) Let's move to MySQL (needs new bug) 3) Let's drop ._id and use an auto increment field (this can happen in 2) above) Next question: In webmaker-loginapi we use an "ID" for getUser and isAdmin, see https://github.com/humphd/node-webmaker-loginapi/blob/master/index.js#L41. There are going to be some cascading implications for the move to an integer from an email here, since many clients are going to have the email via Persona routes of one kind or another. Once 1-3 are done above, we need to carefully trace the use of `id` through *.webmaker.org. CC'ing some folks who should be aware of this.
Depends on: 873091
Did this get accomplished? I think it did, but want to be sure before just closing it out.
It didn't get done and I don't know if attempting to do this with 2 days until we hit the ON button is a good idea. But maybe it is, since it means we won't need to migrate any data from mongodb to mysql...
Assignee: nobody → kieran.sedgwick
Summary: Review database approach for the Login server → Change login server DB backend to MySQL
Blocks: 890036
This patch includes switching the primary key from a user's email to a generated UUID.
Attachment #772845 - Flags: review?(schranz.m)
Attachment #772845 - Flags: review?(david.humphrey)
Attachment #772845 - Flags: review?(schranz.m)
Attachment #772845 - Flags: review?(david.humphrey)
Attachment #772845 - Flags: review?(schranz.m)
Attachment #772845 - Flags: review?(david.humphrey)
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 Looking good, but see the pull request for all of my comments.
Attachment #772845 - Flags: review?(schranz.m) → review-
Attachment #772845 - Flags: review- → review?(schranz.m)
Attachment #772845 - Flags: review- → review?(schranz.m)
Attachment #772845 - Flags: review?(chris)
Attachment #772845 - Flags: review?(schranz.m) → review+
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 This looks great, left a bunch of comments in the PR. awesome stuff!
Attachment #772845 - Flags: review?(chris) → review-
Attachment #772845 - Flags: review- → review?(chris)
Attachment #772845 - Flags: review?(david.humphrey)
Attachment #772845 - Flags: review?(chris)
Attachment #772845 - Flags: review?(david.humphrey)
Attachment #772845 - Flags: review?(chris)
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 A bunch of comments/questions in the PR. I should probably look at this again when it's been through a round of fixes.
Attachment #772845 - Flags: review?(david.humphrey) → review-
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 1 more major revision, then flagging you again.
Attachment #772845 - Flags: review?(jon) → review-
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 Looking great, will review again when you push up your next set of fixes and moar testz.
Attachment #772845 - Flags: review?(chris) → review-
Attachment #772845 - Flags: review- → review?(chris)
Summary: Change login server DB backend to MySQL → Change login server DB backend to MySQL, change UUID from email to a number
Blocks: 882970
Whiteboard: c=login s=2013w29
Whiteboard: c=login s=2013w29 → s=2013w29 p=1
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 Unassigning from myself while Kieran does some code changes
Attachment #772845 - Flags: review?(jon)
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 They were good times. I laughed, I cried, I - well, I mostly cried. Lets get 'er done!
Attachment #772845 - Flags: review?(jon)
Attachment #772845 - Flags: review?(jon) → review?(schranz.m)
Blocks: 890538
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 Added Jon back to review for testing towards deployment on production. I'm leaving Matt on for code review.
Attachment #772845 - Flags: review?(jon)
Summary: Change login server DB backend to MySQL, change UUID from email to a number → Change login server DB backend to MySQL with live migration, change UUID from email to a number
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 Jon, can you help me understand why you want the code base to basically carry two systems? Why force someone to keep mongo and mysql running? Why are we changing how we have always done things (migration scripts) to keeping around extra code that really isn't needed? Personally, I'm against it and don't understand why this decision was made. Can you help me here?
Attachment #772845 - Flags: review?(schranz.m) → feedback?(jon)
Whiteboard: s=2013w29 p=1 → s=20130722 p=1
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 If support for mongodb is completely removed, there's going to be downtime while we migrate user accounts from mongodb to mysql. And this wouldn't just be downtime for some portions of the site, it'd be for all of *.webmaker.org & *.makes.org. It's more of a technical burden for us to carry, but I don't expect us to carry it for long. Once it's been landed, we can write a migration script to move the webmaker accounts that haven't been migrated yet. Once they've all been migrated, then we can have a follow-up patch to remove the mongodb bits left in login.webmaker.org.
Attachment #772845 - Flags: feedback?(jon)
mjschranz, jbuck - To make it less of a development burden, I can make mongoDB an optional dev dependancy using an environment variable (or procfile).
This patch being landed is now more dependant on the (lengthy) review process than it is on my attention to the bug, so I'm moving on to other work. As reviews happen, which I assume they will as soon as there's time for them, I'll come back to this.
Found a bug here, if fullName is null then the SQL insert fails. Checking on prod shows: > db.users.count({fullName: null}) 631 I'll need to fix this up before we ship this to staging
Comment on attachment 772845 [details] [review] https://github.com/mozilla/login.webmaker.org/pull/127 r+ with the deployment problem noted above. I'll need to fix that, then this can be merged to staging
Attachment #772845 - Flags: review?(jon) → review+
This patch is up and running on staging - I'm keeping this bug open until we have it running properly on production.
Running on prod! Heck yeah!
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: