在接下來幾個月的某個時候,我們的應用程序將處於我們需要分割我們數據庫的大小。我們使用Heroku來託管Node.js/PostgreSQL堆棧。Heroku上的數據庫分割
從概念上講,我們的應用程序讓每個邏輯分片代表一個用戶以及與該用戶相關的所有數據(我們的應用程序的每個用戶都會生成大量數據,並且用戶之間沒有交互)。我們需要保留用戶對他們的數據進行復雜即席查詢的能力。我已經閱讀了許多文章,例如這篇談論分片的文章:http://www.craigkerstiens.com/2012/11/30/sharding-your-database/
從概念上講,我理解Sharding是如何工作的。然而在實踐中,我不知道如何在Heroku上實現這一點,就我需要編寫的代碼以及我需要修改的應用程序的哪些部分而言。鏈接到教程或一些指針將不勝感激。
這裏有一些資源,我已經看了看:
- 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?
你有沒有簽出八達通? https://github.com/tchandy/octopus – catsby 2013-02-13 19:52:13