基于当前的托管服务,我应该将哪些数据库与 Ruby on Rails 一起使用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2790796/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What databases should I use with Ruby on Rails, based on current Hosting services?
提问by mrcaramori
I've been looking for hosting services and I still don't know what kind of database is the most commom. It seems to be MySql and PostgreSql. So, I'm not sure about how much traffic and data my website will have (it's just a project), but I would like to be prepared. I've worked in some projects with Oracle (PL/SQL) and I know something from MySql.
我一直在寻找托管服务,但我仍然不知道哪种数据库最常见。好像是 MySql 和 PostgreSql。所以,我不确定我的网站会有多少流量和数据(这只是一个项目),但我想做好准备。我曾在一些 Oracle (PL/SQL) 项目中工作过,并且我对 MySql 有所了解。
Thank you !
谢谢 !
ps. 4 years later, I've been coding RoR mostly with PostgreSQL. SQLite by default when I need simple apps, but PostgreSQL otherwise.
附:4 年后,我主要使用 PostgreSQL 编写 RoR。当我需要简单的应用程序时默认使用 SQLite,否则使用 PostgreSQL。
采纳答案by bsberry
One of the tenets of Rails is you shouldn't really care what database you're using: that's all abstracted for you.
Rails 的原则之一是你不应该真正关心你使用的是什么数据库:这些都是为你抽象的。
So I would say go with the hosting provider that seems the overall best, and trust them to pick a good database.
所以我会说选择看起来最好的托管服务提供商,并相信他们会选择一个好的数据库。
In this case, as house9, I would recommend Herokuas an excellent overall service. Start with a small, free plan, scale up as needed. They use PostgreSQL by default, which has been entirely adequate in my experience.
在这种情况下,作为 house9,我会推荐Heroku作为出色的整体服务。从一个小的、免费的计划开始,根据需要扩大规模。他们默认使用 PostgreSQL,这在我的经验中已经足够了。
回答by house9
I recommend Heroku for hosting they require Postgres or if you want to go 'NoSql' - you can use MongoDB via the MongoHQ Heroku plug-in
我推荐 Heroku 来托管它们需要 Postgres 或者如果你想使用“NoSql”——你可以通过 MongoHQ Heroku 插件使用 MongoDB
they offer a 'free' plan for small sites
他们为小型网站提供“免费”计划
回答by simeonwillbanks
Engine Yardis a trusted Rails host. They support MySQL, Postgres and MongoDB. Here is their list of supported technologies:
Engine Yard是值得信赖的 Rails 主机。它们支持 MySQL、Postgres 和 MongoDB。这是他们支持的技术列表:
http://www.engineyard.com/technology/stack
http://www.engineyard.com/technology/stack
On May 10th, they are hosting a demo on their cloud services.
5 月 10 日,他们将在其云服务上进行演示。
回答by Leon Katsnelson
I don't think there is any argument that MySQL is the most used. If you re looking for an enterprise class database, I say give DB2 a try. Just like MySQL, DB2 Express-C is free and optional support is available. DB2 is the only database that has support from the vendor. See http://antoniocangiano.com/2010/04/22/rails-db2-and-the-enterprise/.
我认为没有任何理由认为 MySQL 是最常用的。如果您正在寻找企业级数据库,我想尝试一下 DB2。就像 MySQL 一样,DB2 Express-C 是免费的,并且提供可选的支持。DB2 是唯一获得供应商支持的数据库。请参阅http://antoniocangiano.com/2010/04/22/rails-db2-and-the-enterprise/。
回答by Alan Hymanson
MySQLis by far the most common free web database now a days, and is very common in Ruby on Rails Projects. Almost all linux hosting providers will give you mysql databases. Unless you have a specific reason to go elsewhere, it is a great place to start.
MySQL是目前最常见的免费 Web 数据库,并且在 Ruby on Rails 项目中非常常见。几乎所有的 linux 托管服务提供商都会为您提供 mysql 数据库。除非您有特定的理由去其他地方,否则这是一个很好的起点。
I have personally implemented a couple of RoR projects that used MySQL as the backend with no complaints.
我亲自实施了几个使用 MySQL 作为后端的 RoR 项目,没有任何抱怨。

