views:

129

answers:

3

I've read some article say that RDBMS such as MySQL is not good at scalable,but NoSQL such as MongoDB can shard well. I want to know which feature that RDBMS provided make itself can not shard well.

A: 

Queries involving multiple shards are complex (f.e. JOINs between tables in different shards)

gustavogb
What if i never use join in RDBMS?Will RDBMS become shard easily?If so,it seems no need to implement a new database called NoSQL.
shuitu
+2  A: 

Most RDBMS systems guarantee the so-called ACID properties. Most of these properties boil down to consistency; every modification on your data will transfer your database from one consistent state to another consistent state.

For example, if you update multiple records in a single transaction, the database will ensure that the records involved will not be modified by other queries, as long as the transaction hasn't completed. So during the transaction, multiple tables may be locked for modification. If those tables are spread across multiple shards/servers, it'll take more time to acquire the appropriate locks, update the data and release the locks.

The CAP theorem states that a distributed (i.e. scalable) system cannot guarantee all of the following properties at the same time:

  • Consistency
  • Availability
  • Partition tolerance

RDBMS systems guarantee consistency. Sharding makes the system tolerant to partitioning. From the theorem follows that the system can therefor not guarantee availability. That's why a standard RDBMS cannot scale very well: it won't be able to guarantee availability. And what good is a database if you can't access it?

NoSQL databases drop consistency in favor of availability. That's why they are better at scalability.

I'm not saying RDBMS systems cannot scale at all, it's just harder. This article outlines some of the possible sharding schemes, and the problems you may encounter. Most approaches sacrifice consistency, which is one of the most important features of RDBMS systems, and which prevents it from scaling.

Niels van der Rest
A: 

Why NoSQL dudes and dudettes don't like joins: http://www.dbms2.com/2010/05/01/ryw-read-your-writes-consistency/

TTT

related questions