Spaceface16518 / strat-collector

Combs through a specific subreddit for posts with over a certain threshold in comments. It then adds them to a database.
MIT License
2 stars 0 forks source link

MongoDB #14

Open Spaceface16518 opened 6 years ago

Spaceface16518 commented 6 years ago

Intro

MongoDB is a NoSQL databasing service offered by Mongo. Here is a tutorials point tutorial for mongodb. We are going to be using mongodb with node, so here is a tutorial from w3.

Details

MongoDB, being a nosql database, stores key-value pair. This is exactly what we want for this. Their free plan offers 512 MB of storage, which is more than enough for us. Although mongo is written in C++, the databasing format looks almost exactly like JavaScript object literal. MongoDB has many advantages for this project. It could be easily integrated, and it could be easily accessed by more than one app.

With MongoDB, we can push items to a database faster. Because of how the key-value system is formatted, it would not be that much of a stretch to just push the data raw from reddit into the database. This may or may not be a good idea:

Pros Cons
easy to implement may not be secure
A fast database service Limited storage and RAM
written like javascript Small differences may become confusing
integrates with NodeJS May become less efficient when integrated

MongoDB is a great way to store strats, and is a great alternative to sql, or other database options. It will take some effort, but mongo can be integrated very nicely.

Summary

MongoDB comes with many advantages, and integrating it into this project is a good idea.

Notes

Spaceface16518 commented 6 years ago

As of commit a842a14 on branch mongoose, transitioning from mongo client to mongoose.