<p>Generally the database server is the biggest, most expensive box we have to buy as scaling vertically is the only option.  Are there any databases that scale well horizontally (i.e. across multiple commodity machines) and what are the limitations in this approach?</p>

[{'answer_id': 42653, 'author': 'Darren Hague', 'author_id': 4450, 'author_profile': 'https://Stackoverflow.com/users/4450', 'pm_score': 2, 'selected': False, 'text': "<p>There are storage techniques such as JavaSpaces (or a commercial implementation such as Gigaspaces) which provide highly scalable, fast &amp; secure access to objects.</p>\n\n<p>There are also distributed cacheing systems such as memcached, which offer a similar approach.</p>\n\n<p>Of course, neither of these are true databases, but they are things that can work in conjunction with databases to offer a large amount of horizontal scalability, given a suitable architecture.  The real problem is that if you want all of the ACID goodness that comes with a database, there are certain unavoidable performance penalties. The only way out is to figure out the bits where you don't need ACID, and use other technologies to service those bits.</p>\n"}, {'answer_id': 42660, 'author': 'jason saldo', 'author_id': 1293, 'author_profile': 'https://Stackoverflow.com/users/1293', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://www.netezza.com/" rel="nofollow noreferrer">Netezza</a> and other datawarehouse appliances scale this way, but they are not good for OLTP and web app workloads.</p>\n'}, {'answer_id': 42667, 'author': 'Nick Pierpoint', 'author_id': 4003, 'author_profile': 'https://Stackoverflow.com/users/4003', 'pm_score': 1, 'selected': False, 'text': '<p>The Oracle route for scaling across multiple machines is called Real Application Clusters (Oracle RAC). There\'s no end of documentation on this elsewhere; you might try starting at <a href="http://www.oracle.com/database/rac_home.html" rel="nofollow noreferrer">http://www.oracle.com/database/rac_home.html</a>.</p>\n'}, {'answer_id': 42679, 'author': 'Mark Harrison', 'author_id': 116, 'author_profile': 'https://Stackoverflow.com/users/116', 'pm_score': 3, 'selected': False, 'text': "<p><strong>Oracle RAC -- Real Application Cluster</strong></p>\n\n<p>This works nicely, you just add boxes to your cluster.  You can fail over from one box to the other.  It's not replication, all the boxes are part of the same logical unit.</p>\n\n<p>It's pretty spendy, of course.</p>\n"}, {'answer_id': 42715, 'author': 'Guy', 'author_id': 993, 'author_profile': 'https://Stackoverflow.com/users/993', 'pm_score': 2, 'selected': False, 'text': '<p>Oracle RAC is the Rolls Royce of databases allowing extra hardware nodes to be added relatively easily and hardware failover.</p>\n\n<p>However, your commodity hardware costs will be dwarfed by the licence costs.</p>\n\n<p>Why dod you feel you need horizontal scaling.  A multi CPU core server with 40GB RAM and SAN storage can support very sizeable DB installation.</p>\n\n<p>Can you provide any sizing and expected activity information to allow better understanding of your problem?</p>\n'}, {'answer_id': 42724, 'author': 'Nick Retallack', 'author_id': 2653, 'author_profile': 'https://Stackoverflow.com/users/2653', 'pm_score': 3, 'selected': True, 'text': '<p>Don\'t worry, good solutions are coming!</p>\n\n<p><a href="http://incubator.apache.org/couchdb/" rel="nofollow noreferrer">Couchdb</a> and <a href="http://hypertable.org/" rel="nofollow noreferrer">Hypertable</a> are open source and still in alpha, but they are clearly designed to make scaling on commodity software simple.  They work pretty well, and may change how you think about databases.</p>\n\n<p>Also, if it\'s okay to let someone else do the distributing for you, <a href="http://code.google.com/appengine/" rel="nofollow noreferrer">Google AppEngine</a> and <a href="http://www.amazon.com/SimpleDB-AWS-Service-Pricing/b?ie=UTF8&amp;node=342335011" rel="nofollow noreferrer">Amazon SimpleDB</a> are extremely cheap distributed database services, though they\'re both in beta right now so strict limitations are imposed.</p>\n'}, {'answer_id': 43467, 'author': 'stevechol', 'author_id': 2981, 'author_profile': 'https://Stackoverflow.com/users/2981', 'pm_score': 0, 'selected': False, 'text': '<p>Oracle Real Application Clusters.  If you want the best then take a look at it.</p>\n'}, {'answer_id': 71652, 'author': 'Matthew Watson', 'author_id': 3839, 'author_profile': 'https://Stackoverflow.com/users/3839', 'pm_score': 0, 'selected': False, 'text': '<p>If you seriously think you will out scale a decent multicore "Big Iron" box, then you think about partitioning your data. This is a good, database agnostic way to scale out.</p>\n\n<p>All databases which horizontally will come at a serious cost. </p>\n\n<p>Unless you have mega $$\'s to throw at the problem, forget about RAC. While its very good, its VERY expensive once you scale beyond 2 nodes.</p>\n'}, {'answer_id': 334581, 'author': 'Codek', 'author_id': 40976, 'author_profile': 'https://Stackoverflow.com/users/40976', 'pm_score': 2, 'selected': False, 'text': "<p>If you do go down the RAC route it's worth remembering that it doesnt scale horizontally forever.  Even the sales guys admit 90% of rac customers are 4 nodes or less.  Once you go more than that you get diminishing returns.  So rac may work for you, but it's not guaranteed to be the answer.</p>\n"}, {'answer_id': 334681, 'author': 'nathan', 'author_id': 16430, 'author_profile': 'https://Stackoverflow.com/users/16430', 'pm_score': 2, 'selected': False, 'text': '<p>MySQL:  <a href="http://www.mysql.com/why-mysql/scaleout.html" rel="nofollow noreferrer">http://www.mysql.com/why-mysql/scaleout.html</a></p>\n\n<p>Limitations are that it works best with read-mostly workloads.  You typically have one \'master\' that receives all the writes, and many \'slaves\' that replicate the writes.  Then you distribute the reads over all the databases.</p>\n\n<p>MySQL replication is asynchronous, so you will probably have to deal with time lag problems (you write to the master, and then read from a slave before the write has been replicated).</p>\n'}, {'answer_id': 859144, 'author': 'yanky', 'author_id': 288477, 'author_profile': 'https://Stackoverflow.com/users/288477', 'pm_score': 3, 'selected': False, 'text': '<p>Oracle RAC is not horizontally scalable at all, because all Oracle instances share the same data storage. Yes, with SAN stuff u can get a large size DB, but it\'s just not scalable at all. In other words, Oracle RAC is still a scale-up approach. So for scaling-out or horizontally scaling, you have to partition your data by function that means put different groups of tables in different databases; or partition your data per table that means partition one table into multiple subtables with the same schema but store in different databases. In this way, you get a scaling-out solution. There are many resources on that. <a href="http://highscalability.com/unorthodox-approach-database-design-coming-shard" rel="nofollow noreferrer">Sharding</a> has been a buzz word for a while in web 2.0 website architecture blog sphere.\nBecause Sharding is not directly supported by database itself, you have to build your own solution. But as I said, there are many lessons already. For oracle, partitioning table is possible. For mysql, check <a href="https://stackoverflow.com/questions/810085/mysql-proxy-alternatives-for-database-sharding">this question</a></p>\n'}, {'answer_id': 22146289, 'author': 'hakkikonu', 'author_id': 1848929, 'author_profile': 'https://Stackoverflow.com/users/1848929', 'pm_score': 1, 'selected': False, 'text': '<p><a href="http://www.mongodb.org/" rel="nofollow">MongoDB</a>\nis one of the best database that scales horizontally.</p>\n'}, {'answer_id': 31034463, 'author': 'Ion Freeman', 'author_id': 781641, 'author_profile': 'https://Stackoverflow.com/users/781641', 'pm_score': 0, 'selected': False, 'text': '<p>You might look at DashDB for OLAP -- IBM pairs it with Cloudant for OLTP.\n<a href="https://www.ibm.com/developerworks/community/blogs/5things/entry/5_things_to_know_about_dashdb_placeholder?lang=en" rel="nofollow">https://www.ibm.com/developerworks/community/blogs/5things/entry/5_things_to_know_about_dashdb_placeholder?lang=en</a></p>\n'}]
['https://Stackoverflow.com/questions/42649', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3305/']