问题
I've been arguing with some friends on the university, and we can't get to a point to which is the framework with more scalability for web applications (and still very fast).
One calls for jsp, the other one for ruby other for php and so on. Could i ask you to clarify us on what as more scalability potential?
Tks, hope I'm not duplicating anything I've searched but didn't found any previous question like this.
Edit: If you could point a comparison about this it would be good :)
回答1:
Ruby and PHP are not webapp frameworks. They are programming languages which are popular for web development.
Generally speaking, webapp scalability is not a property of a programming language, and a given webapp framework may at most not hamper scalability. Good scalability is more a property of application design.
There are way too many webapp frameworks out there for a point-by-point comparison that is anything short of encyclopedic.
Also, you can tackle scalability for a given application in several ways. One way is to have a well defined and narrow scope and aim awesome raw performance, so a single machine can serve bazillion of work units. The best example around is Mailinator.
Another way is to make it easier to serve increasing loads by "just" adding more hardware. Pretty much any database-backed webapp framework can scale this way: just add more application servers between a load balancer and a shared database back-end. If you frame the problem this way, your main concern is designing the application to minimize 1. database contention 2. database load.
The last way is design the system to be insanely parallel all the way. Google being the prime example.
In summary: languages or frameworks do not make scalable applications, software architects do.
EDIT: To be clear, my answer is focusing on scalability, that is the ability to handle increasing loads without changing design. This is a different property than speed of execution.
回答2:
Algorithms will count more for scalability than the language used.
That said, there will be differences in execution speed between the languages. I believe that Java (Servlets and JSPs compile to servlets, i.e., native code) will be faster than Ruby and PHP by some amount). There are also a tonne of web frameworks for Java that will encourage you to do things the best way for scalability.
Also design your app so that it can run happily behind a load balancer, and scalability becomes a lot easier :) This isn't my field of expertise however.
回答3:
Web framework scalability is a bit of an over thought question (some would say p155ing contest). Unless you are getting mega bucks (good luck with that these days) and can ensure millions of visitors per day all those frameworks can handle it well (as can ASP.NET).
Personally I would always choose ASP.NET. It is as scalable as anything and has the best developer tools. Only downside is hosting and operating system costs.
回答4:
(five years later...)
I found this blog post which benchmarks multiple language dependent web frameworks. And now this pretty much answers the question I had in 2008.
http://www.techempower.com/blog/2013/03/28/framework-benchmarks/
回答5:
You can also take a look at "What’s faster? PHP vs ASP vs JSP vs CGI etc"
I think Java/Java EE is the only "framework" designed from scratch to develop distributed/clustered applications and that encourages good practices to achieve it from specifications (EJB, JTA...).
But as usual, it depends. This kind of questions often tend to flame wars :)
回答6:
I'm not sure any of those frameworks you mention will seriously hinder scalability.
It all depends on the implementation.
I would concentrate getting your web app to work well first, and then worry about scalability when it becomes an issue. In other words "let's cross that bridge when we come to it".
回答7:
A: C ISAPI dll (or custom apache module) :)
Even then the overhead of the web server, parsing the http requests and serving the html pages makes the execution time of your apps almost irrelevant. If you run your app as a CGI app, then expect even less performance.
For scalability in the web, you're really talking about adding more servers and load balancing, taking load off the server by putting the database (if heavily used) on a separate server.
The raw performance of those languages are almost nothing to worry over. Use the one you want to use, that you will be most productive with. Worry over the other issues you'll run into - network io, security, correctness.
回答8:
Several good points already. My main point would be this: A person who knows python inside and out will probably be able to make more scalable code using python than using Java. And there are many massively big sites that use all the technologies that you mention, so I don't think there's really any big advantage either way.
For the most part, you should stick to what you're familiar with unless there's a really significant reason to go another way.
回答9:
I happened to come across this question and noticed that some talk about speed, others scalability. I wrote a blog post explaining the difference:
http://www.fransekman.com/scalability-or-performance-what-do-you-mean/
"A high scalability website is a website, which performance-level can be maintained by adding more capacity when the load increases". This can be achieved in any programming language and almost any framework. Some frameworks have built-in functionality, which may make some common scalability things faster to implement.
回答10:
A compiled language will generally run faster than an interpreted language so I think Ruby and PHP start behind the eight ball but It really comes down to how you use the language and how you structure the code.
All languages will have their own best practices and patterns to build scalable applications and often there will be compromises depending on the functionality of the proposed application.
回答11:
If you want to know how the major sites use LAMP to achieve scalability, you should take a look at database sharding.
回答12:
The choice of a web framework has less impact on the scalability (the ability to scale) than the architecture of your site. Most modern web frameworks lend themselves very well to scaling so it's really your deployment setup that needs attention.
来源:https://stackoverflow.com/questions/222970/scalability-on-the-web