🌐
Yugabyte
yugabyte.com › blog › data-modeling-basics-postgresql-vs-cassandra-vs-mongodb
Data Modeling Basics - PostgreSQL vs. Cassandra vs. MongoDB | YugabyteDB
August 11, 2023 - INSERT is actually an upsert operation in Cassandra where the row is updated with the latest values in case the row already exists. Same as the PostgreSQL INSERT statements above. Even though MongoDB is also a NoSQL database similar to Cassandra, its insert operation does not have the same semantic behavior as Cassandra.
🌐
StackShare
stackshare.io › stackups › cassandra-vs-mongodb-vs-postgresql
PostgreSQL vs MongoDB vs Cassandra | What are the differences? | StackShare
Cassandra falls between the two, offering tunable consistency levels that enable trade-offs between availability and consistency. Query Language: PostgreSQL uses SQL as its primary query language, making it a good fit for applications that rely ...
Discussions

MongoDB Vs Cassandra Vs PostgreSQL Vs MySQL - Stack Overflow
General I have to store everyday 100 millions of records composed in this way: id name time. The unique key is id, but I have to do the searching on name and time. I have to chose a database like M... More on stackoverflow.com
🌐 stackoverflow.com
postgresql - For what type of data it's better to use relational, and for what type of data, non-relational databases? - Database Administrators Stack Exchange
I am trying to write my first big backend project. This is a mobile/web application like Instagram but for different purposes. As I searched through the internet I found that Instagram uses Postgre... More on dba.stackexchange.com
🌐 dba.stackexchange.com
December 1, 2022
SQL Versus NoSQL Databases: Which to Use, When, and Why
🌐 r/mongodb
4
2
April 22, 2023
Cassandra vs MongoDB vs CouchDB vs Redis vs Riak comparison

I feel like there's as many nosql versions as linux distros... Thanks for the find.

More on reddit.com
🌐 r/Database
1
19
January 4, 2011
People also ask

Which database performs better - PostgreSQL or Cassandra?
It depends on workload type. PostgreSQL performs better for complex analytical reads and relational queries, while Cassandra excels at massive, distributed write workloads such as logging, IoT, or telemetry data.
🌐
knowi.com
knowi.com › home › postgresql vs cassandra: key differences, use cases & performance
PostgreSQL vs Cassandra: When to Use Each (2026)
Is Cassandra faster than PostgreSQL?
For high-volume writes and distributed systems, yes - Cassandra is typically faster. It’s optimized for append-only writes and handles billions of records efficiently. PostgreSQL prioritizes consistency, which can add overhead under heavy write loads.
🌐
knowi.com
knowi.com › home › postgresql vs cassandra: key differences, use cases & performance
PostgreSQL vs Cassandra: When to Use Each (2026)
What is the main difference between PostgreSQL and Cassandra?
PostgreSQL is a relational SQL database designed for structured data, ACID transactions, and complex queries. Cassandra is a NoSQL wide-column database built for high write throughput, horizontal scalability, and continuous availability.
🌐
knowi.com
knowi.com › home › postgresql vs cassandra: key differences, use cases & performance
PostgreSQL vs Cassandra: When to Use Each (2026)
🌐
Reddit
reddit.com › r/database › postgresql or cassandra
r/Database on Reddit: Postgresql or Cassandra
November 8, 2024 -

Hi everyone,

I’m working on an e-commerce project with a large dataset – 20-30 million products per user, with a few thousand users. Data arrives separately as products, stock, and prices, with updates every 2 hours ranging from 2,000 to 4 million records depending on the supplier.

Requirements:

  • Extensive filtering (e.g., by warehouse, LIKE queries, keyword searches).

  • High performance for both reads and writes, as users need to quickly search and access the latest data.

I’m deciding between SQL (e.g., PostgreSQL with advanced indexing and partitioning) and NoSQL (e.g., MongoDB or Cassandra) for better scalability and performance with large, frequent updates.

Does anyone have experience with a similar setup? Any advice on structuring data for optimal performance?

Thanks!

