【ヘロク】 Heroku Part1 【PostgreSQL】
■ このスレッドは過去ログ倉庫に格納されています
Migrating to the Celadon Cedar Stack | Heroku Dev Center
http://devcenter.heroku.com/articles/cedar-migration ActiveRecord の find(id) と find_by_id(id) の違い
http://higelog.brassworks.jp/?p=71 https://github.com/tchandy/octopus/wiki/Sharding
https://github.com/tchandy/octopus
class ApplicationController < ActionController::Base
around_filter :select_shard
def select_shard(&block)
Octopus.using(current_user.country, &block)
end
end
https://github.com/mperham/data_fabric
class ApplicationController < ActionController::Base
around_filter :select_shard
private
def select_shard(&block)
DataFabric.activate_shard(:city => @current_user.city, &block)
end
end
ActiveRecord の find(id) と find_by_id(id) の違い
レコードが見つからなかったとき
find(id) 例外が発生する
find_by_id(id) nil が返る
http://higelog.brassworks.jp/?p=71
#{group}_#{shard}_#{environment} - sharding, no replication, e.g. “city_austin_production”
data_fabric :replicated => true, :shard_by => :city
https://github.com/mperham/data_fabric
class ApplicationController < ActionController::Base
around_filter :select_shard
private
def select_shard(&block)
DataFabric.activate_shard(:city => @current_user.city, &block)
end
end
Amazon.co.jp: Heroku Cedar: Jurg van Vliet, Flavia Paganelli, Jasper Geurtsen, Matti Paksula, Att..
http://www.amazon.co.jp/gp/product/1449319637 RoR Wiki 翻訳 Wiki - HowtoUseMultipleDatabases
http://web.archive.org/web/20070217161907/http://techno.hippy.jp/rorwiki/?HowtoUseMultipleDatabases
やむにやまれず:ActiveRecordで異なる複数のDBへ接続しにいく方法
http://blog.livedoor.jp/sparklegate/archives/50376930.html
[Ruby] ActiveRecord で複数のデータベースに接続する方法 « messaliberty 日本語
http://jp.messaliberty.com/2009/02/ruby-how-to-use-multiple-databases-with-activerecord/
Master-Slave clusters to scale out your Rails models reads.
Vertical sharding by moving some of your models to a separate (maybe even dedicated) servers and still keep using AR associations
Horizontal sharding by slicing your models data to pieces and placing those pieces into different databases and/or servers.
http://kovyrin.net/2010/04/16/dbcharmer-rails-can-scale/
https://github.com/kovyrin/db-charmer
http://kovyrin.github.com/db-charmer/
個人でちょっとしたアプリ作って公開するには、無料分だとちょっとDBの容量が心もとなくない?
ただ20GBの共有データベースに課金するぐらいなら、VPS使った方が良くないかな?
個人的に使うアプリを色々と置かせてもらってるので、Herokuは好きなんだけど・・・
それともなんか他に良いやり方あるかな? Get up and running in minutes, and deploy instantly with git.
Focus 100% on your code, and never think about servers
http://www.heroku.com/
ヒト、モノ、カネは有限
選択と集中 Herokuはつかえない。最初は良かったけど結局は高くつく。
さくらとか、カゴヤとかのレンサバの方が百倍マシ。 ケーススタディ11 初期の成功を放棄し、スケールするためのPivotとは?Herokuの場合 | "Lean Startup Japan"
Herokuは2011年1月にSalesforce.comに2億1200万ドル(約172億円!!)で買収されました。
彼らは「さらなる集中」の必要性に気づきます。
そこでの選択は「Webエディタ機能の放棄」でした。
http://leanstartupjapan.org/?p=237 クラウド型ストレージ「Amazon S3」は安いか? − @IT
1つはデータの冗長構成についてで、
Amazonは地理的に離れた最低2つのデータセンターにまたがって3重の冗長度でデータを保持している。
自前で同様のことをするには、RAID構成のストレージを2つのデータセンターに置き、それらの間でリアルタイムのレプリケーションを行う必要がある。
http://www.atmarkit.co.jp/news/200901/09/s3.html HerokuがPostgreSQLのDatabase-as-a-Serviceを開始。しかし料金表がおかしいぞ − Publickey
If a meteor were to wipe out the east coast, you won’t lose your data.
もしも宇宙からの隕石で米東海岸が壊滅しても、データが失われることはありません。
http://www.publickey1.jp/blog/11/herokupostgresqldatabase-as-a-service.html
このぐらいの性能でレプリケーション、バックアップ、リストア、ログ管理等等を
全く気にしなくていいとすれば、
月200でサーバ+DBAなんか雇えないわけで、十分ペイする気がします。
http://postgresql.g.hatena.ne.jp/umitanuki/20111202/1322810909
http://ja.wikipedia.org/wiki/TCO
TCO (Total Cost of Ownership) とは「総保有コスト」のことで、ある設備などの資産に関する、購入から廃棄までに必要な時間と支出の総計。
予算を作成し要求する際、ランニングコスト(保守・運用・維持等のための費用、例として設備・システムなどのメンテナンス、
有償の更新、管理のための人件費、光熱費など)のために必要な経費を考慮に入れず、
初期投資額(イニシャルコスト)だけに注目しがちである。
TCOはそれらをトータルに含めた経費で、実際に支出すべき金銭の全額にあたる。 $ gem install mysql2postgres http://devcenter.heroku.com/articles/heroku-postgres-documentation
Fork (beta)
Forking creates a new database containing a snapshot
of an existing database at the current point in time.
Forked databases do not stay up-to-date with the original database and are writable.
Follow (beta)
Followers are read-only and stay stay up-to-date
with the changes to your database.
Automatic monthly snapshots (i.e. backups) are automatically enabled for standalone databases.
They must be manually enabled when database are provisioned as an add-on.
Standalone databases do not appear through our command-line client.
http://devcenter.heroku.com/articles/differences-standalone-vs-addons-database
TASK FREQUENCY
heroku:scale:dynos Every 10 minutes
heroku:scale:workers Every 10 minutes
http://rubydoc.info/gems/heroku_scale_scheduler/0.0.2/frames How many simultaneous connections will a shared database on Heroku allow? - Quora
You should be safe with up to around 20 connections.
http://www.quora.com/How-many-simultaneous-connections-will-a-shared-database-on-Heroku-allow >>71-72
既存のShared Database 20GBと比較して、これはどういう位置付けになるんだろ? heroku addons:add heroku-shared-postgresql:basic Outside Connections
In addition to being available to the Heroku runtime,
databases can be accessed directly by clients running elsewhere.
All connections require SSL.
http://devcenter.heroku.com/articles/heroku-shared-postgresql
http://devcenter.heroku.com/articles/labs-heroku-shared-postgresql
heroku addons:add heroku-shared-postgresql:basic
heroku addons:add ssl:piggyback
heroku addons:add scheduler:standard
heroku addons:add mailgun:starter
heroku addons:add cron:daily
heroku config:add AWS_S3_SECRET_KEY="xxxx" AWS_S3_KEY_ID="xxxx" BACKUP_BACKET="backet-name"
https://github.com/mataki/heroku_backup_task Bonsai ElasticSearch
Fulltext search that celebrates craftsmanship
https://addons.heroku.com/bonsai MemCachier
Give your database a break with a scalable in-memory cache.
https://addons.heroku.com/memcachier
RoboWhois
Query WHOIS records and check domain availability with a unified, consistent API direcly from your app.
https://addons.heroku.com/robowhois
http://groups.google.com/group/heroku/browse_thread/thread/9f1a5d7d677fb4dc
You can install the free New Relic add-on.
It has an availability monitor feature that will ping your site twice per minute,
thus preventing the dyno from idling.
http://stackoverflow.com/questions/5480337/easy-way-to-prevent-heroku-idling
Apps that have only 1 web dyno will be idled out after one hour of inactivity.
Apps that have more than 1 web dyno are never idled out. Workers dynos are never idled out.
http://devcenter.heroku.com/articles/dyno-idling クラウド上の(多言語)統合開発環境Kodingが$2Mを調達–グローバルな開発コラボが可能に
http://jp.techcrunch.com/archives/20120315koding/
Welcome to Koding. A new way for developers to get work done.
http://koding.com/
Cloud9 IDE - Ajax.org
http://c9.io/
Node.jsを手軽に試せるJavaScript統合開発環境「Cloud9 IDE」、クラウドでの提供開始 − Publickey
http://www.publickey1.jp/blog/11/nodejsjavascriptcloud9_ide.html
Cloud9 IDE is an online development environment for
Javascript and Node.js applications as well as
HTML, CSS, PHP, Java, Ruby and 23 other languages.
http://c9.io/
Reduce Server Deployment Cycles with Heroku - YouTube
http://www.youtube.com/watch?v=YbXiIjJffHk ■ このスレッドは過去ログ倉庫に格納されています