Data Modeling Basics – PostgreSQL vs. Cassandra vs. MongoDB
Application developers usually spend considerable time evaluating multiple operational databases to find that one database that’s best fit for their workload needs. These needs include simplified data modeling, transactional guarantees, read/write performance, horizontal scaling and fault tolerance. Traditionally, this selection starts out with the SQL vs. NoSQL database categories because each category presents a clear set of trade-offs. High performance in terms of low latency and high throughput is usually treated as a non-compromisable requirement and hence is expected in any database chosen.
This post aims to help application developers understand the choice of SQL vs. 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. In a follow-on post, we will cover advanced topics such as indexes, transactions, joins, time-to-live (TTL) directives and JSON-based document data modeling.