C
C#ā€¢8mo ago
F

āœ… Noob setting up a Database for a school project.

So if we imagine you're tasked with setting up a Database. There'll be a table called USER: And within that there's: Id Name Username Password Telephone (Phone verification) Email (Email Verification) Interests. The Email/Username and Password are login parameters. Should one store them in the same Table as User? I'm looking at using Azure to store the Database (using MySQL, never used this before) How would you store the Email/Username and Password in a secure manner? ALSO: Would SSO need its own table structure? I'm looking into that as well but in the future.
34 Replies
Pobiega
Pobiegaā€¢8mo ago
You wouldn't store the password, you would store a passwordhash The username (or email, I'd you can log in by email) must be plaintext, no way around that I'd also strongly urge you to not use MySql Mssql or Postgres are both much much better alternatives
F
FOPā€¢8mo ago
Oh right, we're hashing the password as well. And that's a good shout
Pobiega
Pobiegaā€¢8mo ago
And for azure, mssql (aka SQL server) is the default
F
FOPā€¢8mo ago
so the thing is; we're doing a school project where we're simulating a full on company. I'm in the Backend team; We have a Frontend team, UX and DevOPS. The DevOPS requested us to use MySQL for some reason.
Pobiega
Pobiegaā€¢8mo ago
Tell them they are idiots :p But sure, if that's their call then go with it It won't stop you, just be annoying
F
FOPā€¢8mo ago
Hahaha, i've only been using MSSQL so thats what i'd prefer. But if it's that much of a hassle; I guess i'll raise this tomorrow with them šŸ˜® Once again, thanks a ton @Pobiega šŸ˜„
Pobiega
Pobiegaā€¢8mo ago
MySQL is largely considered deprecated in the tech world It's just not competitive from any angle with the alternatives available
F
FOPā€¢8mo ago
i understand; according to what i've been told "If you can use MySQL it would make our jobs much easier"
Pobiega
Pobiegaā€¢8mo ago
Id recommend reading up on something called argon2 for your password hashing
F
FOPā€¢8mo ago
I've never used it before; So i've been more or less trying it.
Pobiega
Pobiegaā€¢8mo ago
It's a state-of-the-art algorithm which is easy to use
F
FOPā€¢8mo ago
We already have a Password Hashing system; But that fell on one of my classmates
Pobiega
Pobiegaā€¢8mo ago
Ok That's fine
F
FOPā€¢8mo ago
I believe he used a finished Nuget package.
Pobiega
Pobiegaā€¢8mo ago
How are you communicating with the database? Ado.net? Dapper? EF core?
F
FOPā€¢8mo ago
EFCore all the way
Pobiega
Pobiegaā€¢8mo ago
Ok. Another reason to avoid MySQL The pomodoro connector for ef is okay, but the "official" one is a mess
F
FOPā€¢8mo ago
I looked into it; And been trying "Pomelo"
Pobiega
Pobiegaā€¢8mo ago
While mssql and npgsql are both šŸ˜ That might be the one
F
FOPā€¢8mo ago
Yeah; I've used MSSQL everytime and it hasnt let me down once šŸ˜›
Pobiega
Pobiegaā€¢8mo ago
I'd also recommend doing Code first with EF, if you can Db first is harder to handle migrations imho
F
FOPā€¢8mo ago
That's definitely how we're doing it šŸ˜® We havent decided on which parameters to use yet
Pobiega
Pobiegaā€¢8mo ago
Wdym?
F
FOPā€¢8mo ago
Like, the columns within the table and how we're going to structure it hasnt been decided yet šŸ˜® I was just looking into creating a basic structure i believe the reason the DevOPS asked us to use MySQL (and dont quote me on this)
Pobiega
Pobiegaā€¢8mo ago
Right. Well that should all be up to your team
F
FOPā€¢8mo ago
Is because they'll be using Python(?)
Pobiega
Pobiegaā€¢8mo ago
DevOps should only care about deployment/ monitoring
F
FOPā€¢8mo ago
I'm not fully aware about how DevOPS people work tbh
Pobiega
Pobiegaā€¢8mo ago
It's not like you can't connect to Postgres or mssql from python lol I doubt there will be major differences for them either way
F
FOPā€¢8mo ago
I get that; I've sent a message to my fellow classmates so we can rethink our MySQL choices XD
Pobiega
Pobiegaā€¢8mo ago
I can assure you that DevOps in any org I've ever worked for don't get to dictate tech choice. That's the dev team, or maybe CTO They ofc decide for their own stuff Like between nomad or k8
F
FOPā€¢8mo ago
Yeah i was also under that impression; But it was a wish from their department. I was mostly in on the idea because it meant i could learn a new thing and add it to my skillset; As MySQL isnt in our Curriculum but if it makes it more annoying with little to no benefit I should probably just stick with MSSQL
Pobiega
Pobiegaā€¢8mo ago
its not very different when it comes to the basics, it just has insane defaults and missing some more advanced features and if you were gonna use EFCore, you wouldnt notice the differences anyways šŸ˜„
F
FOPā€¢8mo ago
Okay that's good at least hahaha; Honestly it shouldnt be way too in depth. I just see this as an opportunity to learn something new. Thanks once again for the help @Pobiega šŸ™‚
Want results from more Discord servers?
Add your server