根据性能和可扩展性选择 Rails 与 Django

发布于 2024-12-06 07:20:51 字数 492 浏览 1 评论 0原文

我目前正在做一个副业项目(希望能发展成更多的东西),现在它是严格静态的前端东西; HTML、CSS 和 jQuery。因此,与此同时,我有时间对选择 Ruby on Rails 与 Python/Django 进行大量研究。

我读过无数比较这两种语言的文章,这些文章通常归结为“你更喜欢哪种语言?”以及开发社区的考虑。

我在这里的问题严格来说是技术性质的,比较框架(及其各自的语言)如下:

Between Ruby/Rails vs. Python/Django:

  1. Which run-time Performs better(任何统计数据或现实世界的例子都很棒) ?
  2. 已知的可扩展性问题是什么,从长远来看哪个可扩展性更好(同样,任何能够代表这一点的技术文档或数据都很棒)?

我知道可扩展性取决于架构,所以问题是什么框架及其各自的工具、API、插件、社区、文档等从“一开始”就“引导”您走向最佳可扩展的 Web 架构?

谢谢!

I'm currently working on a side project (that hopefully will grow into something more), and right now its strictly static front-end stuff; HTML, CSS and jQuery. So in the meantime, I have time to do heavy research on choosing Ruby on Rails vs. Python/Django.

I've read countless articles comparing the two, which usually come down to "what language do you prefer?" and considerations of the development community.

My question here is strictly of a technical nature, comparing the frameworks (and their respective languages) as such:

Between Ruby/Rails vs. Python/Django:

  1. Which run-time performs better (any statistics or real-world examples would be great)?
  2. What are the known scalability problems, and which scales better in the long run (again, any technical documentation or data to represent this would be great)?

I understand that scalability comes down to architecture, so the question is what framework and its respective tools, APIs, plug-ins, community, documentation, etc. "guides" you towards the best scalable web architecture from the "get-go"?

Thanks!

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

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

发布评论

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

评论(2

山人契 2024-12-13 07:20:51

这是思考问题的错误方法。

Web 上的可扩展性来自于扩展应用程序服务器的数量,而不是加快单个应用程序服务器的速度。

Ruby 和 Python 都是慢速语言,存在多线程问题和垃圾收集器问题。无论如何我们都会使用它们,因为它们非常擅长允许开发人员编写更简单的程序来更好地完成工作。不值得担心这两个运行时中哪一个性能更好的问题。

只要你保持良好的 Web 架构,其中你的应用程序服务器是无状态的(所有状态都保存在数据库或 cookie 中,但不在服务器端会话中),你就不应该关心单个请求的实际性能,只要是合理的。因为如果您的应用程序服务器是无状态的,您可以水平扩展该层以满足任何可扩展性需求。

That's the wrong approach to thinking about the problem.

Scalability on the web comes from expanding the number of application servers rather than speeding up an individual application server.

Ruby and Python are both slow languages with problematic multithreading and problematic garbage collectors. We use them anyway because they are very good at permitting the developer to write simpler programs that do the job better. It's not worth bothering about the question, which of these two runtimes performs better.

So long as you keep good web architecture, where your application server stateless (where all state is kept in the database or in cookies, but not in server-side sessions), you should not care what the actual performance of an individual request is, so long as it is reasonable. Because if your application server is stateless, you can scale that tier horizontally to cope with any need for scalability.

倾城°AllureLove 2024-12-13 07:20:51

https://stackoverflow.com/questions/91846/rails-or-django-or-其他东西
Django 可以扩展吗?
使用 Rails 作为大型网站的框架< br>
https://stackoverflow.com/questions/3042259/django-or-rails
Rails 还是 Django?

...

关于这个主题有很多问题,但没有一个回答问题——没有正确答案。

我认为您不应该根据这两个指标选择框架。除非您正在构建下一个 Facebook,否则两者都会根据您的需求进行扩展。同样,两者都应该满足您的需求。相反,看看语言和框架的哪些功能对您的应用程序有吸引力等。

https://stackoverflow.com/questions/91846/rails-or-django-or-something-else
Does Django scale?
Using Rails as a framework for a large website
https://stackoverflow.com/questions/3042259/django-or-rails
Rails or Django?

...

There are plenty of questions regarding this subject, and none of them answer the question - there's no right answer.

I don't think you should choose a framework on those two metrics. Unless you are building the next Facebook, both will scale to your needs. Similarly both should perform to your needs. Instead have a look at what features of the languages and frameworks appeal to your application etc.

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