Avatar of krunalshahcodes
Technical Lead at Infynno Solutions·
Needs advice
on
MongoDBMongoDB
and
PostgreSQLPostgreSQL

I want to store the data retrieved from multiple APIs and perform some analytics on it. The data stored in DB will never/hardly change. First, I thought it would be better to retrieve the data and create table columns for them, but some data might have different columns than others. So I thought about storing the JSON response from API directly to the table and use it. So which database will be the better choice, PostgreSQL or MongoDB.

READ LESS
7 upvotes·271K views
Replies (6)
Avatar of rapatao
Staff Software Engineer at rapatao.com·
Recommends
on
MongoDBMongoDB

I don't have an unquestionable opinion regarding your use case. I only trend to pick the MongoDB since it is schemaless avoiding null columns that you not always know when it is used (it depends on the source of the data). The only drawback that I could consider is the query's complexity in MongoDB, sometimes it is a bit tricky, when compared to the traditional SQL queries.

READ MORE
3 upvotes·259.3K views
Avatar of nikhilgurnani
Sr. Backend Engineer at Grappus·
Recommends
on
MongoDBMongoDB

Hey Krunal, your requirement sounds pretty clear and specific to what you want to do with that data. My recommendation to you, would be to use MongoDB. Since schema-less IO is faster in MongoDB, your general speed of reading / writing from and to the database would be quick. Additionally, the aggregate framework is very powerful with large data so that is also something that you can use in computing your analytics.

READ MORE
8 upvotes·263.3K views
View all (6)
Avatar of Luiz H. Rapatão

Luiz H. Rapatão

Staff Software Engineer at rapatao.com