lucasmontano / twitch

[EBS] Channel's Top Visitors
https://www.twitch.tv/lucas_montano
119 stars 15 forks source link

Store points in a database #12

Closed lucasmontano closed 4 years ago

lucasmontano commented 4 years ago

https://devcenter.heroku.com/articles/mongolab or https://devcenter.heroku.com/articles/ormongo

fernandovfilho commented 4 years ago

You can use Heroku Postgres as database, it's free until 10k rows, to activate this access "Resources" find the add-on "Heroku Postgres".

HenriqueDerosa commented 4 years ago

What else would be stored in this database ?

lucasmontano commented 4 years ago

@HenriqueDerosa for now just the username of the participants and their points :)

HenriqueDerosa commented 4 years ago

@lucasmontano I asked because maybe we could use a mongodb instead of a relational database. I don't know. But it depends. Maybe you're gonna do some relations in an unknown future 👀

OvictorVieira commented 4 years ago

As it is a simple application initially that will record only the participant's name and points, wouldn't it be good to use a mongo in this case??

The mLab on heroku has 496mb of memory for free use, what do you think?

mLab Heroku: https://elements.heroku.com/addons/mongolab

Using Postgres, I see that we can be limited to the 10k of records that it provides, allowing us to create only 10k of users in the table and so we would be somewhat limited. I had this problem when I went to create some records with a routine that I created and the government API had 40k of data to insert, I was limited in this question of the bank.

lucasmontano commented 4 years ago

That's a good point @OvictorVieira "496 MB" will allow us to store more than 10k participants/points

lucasmontano commented 4 years ago

@HenriqueDerosa I think we can move away from a relational database indeed. Most ideas I have in my mind for the future are related to aggregated data. Mongolab on Heroku seems like a good start.

lucasmontano commented 4 years ago

I did a quick research about ObjectRocket vs mLab: IMO mLab seems more reliable as it's part of MongoDB (acquired in 2018). Do you have a diff opinion?

OvictorVieira commented 4 years ago

@luacsmontano Analyzing ObjectRocket and seeing his plans, apparently he doesn't have an initial free plan, that is, to use the service you need to pay a plan $ 46 / month. In mLab, you have an initial free plan.

lucasmontano commented 4 years ago

@OvictorVieira but even on mLab, I have to add my credit card. I'm not willing to do this right now, so I think I'll go back to the postgress approach (It's free and we don't need to add credit card) =(

OvictorVieira commented 4 years ago

To use some addons in heroku it is necessary to add the credit card. :~/

We have another option, what do you think of Mongodb Atlas? It is a service external to heroku but it is free, it has an initial plan with 512mb of storage and it is a service maintained by Mongodb. @diego3g used it in a video on his channel once.

HenriqueDerosa commented 4 years ago

Once I did my account in mLab. I didn't use that much, but I was checking here, and I didn't have to add my credit card. 🤔 But we could check Mongodb Atlas as @OvictorVieira said as well.