哪些 PHP 框架可以处理大型应用程序?
关于框架的许多对话都倾向于讨论易用性和开发速度。这些问题很重要,但它们往往来自于为不同客户一遍又一遍地创建新的低流量项目的开发人员。在这种情况下,能够在尽可能短的时间内为客户提供可靠的解决方案非常重要。我本人在这方面已经经营多年,使用过很多MVC框架并取得了很大的成功。
但是,当您在一个高流量应用程序上工作多年时该怎么办?现在,易用性和开发速度开始让位于可扩展性和速度。如果应用程序因速度和规模而无法运行,那么无论使用起来有多容易,或者编写代码的速度有多快,都无关紧要。
我对任何大型开发人员的问题是,框架在这种情况下仍然有用吗?如果有的话,哪些框架已在大规模生产情况下成功使用?
常见框架:zend、symphony、codeignitor、cakephp
Many conversations on frameworks tend to discuss ease of use and speed of development. These issues are important but they tend to come from developers who are creating new low traffic projects over and over for different clients. It is important in that situation to be able to knock out a solid solution for the client in as little time as possible. I myself have operated in this area for many years and have used many MVC frameworks with much successes.
But what about when you are working on a single high traffic application for several years? Now ease of use and speed of development start to take a back seat to scalability and speed. It doesn't matter how easy it is to use or how fast you can write code if the application won't function because of speed and scale.
My question to any large scale developers out there is, are frameworks still useful in this situation and if so which have been used successfully in large scale production situations?
common frameworks: zend, symphony, codeignitor, cakephp
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
WordPress.com 大约是世界上第 22 位最受欢迎的网站,它运行在(你猜对了)WordPress 上,这是一个开销很大的框架。所以这绝对是可能的。
无论您是否使用框架,当您的网站规模扩大时,您最终都会遇到同样类型的问题。在框架之上构建意味着您在处理其他扩展问题时将减少一个问题(无需编写自定义框架)。但是,您可能必须扩展或调整该框架才能与您需要扩展的任何技术一起使用。
总的来说,我建议你不要开辟自己的道路。找到一个与您正在构建的应用程序或网站相当的应用程序或网站,并找出他们用于构建该网站的技术和技巧(许多项目如 WordPress.com、Twitter、Google 项目都有详细的文档记录或拥有健谈的开发人员)并使用相同的应用程序或网站技术和技巧。他们提前解决一切问题会让您受益匪浅。
WordPress.com is about the 22nd most popular website in the world and it runs on (you guessed it) WordPress, which is a framework with a large amount of overhead. So it definitely is possible.
Whether you are using a framework or not, you end up working on the same kinds of problems as your site gets to massive scale. Building on top of a framework means that you'll have one less problem (no custom framework to write) while working on other scaling issues. However, you may have to extend or tweak that framework to work with whatever technology you need to scale.
And in general, what I would recommend is that you don't blaze your own path. Find an app or site that is comparable to the one you are building and figure out what technology and techniques they used to build that site (many like WordPress.com, Twitter, Google projects are well documented or have chatty developers) and use the same technologies and techniques. You'll benefit from them figuring everything out ahead of time.
补充一下其他人已经说过的内容:
您可以从任何框架作为起点开始。随着您的应用程序变得越来越大(我的意思是,很大),您可以开始修改框架并根据应用程序的特定需求对其进行自定义。毕竟,框架是大多数问题的通用解决方案。
您应该选择您最熟悉的框架,并在您的应用程序变得非常大时根据您的需求进行定制。当你还没有拥有一百万访客时,就没必要担心他们。
To add on to what the others have already said:
You can start off with any framework as your starting point. As your application gets bigger (and I mean, BIG), you can start modifying the framework and customizing it to your application's specific needs. After all, frameworks are a general solution to most problems.
You should pick whatever framework you're most comfortable with, and tailor it to your needs if your application ever grows extremely large. No point worrying about a million visitors when you don't have them yet.
php 的创建者最喜欢 codeigniter(过去),因为当他对它进行基准测试时,它是最快的框架。您可以在此处收听相关视频。
The creator of php liked codeigniter(in the past) the best, because it is the fastest framework when he benchmarked it. You can listen to video about that over here.
symfony 由雅虎在其书签和答案网站上使用。
您应该注意到,他们放弃了 ORM,因此数据库仍然是扩展的主要关注点(正如 Dmitri 所说),您可以阅读有关它的更多信息 此处。
Dailymotion 也使用 symfony。
我已经看到基于 symfony 的应用程序成功扩展到数千个用户,因此它是一个强有力的候选者。
symfony is used by Yahoo on it's Bookmarks and Answers site.
You should note they ditched the ORM so the database remains as the main concern for scaling (as Dmitri stated), you can read more about it here.
Dailymotion is also using symfony.
I've seen symfony-based applications successfully scale up to many thousands of users so is a strong candidate.
当涉及大型应用程序时,您应该关心的不是框架,而是数据库。
首先决定要使用哪个数据库,然后寻找对该数据库有良好支持的框架。如果您希望您的应用程序扩展到无限大小并且仍然速度很快,那么您应该从一开始就消除 Mysql 作为一个选项。
寻找 NoSQL 解决方案,找到您喜欢的一种。 Cassandra、MongoDB、CouchDB 是前 3 个选择,但还有其他选择。所有这些都是相当新的,但互联网上一些最大的网站正在使用它们。进行研究,选择数据库,然后选择框架。
大多数框架我都不了解,我看了Zend和Symphony2,两者都支持MongoDB,都相当快。我会看这两个中的任何一个,没有理由看其他地方。
但实际上,如果您计划编写一个非常大的应用程序,您应该真正编写自己的代码并且不要使用框架。这样,您将只拥有您需要的功能,而不会拥有您不需要的功能。请记住,大多数框架为您提供的功能比您真正需要的要多得多。不必要的功能通常会减慢您的应用程序的速度。
如果你想要一个快速的应用程序,那么它必须是精简的,只做你需要的事情,而不做其他事情。
When it comes to large applications, it's not the framework you should be concerned about, it's the database.
First decide which database you going to use, then look for a framework that has good support for that database. If you want your app to scale to unlimited size and still be fast, you should eliminate Mysql as an option right from the start.
Look for NoSQL solution, find the one that you like. Cassandra, MongoDB, CouchDB are the top 3 choices, but there are others. All of these are fairly new, but some of the biggest sites in the Internet are using them. Do your research, choose database, then choose framework.
I don't know most of the frameworks, I looked at Zend and Symphony2, both support MongoDB, both are pretty fast. I would look at either one of these 2, no reason to look anywhere else.
But really, if you plan on writing a really large application you should really write your own code and don't use frameworks. This way you will have only the functions that you need and none of functions you don't need. Remember most frameworks offer you a lot more functionality then you really need. Unnecessary functionality usually slows down your app.
if you want a fast app, then it has to be lean, only do what you need and nothing else.