在为 RoR 应用程序选择 MySQL 和 Amazon SimpleDB 之间时,您需要考虑什么?

发布于 2024-07-06 18:16:15 字数 232 浏览 10 评论 0原文

我刚刚开始研究使用 Amazon 的 SimpleDB 服务作为我计划构建的 RoR 应用程序的数据存储的可行性。 我们将使用 EC2 作为 Web 服务器,并计划也使用 EC2 作为 MySQL 服务器。 但现在的问题是,为什么不使用SimpleDB呢?

该应用程序(如果成功)需要在支持的用户数量方面具有很强的可扩展性,需要维护简单而高效的代码库,并且需要可靠。

我很好奇 SO 社区对此有何看法。

I am just beginning to do research into the feasibility of using Amazon's SimpleDB service as the datastore for RoR application I am planning to build. We will be using EC2 for the web server, and had planned to also use EC2 for the MySQL servers. But now the question is, why not use SimpleDB?

The application will (if successful) need to be very scalable in terms of # of users supported, will need to maintain a simple and efficient code base, and will need to be reliable.

I'm curious as to what the SO communities thoughts are on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

碍人泪离人颜 2024-07-13 18:16:15

Ruby SimpleDB 库不像 ActiveRecord(默认的 Rails DB 适配器)那么完整,因此您习惯的许多功能都不在那里。

从好的方面来说,它是无模式的、可扩展的并且可以与 ec2 很好地配合。

如果您要在应用程序中执行全文搜索等操作,那么 SimpleDB 可能不是最佳选择,请坚持使用 AR + sphinx。

The Ruby SimpleDB library is not as complete as ActiveRecord (the default Rails DB adapter), so many of the features you're used to will not be there.

On the plus side it's schemaless, scalable and works well with ec2.

If you're going to do things like full text search in your app then SimpleDB might not be the best choice, stick with AR + sphinx.

月下伊人醉 2024-07-13 18:16:15

好吧,考虑到简单数据库不使用 SQL,甚至没有表,这意味着它与 MySQL 和其他基于 SQL 的东西完全不同(http://aws.amazon.com/simpledb/)。 没有约束、触发器或连接。 祝你好运。

这是启动并运行它的一种方法:
http://developer.amazonwebservices.com/connect/entry.jspa?externalID= 1242
(通过 http://rubyforge.org/projects/aws-sdb/

我想如果您永远不需要查询 Rails 之外的数据,那么 SimpleDB 可能就可以了。 但由于它不是一流的受支持数据库,因此您可能会遇到难以修复的错误。 我不想在半测试版后端运行生产 Rails 应用程序。

Well, considering simple DB doesn't use SQL, or even have tables, means that it's a completely different beast than MySQL and other SQL-based things (http://aws.amazon.com/simpledb/). There are no constraints, triggers, or joins. Good luck.

Here's one way of getting it up and running:
http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1242
(via http://rubyforge.org/projects/aws-sdb/ )

I suppose if you're never going to need to query the data outside of rails, then SimpleDB may prove to be OK. But as it's not a first-class supported DB, you're likely to run into bugs that are difficult to fix. I wouldn't want to run a production rails app in a semi-beta backend.

只有一腔孤勇 2024-07-13 18:16:15

对我来说,这感觉就像是,“嘿,有这些简洁的工具,我应该使用它们构建一个项目”,而不是实际上需要使用这些特定的工具。 也许我只是脾气暴躁,但这感觉像是过早优化的典型案例。 您正在尝试使用一项外部服务,该服务需要为尚未编写的应用程序付费,并且您没有说您已经拥有了有保证的受众群体,或者一定会扩展到保证这一点的水平。

“该应用程序(如果成功)需要在支持的用户数量方面具有很强的可扩展性”,认真地说,这描述了互联网的一半。 真正的问题是“如果成功”部分。 只需专注于快速轻松地构建应用程序即可。 最简单的方法就是使用 ROR,因为它可以说是开箱即用的。 将其与数据库配对,使用 ActiveRecord 并构建一些东西并吸引用户。

事实上,我会更进一步说,对于始终在服务器上的 EC2 来说相当昂贵。 将其部署在 Slicehost 或其他托管解决方案上,然后根据需要将其移动到 EC2,以满足需求。

To me this just feels like, "Hey there are these neat tools out there, I should go build a project using them," rather than actually needing to use these specific tools. Maybe I'm just being crabby but it feels like a classic case of premature optimization. You're trying to use an external service that costs money for an app that isn't even written yet and you don't say you've got a guaranteed audience or one that will necessarily scale to a level that warrants that.

"The application will (if successful) need to be very scalable in terms of # of users supported", seriously, that describes half the Internet. It's the "if successful" part that's really the question. Just concentrate on building the application quickly and easily. The easiest way to do that is just use ROR as it is out-of-the-box so to speak. Pair it with a database, use ActiveRecord and get something built and attracting users.

In fact, I'll go further and say that EC2 is rather expensive for always on servers. Deploy it over on Slicehost or another hosted solution and then move it to EC2 if you need to in order to support demand.

少女情怀诗 2024-07-13 18:16:15

我本人对这个话题非常感兴趣。 现在我处于云计算高水平,所以我会说使用 SimpleDB,因为它可能会更好地扩展,因为您将拥有高可用性,但这只是我目前的想法。 还不是根据经验。

编辑:确实,SimpleDB 没有“正常”数据库的正常功能,但如果您只需要一个简单的 CRUD 层来工作,那么它应该可以解决问题,这就是我的情况

I myself am very interested in this topic. Right now I'm on a cloud computing high so I'd say go with SimpleDB since it'll probably scale better in the sense that you'll have high availability, but that's just my thoughts as of the moment. Not from experience yet.

Edit: It's true that SimpleDB has no normal features a "normal" database, but it should do the trick if you only need a simple CRUD layer to work against, which is my case

绝不服输 2024-07-13 18:16:15

有一个名为 SimpleRecord 的库,它是 ActiveRecord 的替代品,但使用 SimpleDB 作为其后端数据存储。

There's a library called SimpleRecord that is a drop in replacement for ActiveRecord, but uses SimpleDB as its backend data store.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文