Groovy 或 Django

发布于 2024-08-03 02:05:44 字数 255 浏览 9 评论 0原文

我从未创建过高流量网站,所以我不知道最好的长期计划是什么。预算中没有专门服务器的空间。我目前正在为我当前的网站使用 VPS 托管。我打算继续使用 VPS 并迁移 grails。例如,我从 fatcow.com 查看了 Django 和 python 托管计划(看起来比 VPS 计划便宜)。哪个是更好的投资,通过 VPS 托管的 grails 或通过标准 python 托管计划的 django?短期和长期哪个会有更好的表现?

应用程序的前端是javafx,后端将是REST接口。

I have never created a high traffic site so I have no idea what the best long term plan is. There is no room for a dedicated server in the budget. I'm currently using VPS hosting for my current site. I was going to stick with VPS and migrate grails. I looked at Django and python hosting plans (which look cheaper than VPS plans) from fatcow.com for example. Which is a better investment, grails through VPS hosting or django through a standard python hosting plan? Which would have better performance in short and in long term?

The front end of the application is javafx, and the backend will be a REST interface.

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

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

发布评论

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

评论(7

坐在坟头思考人生 2024-08-10 02:05:44

在决定使用 django 之前,我也经历了与你相同的过程。我白天是一名 Java 程序员,我想要一个可以在业余时间制作的宠物项目。所以我给自己买了一个 VPS,并且提供了最便宜的套餐。我安装了 Java Web 服务器并部署了 Grails 应用程序,但事实证明它需要更大的内存。然后我意识到Java webapp需要很大的内存才能运行。于是我就去找一个非Java的框架。当时我没有太多标准,除了它可以在我当前的 VPS 计划上顺利运行之外。

我看了一下 django,我很惊讶:

  1. 它是如此简单且易于上手。它只创建少量文件(与 Grails 相比)
  2. 它具有许多 Grails 没有的内置功能:
    • RSS 提要框架
    • 评论系统
    • 管理系统(你会喜欢它的,它就像脚手架,只会更好)
    • 以及许多其他需要时间创建的 webby 功能
  3. 它需要更少的内存来启动,但它也可以很好地扩展

其他您只需比较 Groovy 和 Python。如果您是一名 Java 程序员,您一定会喜欢 Groovy 语法,因为它非常接近 Java。但Python也是一门很好的语言(尽管很多人不喜欢它的语法)。

如果你想使用JavaFX作为前端,那么你可以使用django来返回JSON数据或XML数据,并且你可以轻松地做到这一点,因为它有一个 内置序列化器 来执行此操作。

因此,总而言之,标准会深入到您需要的内容和您已经知道的内容。

I went through the same process as you too before deciding to use django. I am a Java programmer during the day and I want to have a pet project that I can make during my spare time. So I got myself a VPS with the cheapest plan available. I installed Java webserver and deploy a Grails app, but it turns out that it needs a bigger memory. Then I realized that Java webapp needs a large memory to get running. So I went to look for a non-Java framework. I didn't have much criteria at that time other than it can run smooth on my current VPS plan.

I took a look at django and I was amazed that:

  1. It is so simple and easy to get started. It only creates small numbers of file (compared to Grails)
  2. It has many built-in feature that Grails doesn't have:
    • RSS feed framework
    • Commenting system
    • The admin system (you gonna love it, it's like scaffolding only better)
    • And many other webby features that takes time to create
  3. It needs less memory to get started, but it can also scale really well

Other than that you're just going to compare Groovy and Python. If you're a Java programmer you're going to love Groovy syntax as it is really close to Java. But python is a good language too (despite that many people don't like it's syntax).

If you want to use JavaFX as the front-end, then you can use django just to return JSON data or XML data, and you can do this easily because it has a built-in serializer to do this.

So all in all the criteria drills down to what you need and what you already know.

合约呢 2024-08-10 02:05:44

我会坚持使用 Django。 Django 和 Grails 非常相似,但我更喜欢 Python 而不是 Groovy。 Python 的开发周期比 Groovy 的开发周期简单。例如,Python 控制台会立即启动,而 Groovy 控制台可能需要一秒钟的时间来加载。这只是一个小问题,但多次等待最终会令人沮丧。

I would stick with Django. Django and Grails are quite similar, but I prefer Python over Groovy. Python's development cycle is just less tedious than Groovy's. The Python console is e.g. started immediately, while the Groovy console can take over a second to load. That's just a small issue, but waiting a second many times gets frustrating in the end.

请持续率性 2024-08-10 02:05:44

有一个 Grails App Engine 插件不使用 hibernate。

http://www.grails.org/plugin/app-engine

就我个人而言,认为选择取决于您最喜欢哪种语言。如果您是一名 Java/JSP 开发人员,您可能会更喜欢 Grails。但是,如果您已经非常精通 Python,那么这是更好的选择。

以下是一些可以帮助您评估 Grails 的资源。

http://grails.org/Success+Stories
http://www.pubbs.net/grails/200908/12877

Python 已经很成熟并且很成熟。这里有大量的资源,如果你是 Python 爱好者,这无疑是一个不错的选择。

There is a Grails App Engine plugin that does not use hibernate.

http://www.grails.org/plugin/app-engine

Personally, I think the choice comes down to which language you like the most. If you are a Java/JSP developer, you'll probably like Grails better. However, if you are already quite proficient in Python then that is the better choice.

Here are some resources that might help you evaluate Grails.

http://grails.org/Success+Stories
http://www.pubbs.net/grails/200908/12877

Python is already well established and mature. There are plenty of resources and it is certainly a good choice, if you are a Python fan.

寒尘 2024-08-10 02:05:44

你看过 Google AppEngine 吗?您可以在那里运行 Django,这是一个很好的廉价开始方式。

Have you looked at Google AppEngine? You can run Django there, and it's a good cheap way to start.

踏雪无痕 2024-08-10 02:05:44

我还没有看到 CPython 和 Jython 之间的任何性能比较,但我确实知道 Django 现在运行在最新版本的 Jython 上。这还使您能够灵活地稍后使用 Java 或 Scala 重写应用程序的某些部分(记住,不要过早优化),如果您需要速度的话。

I haven't seen any performance comparisons between CPython and Jython, but I do know that Django runs on the latest version of Jython now. This also allows you the flexibility of being able to rewrite parts of your app later (remember, no premature optimization) in Java or, say, Scala, if you need the speed.

╰ゝ天使的微笑 2024-08-10 02:05:44

您可能需要考虑 VPS 环境中应用服务器消耗的内存占用量。如果您的 VPS 非常小(256 mb),那么如果您运行应用程序服务器 + 数据库服务器,则可能会耗尽内存。

You may want to consider the memory footprint consumed by the app server in the VPS environment. If your VPS is really small (256 mb) then you might run out of memory if you are running the app server + db server.

傲娇萝莉攻 2024-08-10 02:05:44

Groovy 的未来值得商榷。它的创造者詹姆斯·斯特拉坎 (James Strachan) 曾说过:

我可以诚实地说,是否有人向我展示了 Martin Odersky、Lex Spoon 和 Lex Spoon 所著的《Scala 编程》一书。 Bill Venners 早在 2003 年我就可能从未创建过 Groovy。

-- http://macstrac.blogspot。 com/2009/04/scala-as-long-term-replacement-for.html

我的 2 美分:使用 Python 和姜戈。跳过斯卡拉。认真考虑 Lisp。

Groovy's future is debatable. Its creator, James Strachan, has said:

I can honestly say if someone had shown me the Programming in Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I'd probably have never created Groovy.

-- http://macstrac.blogspot.com/2009/04/scala-as-long-term-replacement-for.html

My 2 cents: go with Python & Django. Skip Scala. Seriously consider Lisp.

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