views:

146

answers:

3

I will build a system where I want to reduce single-point-of-failures, and I need a database. Is there any (free) relational database systems that can handle multi-master setups good (i.e where it is easy to add and remove nodes) or is it better to go with a NoSQL-database?

As what I have understood, a key-value store will handle this better. What database system do you recommend for a multi-master (cluster) setup?

A: 

I think Oracle has nailed this concept. However, if you're a mortal without a swiss bank account, then maybe you should look into MySQL's NDB Cluster.

Tor Valamo
A: 

Key-value stores are not necessarily fault tolerant. They are primarily performance tools. Only when data is stored on more than one server is there any form of fault tolerance. If it is just safety, reducing single point of failure the simplest solution is probably set up a mirroring solution, where you have a mirror that just tracks the master database. When the master somehow fails, you quickly switch over (hopefully automatically).

The complexity of this is much lower as there is no consistency management needed during normal operation. The mirror is read-only and just tracks the master database. When the master fails, the mirror is switched to master and the link broken. After the master gets back up the state between them is inconsistent and you must make sure to update the original master from the mirror now acting as master. Most database systems can handle this scenario, and if you have no insane uptime requirements or a very heavy load it is the most pragmatic solution.

Paul de Vrieze
+1  A: 

Mysql's NDB Cluster WILL do this. But it's far from easy to set up and has a lot of gotchas.

And also, its performance is generally fairly sucky and it keeps data in memory (yes, I know they sound contradictory).

Essentially, updates need to acquire distributed locks throughout the cluster (or at least in the storage node group where those table(s) are held)

It is not easy to manage, but you can do some level of hot-add.

Unless you require very rapid failover and consistency, I'd recommend against it.

I'd recommend ignoring multi-master, and using a HA MySQL instead (with e.g. InnoDB) which is easy to set up and works very well with typical sub 30-second failover times. This is a master-slave system where the slave cannot even do reads (but you can add read slaves with replication provided you don't need them to be completely up to date)

MarkR
Agreed, Unless you actually need the performance of multimaster, stick to a simple failover solution.
Matthew Watson
Multi-master also cannot improve write performance, as both the masters must do all writes, synchronously, if you want high durability. Read performance can be improved by adding read-slaves.
MarkR