3

Is it possible to scale out a RDB ? If it's possible, how can one achieve it?

I'm asking this question because I assisted to a NoSQL event in which the speaker told many times that the one of the disadvantages of relational databases is the impossibility to scale out. In other word, we should add more ram and more storage but we can't just add another computer like we would do if we're using a NoSQL database.

Michael
  • 133
  • 1
  • 3

4 Answers4

10

Yes, to some extent.

  • Master-Master Replication — theoretically scales for read and writes, however for writes it's complex and requires distributed commit mechanism, such as two-phase commit. This limits it's practicality.

  • Master-Slave Replication — scales for read operations, however it doesn't help at all for write operations. Introduces replication lag.

  • Vertical partitioning — basically locating unrelated tables on different servers. scales for reads and writes, however disadvantage is that you cannot easily JOIN results from different servers.

  • Horizontal partitioning aka Sharding — Distributing data from each table evenly among all servers. Location of data is determined by sharding key. Scales for reads and writes, however accessing data via criteria other then the sharding key requires querying all the servers, in extreme cases requires map-reduce kind of infrastructure.

If you take vertical and horizontal partitioning to extreme, you end up practically with NoSQL solution built on top of SQL backend.

The rule of thumb is, that you cannot scale horizontally preserving full ACID, you will have to give up at least one characteristic. Most typically in scalable systems have only eventual consistency (ie. whole system is not guaranteed to be consistent at all times, but is guaranteed to eventually reach consistent state).

vartec
  • 6,137
  • 2
  • 32
  • 49
3

Yes, examples: Oracle RAC, MySQL Sharding, SQL Server HADRON

Not all apps suit the NoSQL paradigm: banking, trading or accounting for example.

Also see http://www.codinghorror.com/blog/2009/06/scaling-up-vs-scaling-out-hidden-costs.html

Sounds like a prejudice to me and it's been done to death many times over

gbn
  • 6,009
  • 1
  • 17
  • 21
3

Yes, it's possible to scale out a relational database, using Sharding and/or replication.

NoSQL solutions are typically much easier to shard/replicate. They do this by relaxing the consistency requirement in the CAP theorem.

Mauricio Scheffer
  • 801
  • 2
  • 10
  • 23
2

It is possible to scale out an RDBMS, but it is not easy, and involves some compromises (which NoSQL solutions often tout as part of their basic design as "features"). For instance, you often are forced to give up on cross-server transactions for performance reasons. Search for "sharding" with your chosen relational DB name and you will likely find a lot of solutions with different trade-offs. None are going to be automatic, as you need to carefully manage what data goes onto what server since the data in different tables is related.

For what it's worth, Facebook runs on thousands of sharded MySQL servers... so it is possible. All of the Microsoft web properties also run on sharded SQL Server databases. Usually this involves a good amount of application code changes (which NoSQL solutions also force you to make as well).

rmalayter
  • 3,744
  • 19
  • 27