Sunday 31 May 2020

Which database option should I choose?

So I'm trying to create an API using the MongoDB free tier resources and inserting/updating data I scrape daily.I've looked online for how to update all documents if their records already exist in my collection and I read that I would need to use a forEach loop and go over each record to see whether it needs to be updated or not. But isn't that very inefficient?Another (lazy) option I guess would be to drop the collection and re-upload the freshly scraped data (because that will have the most up-to-date values.)If we consider an SQL database by using the UPDATE query I could do this pretty easily (but isn't it the same as a for-each loop under the hood also) and not worry about storage too much because unlike MongoDB there are completely free database options.Also please correct me if I'm wrongThanks in advance : )

Submitted May 31, 2020 at 06:23PM by nebling

No comments:

Post a Comment