lucasmontano / magic-link

Generate, send and validate a magic link.
MIT License
106 stars 13 forks source link

Define database and add to the ReadME #7

Closed lucasmontano closed 4 years ago

lucasmontano commented 4 years ago

Define which database we're going to use for storing the confirmed votes(JWT), current poll options, current poll results.

Confirmed votes payload

{
  "options": ["PHP", "JAVA", "Python"],
  "identifier": "email@domain.com"
}

Vote stored

_id: identifier hash
vote: payload

Note: Each vote is transformed into a JWT and stored in the database.

Current Poll options

{
  "options": ["PHP", "JAVA", "Python"]
}

Current Poll result

{
  "result": "Python"
}
ArthurFleischman commented 4 years ago

first, do you guys prefer sql or nosql?

ArthurFleischman commented 4 years ago

my opinion is to use mysql, pretty simple and straight forward...

mateushnsoares commented 4 years ago

I prefer NoSQL, because the project does not need many correlations. I think a MongoDB is a good idea and use MongoDB Atlas to facilitate utilization is also a good idea and about the library to manipulate the database that I'm thinking of PyMongo but I will look for more.

ArthurFleischman commented 4 years ago

@MateusSoares895 nice opportunity for me to learn nosql... never needed ....

davioliveira-dev commented 4 years ago

So, guys, I believe that the best option for the project will be the Firebase, the Firebase documentation itself teaches how to configure with REST APIs integrated with real-time. Another lib that also helps a lot is the pyFirebase. I've seen projects implementing and it looks great. I agree with @MateusSoares895 not to use SQL because the project does not have many relationships, NoSQL would speed up a lot since we only have 12 hours.

jbarbosaamancio commented 4 years ago

This project is a good opportunity for used NoSQL and to me learn NoSQL

mateushnsoares commented 4 years ago

@jbarbosaamancio and @ArthurFleischman the nosql databases are a good idea when we don't have many relationships because it helps to speed up and facilitate the coding, simplifying the code

ArthurFleischman commented 4 years ago

So, guys, I believe that the best option for the project will be the Firebase, the Firebase documentation itself teaches how to configure with REST APIs integrated with real-time. Another lib that also helps a lot is the pyFirebase. I've seen projects implementing and it looks great. I agree with @MateusSoares895 not to use SQL because the project does not have many relationships, NoSQL would speed up a lot since we only have 12 hours.

no, the goal here is "learn python" not "make it work"....

nataneb32 commented 4 years ago

MongoDB. It's easier to use than MySql in Python. If we use SQL we would need to implement migration and since we are using flask, that different from Django, doesn't have a ready for work implementaion of database let's use MongoDB.

lucasmontano commented 4 years ago

We don't need relations between entities, so we don't need a relational database. NoSQL sounds like a better option here.

In the first edition of #umaStackQueNaoDomino we choose MongoDB, it's free to use on Heroku. As we're going to keep using Heroku in the second edition, I think it makes sense to use MongoDB again.

omurilo commented 4 years ago

According @codeshow pyMongo not is asynchronous and as the Fast API is, I think we will need to find an alternative noSQL that is asynchronous.

davioliveira-dev commented 4 years ago

@omurilo So, between Firebase or MongoDB, for this project, which is the best? I think Firebase is asynchronous ...

jbarbosaamancio commented 4 years ago

May if use async functions with MongoDB in the Python see in this link Async/await MongoDB in Python