多层/多线程/基于事件的容器的语言选择
我想开始一个由多层、Web 层、事件驱动的业务逻辑、数据处理等组成的新项目。过去几年我一直从事基于 PHP 和 Java 的项目,从经验来看,Java (并且考虑到实现调度、ORM、AOP等的开源库)通常是一个不错的选择 - 当然,您并不总是需要容器,因为不同的层和服务可以用不同的语言编写、集成、与其他进程(例如 cron 作业)一起使用。
现在,鉴于我正在开始一个新项目,我想知道其他人对我的语言选择有何建议。我试图从 Python、Ruby、Erlang Google 搜索中找到一些答案,但当然这是一个收集一些好的建议和批评的好地方。
想法?
I would like to start a new project that consists of multiple tiers, the web tier, event-driven business logic, data processing, etc. I had worked on PHP and Java-based projects for the past few years and speaking from experience, Java (and given the open source libraries to achieve scheduling, ORM, AOP, etc.) is usually a good choice - and of course, you DON'T ALWAYS need a container as different tiers and services can be written with different languages, integrated, together with other processes such as cron jobs.
Now, given that I am starting a new project, I am wondering how would others advice me on the language choice. I am trying to find some answers from Python, Ruby, Erlang Google searches, but certainly this is a good place to collect some good advices and criticisms.
Thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我经常使用的是无所不在的 LAMP 堆栈(Linux、Apache Web 服务器、MySQL 数据库、PHP 服务器逻辑),如果我需要在后端做一些更密集的事情,例如处理大量语言数据,或运行网络命令和排序在将输出反馈回系统之前,我使用 Perl。所有这些实用程序/语言几乎在每个发行版的存储库中都可用,以及将它们一起使用的连接器代码(例如,php5-mysql,用于导入允许您使用 MySQL 的 PHP 函数)。
更新:我想在这个答案中添加一些想法,因为今天有人投票并提请我注意它。当我写这篇文章时,我正在尝试几种不同的技术,并且在很多方面我仍然坚持我之前所说的。 LAMP 比任何其他网络平台都要成熟得多。确实,从这种组合开始就不会出错。
话虽这么说,一年后,我在我的个人项目中大量使用了 Nginx 和 Python(通过 uWSGI)。我认为现在发行版对这两种技术的支持已经足够成熟,拥有大量站点流量的人应该真正考虑用 Nginx 替换 Apache。它提供静态资源的速度比 Apache 快得多。如果您想使用 PHP,您可能会使用 php-fpm 将 PHP 连接到 Nginx。如果你想使用 Python——它正迅速成为我最喜欢的语言之一,无论是因为它的性能还是它的语言特性都让我很喜欢——你将有大量的选项可供选择,以便将 Nginx 连接到Python,但我强烈推荐 uWSGI,因为它已经过测试并且速度非常快。至于数据库,我仍然认为 MySQL 足够强大,足以适应许多不同的情况。如果您不同意这种说法,我相信您有足够的经验来搜索许多全面的资源,显示几乎任何情况的利弊。
What I use regularly is the omnipresent LAMP stack (Linux, Apache web server, MySQL database, PHP server logic) and if I need to do something more intensive on the backend, such as processing lots of language data, or running network commands and sorting the output before feeding it back into the system, I use Perl. All of these utilities/languages are available in almost every distribution's repositories, as well as the connector code to use them all together (php5-mysql, for instance, to import PHP functions that allow you to use MySQL).
UPDATE: I would like to add a few ideas to this answer, since someone upvoted it and called my attention to it today. When I wrote this, I was experimenting with a few different technologies, and in many ways I still stand by what I said earlier. LAMP is vastly more mature than any other web platform out there. It's still true that you just can't go wrong starting with this combination.
That being said, a year later, I have been using Nginx and Python (through uWSGI) quite a lot for my personal projects. I think now distro support for both of these technologies is mature enough that people with significant site traffic should genuinely consider switching out Apache with Nginx. It serves static resources FAR faster than Apache. If you want to use PHP, you will probably be using php-fpm to connect PHP to Nginx. If you want to use Python -- which is fast becoming one of my favorite languages, both for its performance and its language features that have grown on me -- you will have a huge choice of options to choose from in order to connect Nginx to Python, but I highly recommend uWSGI for the simple fact that it's tested and it's very fast. As for databasing, I still think MySQL is broadly-powerful enough to suit many different situations. If you disagree with this statement, I'm sure you are experienced enough to search for many thorough resources showing pros and cons for almost any situation.