At some point in the next few months our app will be at the size where we need to shard our DB. We are using Heroku for hosting, Node.js/PostgreSQL stack.
Conceptually, it makes sense for our app to have each logical shard represent one user and all data associated with that user (each user of our app generates a lot of data, and there are no interactions between users). We need to retain the ability for the user to do complex ad-hoc querying on their data. I have read many articles such as this one which talk about sharding: http://www.craigkerstiens.com/2012/11/30/sharding-your-database/
Conceptually, I understand how Sharding works. However in practice I have no idea how to go about implementing this on Heroku, in terms of what code I need to write and what parts of my application I need to modify. A link to a tutorial or some pointers would be much appreciated.
Here are some resources I have already looked at:
- http://www.craigkerstiens.com/2012/11/30/sharding-your-database/
- MySQL sharding approaches?
- Heroku takes care of multiple database servers?
- http://petrohi.me/post/30848036722/scaling-out-postgres-partitioning
- http://adam.heroku.com/past/2009/7/6/sql_databases_dont_scale/
- https://devcenter.heroku.com/articles/heroku-postgres-follower-databases
- Why do people use Heroku when AWS is present? What distinguishes Heroku from AWS?