In the previous post of this series (which can be found here) I discussed how to migrate your data once you have decided how to shard your schema.
Once your data is sharded, it’s time to modify your application code. I will not dive into the many open source platforms that provide partial sharding support (Hibernate Shards, Gizzard, and the like), and will take Java (sorry, old habits are hard to overcome) as an example – however, the same holds true for any programming language.
Without Using ORM
If you wrote your code without an Object/Relational Mapping tool, kudos to you. Sharding will be easier, as you control the SQL statements.
Upgrading Connection Pool
Your first task is to write a connection pool that is “sharding”
aware. The class should look something like this:
…