r/PostgreSQL Apr 1, 2009
r/PostgreSQL
17y ago
Just use Postgres for everything Dec 12, 2022
r/programming
3y ago
Real life use cases Oct 1, 2023
r/PostgreSQL
2y ago
More results from reddit.com
🌐
Cloud Infrastructure Services
cloudinfrastructureservices.co.uk › home › blog › cassandra vs. mongodb vs. redis vs. mysql vs. postgresql (pros and cons)
Cassandra vs. MongoDB vs. Redis vs. MySQL vs. PostgreSQL
March 22, 2022 - Limited querying capabilities: Only a restricted number of queries are available in Cassandra for data retrieval purposes. MongoDB is a NoSQL database that is one of the most popular in the world. It’s a document-based, general-purpose database.
🌐
Knowi
knowi.com › home › postgresql vs cassandra: key differences, use cases & performance
PostgreSQL vs Cassandra: When to Use Each (2026)
3 weeks ago - Choose PostgreSQL if you need structured schemas, strong ACID transactions, and complex relational queries. Choose Cassandra if you need massive horizontal scalability, high write throughput, and always-on availability across distributed systems.
🌐
Medium
medium.com › @jerrymartejr › vector-databases-comparing-nosql-mongodb-cassandra-and-postgresql-for-ai-workloads-82e4805cc2e0
Vector Databases: Comparing NoSQL (MongoDB, Cassandra) and PostgreSQL for AI Workloads | by Jerry Marte | Medium
February 24, 2025 - If scalability is your priority, MongoDB or Cassandra might be the best fit. If you need structured AI search with powerful indexing, PostgreSQL with pgvector is a strong contender.
Find elsewhere
Top answer
1 of 1
2

(Not yet an Answer, but too long for a Comment.)

  • 120 rows INSERTed per second. Do they arrive one row at a time? Or a whole day's worth at a time? Or something else?
  • Is it a "log" file? Or CSV? Or something else? Please provide a sample.
  • What kind of "time" is provided as a 36-60 character string? Please provide a sample.
  • 10M rows per day --> 500GB per year. So the disk will fill up in one year? What part needs to change to handle the data you expect to receive?
  • Will you be purging data after, say, 90 days? (This will solve my previous point, but needs a special schema for efficiency.)
  • where field = time OR field = name is not practical. Please describe in words what the intent is. We will need to express the query some other way.
  • 100^6 = 100*100*100*100*100*100 = 1 trillion. I don't think you meant that.

