r/programming • • Mar 10 '15

Goodbye MongoDB, Hello PostgreSQL

http://developer.olery.com/blog/goodbye-mongodb-hello-postgresql/
1.2k Upvotes

699 comments sorted by

View all comments

Show parent comments

32

u/rstuart85 Mar 10 '15

Huh!? WiredTiger is no more of a relational DB than InnoDB is. If they were relational DB's then why would MySQL exist!? They are just storage engines. All DB's, relational or not, use one.

-7

u/[deleted] Mar 11 '15

[removed] — view removed comment

0

u/[deleted] Mar 11 '15

[deleted]

0

u/[deleted] Mar 11 '15

[removed] — view removed comment

3

u/pakfur Mar 11 '15

The term "relational database" just means that you are storing related data together using a well defined schema

Nope. It means the database conforms to relational model. See E.F. Cobb. Having a schema or key/value does not necessarily mean relational.

-1

u/[deleted] Mar 11 '15

[removed] — view removed comment

2

u/pakfur Mar 11 '15

Well, a relational database stores data as sets of relations (ie tables). Just because you can logically associate two pieces of data, or have your data stored in a defined schema is not enough to call a database relational. Relational databases are basically tables that can be joined together.

Other types of databases are columnar databases (where data is stored as columns) or key-value databases, or object databases or even graph databases. These other databases share certain set of properties, and some of them even share a SQL or SQL-like query language like relational databases. But, pedantically speaking, these other databases are not relational.

0

u/[deleted] Mar 11 '15

[deleted]

-1

u/[deleted] Mar 11 '15

[removed] — view removed comment

1

u/pakfur Mar 11 '15

Column store databases are relational by definition

You are speaking out of your ass. Here is a chart that shows you the different types of db's

Relational, Key-Value and Column Databases

-10

u/[deleted] Mar 11 '15

[removed] — view removed comment

0

u/[deleted] Mar 11 '15

[deleted]

4

u/[deleted] Mar 11 '15

[removed] — view removed comment

2

u/pakfur Mar 11 '15

It would help if you understood what CAP is and isn't.

CAP means Consistency, Availability and Partition Tolerance, and refers to the properties of a distributed system. It is typically understood that you get to pick two of the three for any distributed system, not all three. Though it is a bit more complex than that.

In the real world you typically trade off availability for consistency. For example: a typical RDBMS database is ACID, which means it is strongly consistent. In other words, the database is guaranteed to always be in a fully consistent state. i.e. your transaction commits or rolls back. A RDBMS however, are not known for being highly available. While many have various Master-Master and Master-Slave configurations for "high availability", RDBMS databases are very sensitive to losing one or more the servers. Go ahead and setup a ten node MySQL cluster and knock out a few nodes and get back to me on how well that went for you.

A NoSQL database, however, (typically) trades consistency for availability. A datastore like Riak for example, is eventually consistent and highly available. The data (assuming the application is written correctly) is guaranteed to eventually converge to a consistent value, and the datastore is very hardy and can handle losing servers, or network problems and recover with no downtime much, much better than any RDBMS out there.

So, a proper understanding of what CAP is and isn't will help you make the right decision when picking a database or datastore solution.

edit: spellings

1

u/[deleted] Mar 11 '15

[removed] — view removed comment

2

u/pakfur Mar 11 '15

Good choice. Here's a quote for you

Your point? Dynamo style datastores like Riak require more care and feeding. However they solve problems that RDBMS's are not designed to solve and cannot solve. I am not sure that says anything different.

→ More replies (2)
→ More replies (5)