Data Science

When should I choose a NoSQL database over a traditional SQL database for Data Science?

RO Asked by Robert Wilson · 12-03-2024
▲ 0 upvotes 15,732 views 0 comments
The question

I'm designing a data pipeline for a social media sentiment analysis tool. We are expecting a huge volume of unstructured text data and rapid schema changes as we add new features. In this scenario, is a NoSQL solution like MongoDB or Cassandra always better than a structured PostgreSQL setup?

 

3 answers

▲ 0
MA
Answered on 14-03-2024

For a social media project with unstructured text and frequent schema updates, NoSQL is definitely the stronger candidate. SQL databases require a predefined schema, which can lead to significant downtime and migration headaches every time you want to store a new type of metadata from a social API. MongoDB’s document-based structure allows you to store JSON-like objects directly, which is perfect for varied tweet or post data. However, keep in mind that if you need complex joins or strictly ACID-compliant transactions for financial data related to the project, PostgreSQL’s JSONB support offers a decent middle ground, though it won't scale as easily horizontally as Cassandra. 

▲ 0
DA
Answered on 16-03-2024

What about the read/write speed requirements? If you are doing real-time sentiment tracking, does the eventual consistency model of many NoSQL databases pose a risk to the accuracy of your live dashboards? 

MI 17-03-2024

David, for sentiment analysis, eventual consistency is rarely an issue. Since you are looking at aggregate trends over time rather than a single source of truth for a bank balance, the high write-throughput of NoSQL far outweighs the need for immediate global consistency.

▲ 0
EL
Answered on 19-03-2024

If your data is mostly graphs of connections between users, you might actually want to look at a Graph Database like Neo4j instead of just general NoSQL. 

RO 20-03-2024

Elizabeth is right. If the "relationship" between followers is as important as the text they post, a graph database provides much faster query performance for social network analysis.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Still have questions? Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Book Free Session

Book Free Session