(Addressing most issues...)

  • RAID, drive "journaling", etc, are partial solutions to the risk of data loss. They are handled at a lower level; nothing in SQL or MySQL configuration is involved with such.

  • Each CSV file (of 1 to INF number of rows) is best loaded via LOAD DATA. It may be better to load it directly into the main table, or it may be better to load it into a temp table, massage the data, then copy it into the main table. (I don't have enough details to predict which is better.)

  • A huge CSV file loaded directly into the main table will probably block some operations. In this case, it may be important to go through a temp table. Then, the rows could be copied into the main table in chunks, thereby minimizing impact. More on chunking: http://mysql.rjweb.org/doc.php/deletebig#deleting_in_chunks (That talks about DELETE, but can easily be adapted to the SELECT needed in your application.)

  • You say that time, by itself, is Unique? Not two events can happen in the same second?

  • name and time are unique? There are pros and cons about picking between INDEX and UNIQUE. UNIQUE will slow down INSERT because of the need to check for uniqueness before finishing the Insert. I don't (yet) see any benefit for UNIQUE over INDEX _for your application.

  • Abnormal "time" format -- Don't plan on doing ranges or comparisons other than =. As you say, think of it as a 'hash'.

  • No pruning? The data lives in this table for years? Well, what will you do about disk space if there is a 500GB/year growth rate?

  • You will have

      INDEX(name),   -- (or UNIQUE(name))
      INDEX(time)    -- (or UNIQUE(time))
    
  • The query you propose should be changed to this for performance. (? will become the same quoted 'hash'.)

      SELECT * FROM A  WHERE name = ?
      UNION ALL
      SELECT * FROM A  WHERE `time` = ?
    
  • A may need some kind of timestamp based on the log file that it came from. I would expect some queries to get thousands of results, and the user might want only "recent" results. [OK, that conflicts your statement that name and time are unique, in which case the above Select can return only 1 or 2 rows.]

  • Even if A becomes multi-terabytes, the above Select (with the above indexes) will always run in milliseconds (assuming at most 2 result rows). RAM size has essentially no impact on the speed. The disk must be big enough to hold the entire table. Furthermore, since HDD is still cheaper than SSD, it may be worth using HDD for the huge table. (The query will probably still take less than 1.0 second, regardless of configuration.)

  • If you expect the table to be bigger than 32TB, we need to do something extra. That is a hard limit, but there are ways to get around it. If this will be a problem, start a new Question that focuses only on the table size (plus table schema and main Selects). The number of rows won't hit a limit, just the byte size.

  • Since a new "log" arrives hourly (or whenever), the table in inherently not "up to date". That is, a Select won't find records that happened in the last hour or so. Hence, I don't worry about whether the loading of the CSV takes up to, say, an hour to run. The "chunking" I mentioned above add a little time, while avoiding blockage. So, I strongly think that the chunking is the "right" way to go based on the dataflow and other requirements.

  • When is id generated? Is it ever "used"? Does include the name of the log from which it came? I am asking because: it takes space, it may be slowing things down, don't you need a "log id", maybe it could be tossed, there are better things than varchar(60) to have as the PK, etc.

🌐
LinkedIn
linkedin.com › pulse › data-modeling-basics-postgresql-vs-cassandra-mongodb-sid-choudhury
Data Modeling Basics – PostgreSQL vs. Cassandra vs. MongoDB
November 23, 2018 - NoSQL in the context of the data modeling needs of an application. We use one SQL database, namely PostgreSQL, and 2 NoSQL databases, namely Cassandra and MongoDB, as examples to explain data modeling basics such as creating tables, inserting data, performing scans and deleting data.
🌐
RisingWave
risingwave.com › home › blog › cassandra vs postgresql: which database suits your needs?
Cassandra vs PostgreSQL: Which Database Suits Your Needs? | RisingWave
July 2, 2024 - While MongoDB presents a competitive option, Cassandra's robust performance in handling write-heavy operations solidifies its position as a top contender in scenarios demanding efficient query optimization strategies.
🌐
OpenLogic
openlogic.com › blog › cassandra-vs-mongodb
Cassandra vs. MongoDB: Performance and Feature Comparison | OpenLogic
In this blog, our expert compares Cassandra vs. MongoDB, including performance considerations, key features, and potential use cases.
🌐
MongoDB
mongodb.com › resources › compare › cassandra-vs-mongodb
Cassandra Vs MongoDB Comparison | MongoDB
One of these early NoSQL databases is Cassandra, a distributed database that blends a tabular store and a key-value store. MongoDB's distributed document data model is a proven alternative to Cassandra, as it can be adapted to serve many different use cases.
🌐
Medium
medium.com › @vinciabhinav7 › cassandra-vs-mongo-db-how-to-choose-e2de97a6dc45
Cassandra vs Mongo db ? How to choose ? | by Abhinav Vinci | Medium
May 30, 2024 - ... So, Broadly difference boils down to LSM based DB vs B Tree based DB. Cassandra supports faster writes compared to MongoDB as its more simpler append operation on a high level.
🌐
Airbyte
airbyte.com › data integration platform › data engineering resources › cassandra vs. mongodb: navigating the nosql landscape
Cassandra vs. MongoDB: Navigating the NoSQL Landscape | Airbyte
August 29, 2025 - For further comparisons, explore MongoDB vs PostgreSQL and visit the Airbyte blog for more database insights. Cassandra typically performs better for real-time applications requiring high write throughput and low latency, such as IoT data collection ...
🌐
Devathon
devathon.com › home › sql & nosql comparison: mysql vs (mongodb & cassandra), postgresql vs (mongodb & cassandra)
SQL vs NoSQL comparison: MySQL, PostgreSQL, MongoDB & Cassandra
February 9, 2023 - Cassandra: Popular NoSQL database, and a wide-column store ... MongoDB: MongoDB, Inc. ... MySQL: Supports C, C#, C++, Java, JavaScript (Node.js), Objective-C, Perl, PHP, Python, Ruby, and more · PostgreSQL: Supports .Net, C, C++, Java, JavaScript (Node.js), Perl, PHP, Python, and more
🌐
DEV Community
dev.to › wallaceespindola › cassandra-vs-postgresql-a-developers-guide-to-choose-the-right-database-3nhi
Cassandra vs PostgreSQL: A Developer’s Guide to Choose the Right Database - DEV Community
July 9, 2025 - GitLab, for instance, uses PostgreSQL as its primary database system. Cassandra excels in scenarios where you need to handle large volumes of data with high availability and scalability.
Top answer
1 of 3
7

may I know how to decide for what services or what type of data/application it's better to use SQL or NoSQL databases?

Use a SQL database if any combination of the following is true:

  1. You have relational data
  2. Your schema is under your control
  3. The schema you're adhering to changes at a rate that's tolerable for you to manage

Use a NoSQL database otherwise. Specifically if your schema is ill-defined and changes more frequently than you're willing to manage.

There's not many differences in use cases otherwise. NoSQL is somewhat a subset of SQL but they compliment each other in different ways too.

What about horizontal scaling? I've read that RDBMS databases have big issues in horizontal scaling for big, rapid growing projects.

Horizontal scaling aka sharding is a little gimmicky, in my honest opinion. There's a lot of room for vertical scaling with servers these days, especially with virtualization and / or cloud services.

MongoDB is one of the most mainstream NoSQL databases that are thought of when the topic of horizontal scaling / sharding comes to mind. Many inexperienced people like to exclaim how sharding makes scaling easier, cheaper, or both. But even the developers of MongoDB claim the contrary, stating sharding is problematic, hard to manage, limiting on what queries can be ran, and they even go as far as claiming vertical scaling is just more practical and cost effective (myth #5):

Sharded clusters also make your data harder to manage, and they add some limitations to the types of queries you can conduct. Sharding is useful if you need it, but it's often cheaper and easier to simply upgrade your hardware!

In fact, that same article discusses how a minimum of 8 servers are needed to properly setup sharding with MongoDB. That's surely going to be more costly with the redundancy in paying for all of the hardware in a full system for each of the 8 servers as opposed to vertically scaling your infrastructure for a specific piece of hardware. Of course there are exception cases, but generally speaking, it's hard for me to see it being cost efficient for the average user.

But even modern SQL databases support various implementations with horizontal scaling, should one feel the need to utilize this methodology. For example, SQL Server has a feature called Availability Groups which automatically synchronizes the data from one server to the other replica servers in the same group. It even offers two modes of synchronization depending on if you prioritize performance over data consistency between servers (similar, though not exactly the same, as the idea of eventual consistency normally seen with NoSQL database synchronization in a sharded topology).

Aside from all of that, when a database is optimally architected, with efficiently designed queries, a SQL database can handle a high level of concurrency for large amounts of data. SQL Server is rated to handle tables with trillions of records. I've personally worked with tables in the 10s of billions on servers that were fairly heavily transactional (1,000s of transactions per minute), with minimal hardware (16 GB of Memory, 8 CPU cores, etc), and most queries ran in under 1 second.

Some key ideas behind this are that data at rest can be any size, and it doesn't really matter from a performance perspective (for most use cases). Proper indexing which uses a B-Tree data structure, allows for optimal searching of any achievable size of data (even by big data standards in 100 years from now). That's because B-Tree's have an O(log(n)) search time complexity. That means if your table has 1 billion rows, in the worst case, it would take log2(1 billion) = 30 to find any subset of the data. If that table grew to 1 trillion rows, log2(1 trillion) = 40 to find any subset. 30 and 40 nodes of a B-Tree takes a few milliseconds for any modern computer, even with the hardware of a cellphone, to search through.

Long story short, there are no differences from a performance perspective in what any modern SQL database is capable of vs a modern NoSQL database. Most data scale problems are usually best solvable on the software side of the equation, not really the hardware side, as most performance problems are caused by poor database design / implementation and / or poorly written code (queries).

2 of 3
3

Full disclosure: I am an employee of DataStax, and a Cassandra MVP (so I'll do my best to hide any bias).

They've presented on this publicly a few times (see below), but at a high level, Instagram uses Cassandra for two big reasons:

  • Scale
  • Geographic Awareness

The way Cassandra was designed to work, is that each node in the cluster is a peer. That is, there is not a "primary" or "main" node which handles operations. Every node can handle a read or write operation, with data being replicated or coordinated from additional replicas as required.

This means that scaling horizontally is easy for something like Cassandra. As Instagram serves more than a billion daily users, from all over the world. So using the denormalized, decentralized approach of Cassandra works well in that case. Cassandra distributes data by hashing the partition key(s), and then only sends the data to the instances responsible for those hash ranges. This is why Cassandra doesn't need a sharded approach.

Of course, Instagram has made smart decisions around their data model. This means storing things together which are queried together, and ensuring that a query can be served by a single node (instance).

Instagram also has users around the world. In an effort to cut down on data retrieval times, they utilized data centers in many parts of the world to keep data geographically close to their users. Cassandra makes a good choice for this, due to its ability to separate nodes in a cluster into logical data centers (which are often geographic/cloud regions).

However, they did run into some trouble with quorum operations which started to span multiple regions. To get around that, they opted to only replicate data to certain regions.

That all being said, it's unlikely that you will need to support that type of global usage (at least not right away). So I would say not to concern yourself with Cassandra at this point. If you find yourself needing to go that route at some point, I can say that the migration will be easier if your data model has fewer join operations.

Here's a blog post taken from the DataStax Accelerate conference in 2020: How Instagram uses Cassandra to operate on a Global Scale

Here's a writeup that they did about their database infra from the context of moving from AWS to Facebook's infra: Intstagration Pt. 2: Scaling our Infrastructure to Multiple Data Centers. This article contains some infra-level details about both Cassandra and Postgres (and a few others). It doesn't go into detail on use cases, but does have links to other supporting posts.

More details available on YouTube:

  • Cassandra Traffic Management at Instagram
  • Cassandra @ Instagram (2014)
🌐
ScaleGrid
scalegrid.io › blog › cassandra-vs-mongodb
MongoDB® Vs Cassandra - Full Comparison | ScaleGrid
October 18, 2024 - MongoDB® supports a rich and expressive object model. Objects can have properties and objects can be nested in one another (for multiple levels). This model is very “object-oriented” and can easily represent any object structure in your domain. You can also index the property of any object at any level of the hierarchy – this is strikingly powerful! Cassandra, on the other hand, offers a fairly traditional table structure with rows and columns.