title: MySQL Partitioning / Sharding / Splitting - which way to go?
body: <p>We have an InnoDB database that is about 70 GB and we expect it to grow to several hundred GB in the next 2 to 3 years. About 60 % of the data belong to a single table. Currently the database is working quite well as we have a server with 64 GB of RAM, so almost the whole database fits into memory, but we’re concerned about the future when the amount of data will be considerably larger. Right now we’re considering some way of splitting up the tables (especially the one that accounts for the biggest part of the data) and I’m now wondering, what would be the best way to do it.</p>
  
  <p>The options I’m currently aware of are</p>
  
  <ul>
  <li>Using MySQL Partitioning that comes with version 5.1 </li>
  <li>Using some kind of third party library that encapsulates the partitioning of the data (like hibernate shards)</li>
  <li>Implementing it ourselves inside our application</li>
  </ul>
  
  <p>Our application is built on J2EE and EJB 2.1 (hopefully we’re switching to EJB 3 some day).</p>
  
  <p>What would you suggest?</p>
  
  <p>EDIT (2011-02-11):<br>
  Just an update: Currently the size of the database is 380 GB, the data size of our "big" table is 220 GB and the size of its index is 36 GB. So while the whole table does not fit in memory any more, the index does.<br>
  The system is still performing fine (still on the same hardware) and we're still thinking about partitioning the data.</p>
  
  <p>EDIT (2014-06-04):
  One more update: The size of the whole database is 1.5 TB, the size of our "big" table is 1.1 TB. We upgraded our server to a 4 processor machine (Intel Xeon E7450) with 128 GB RAM.
  The system is still performing fine.
  What we're planning to do next is putting our big table on a separate database server (we've already done the necessary changes in our software) while simultaneously upgrading to new hardware with 256 GB RAM.</p>
  
  <p>This setup is supposed to last for two years. Then we will either have to finally start implementing a sharding solution or just buy servers with 1 TB of RAM which should keep us going for some time. </p>
  
  <p>EDIT (2016-01-18):</p>
  
  <p>We have since put our big table in it's own database on a separate server. Currently the size ot this database is about 1.9 TB, the size of the other database (with all tables except for the "big" one) is 1.1 TB.</p>
  
  <p>Current Hardware setup:</p>
  
  <ul>
  <li>HP ProLiant DL 580</li>
  <li>4 x Intel(R) Xeon(R) CPU E7- 4830</li>
  <li>256 GB RAM</li>
  </ul>
  
  <p>Performance is fine with this setup.</p>