简体   繁体   English

Rails + Heroku + Amazon RDS - 生产与开发

[英]Rails + Heroku + Amazon RDS - Production vs Development

It is my first time working with a Rails app on Heroku. 这是我第一次在Heroku上使用Rails应用程序。 It uses a mysql db hosted on Amazon RDS. 它使用托管在Amazon RDS上的mysql数据库。 At some point I want to move it from development to production. 在某些时候,我想将其从开发转移到生产。 I want to keep developing and adding features. 我想继续开发和添加功能。 What is the best way to accomplish this? 完成此任务的最佳方法是什么?

I see Heroku has some kind of staging app feature. 我看到Heroku有一些临时应用程序功能。 Is that the best option for me to keep a separate app to test? 这是我保持单独的应用程序测试的最佳选择吗? And what about the database? 那数据库怎么样? I'm guessing I need to create a separate db on Amazon RDS for development and for production? 我猜我需要在Amazon RDS上创建一个单独的数据库用于开发和生产?

I am on a budget so I don't want to have to pay for 2 apps on Heroku and 2 db's on Amazon. 我有预算,所以我不想在Heroku上支付2个应用程序,在亚马逊上支付2个db。 Can I create both on the fly each time I do development work and then destroy them when I'm done, or is that too much? 我可以在每次开发工作时动态创建两个,然后在完成后销毁它们,还是那个太多了? If so can I then copy the production data over to the development data? 如果是这样,我可以将生产数据复制到开发数据中吗? I would do local testing but I feel like I need to make sure it's working on Heroku as well. 我会做本地测试,但我觉得我需要确保它也在Heroku上工作。

I'm just trying to get a general idea of what workflow is best practice or most commonly used. 我只是想了解哪种工作流程是最佳实践或最常用的工作流程。 Any comments are appreciated. 任何评论都表示赞赏。

Unfortunately, as you're on RDS you're going to have to pay for two. 不幸的是,当你在RDS上时,你将不得不支付两个。 If you were using Heroku Postgres you'd be able to get a simple small PG database for free. 如果您使用的是Heroku Postgres,您将能够免费获得一个简单的小型PG数据库。

Regarding applications - Heroku apps are free if you use less than 750 'dyno' hours a month (which is a little bit more than one dyno for an entire month), which is normally fine for staging small apps as long as you don't have masses of workers required. 关于应用程序 - Heroku应用程序是免费的,如果你每个月使用少于750'dyno'小时(这一个月比一个dyno多一点),这对于暂存小应用程序通常是好的,只要你不这样做需要大量工人。

You certainly could create the staging env whenever you need it, but only you know how complex this application is and what sort of overhead that would provide. 你当然可以在需要的时候创建staging env,但只有你知道这个应用程序有多复杂以及会提供什么样的开销。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM