views:

204

answers:

6

Hello stackoverflowers,

we are designing a major webapplication for the www. It a social community site. and i would like to know witch direction i need to take.

What works faster, flex and php or java and flex? i've read that flex and php with amfphp is very fast (with AMFEXT).

but i have seen that 90% of the major companies here in Europe are hiring java / flex developers to develope major webapplications.

Our application needs to handle alot of users at the same time. Our application will be hosted in a datacenter later it will be hosted by a major cdn provider. Our application has a video (streaming and progressive streaming) a shoppingmall and a community area. due to the nature of our business model we think that our application will attract alot of users a day. so we must have a webapplication that works very fast. With a strong technology on the backend. Java or PHP (amf support) for the Database: We will start with mySql and make the switch to oracle and then to sas.

what is the right direction for our application? flex and java or flex and php ?

DJ

+2  A: 

I have no idea which provides "faster" execution - however, I do know that "faster" isn't the only reason to choose a language. Here's a general comparison of Java and PHP and here's another that compares Java, PHP and Ruby on Rails - neither one focuses on the language executing "faster".

Especially with Flex - you will most likely spend more time executing in Flex rather than in the backing server side language. Also, since the application is Flex - it should be possible to provide similar test implementations in PHP and Java and compare the results for your specific application.

The biggest part of the choice would be whatever language and platform your developers are familiar with.

Nate
Sensible answer.
rick
People seem to forget that Rails is an application framework, not a programming language. Comparing PHP to Rails is like comparing an icing pipe with Lego blocks.
secoif
A: 

This is a pretty subjective question. I believe that PHP tends to be a little bit faster but it really sort of depends on your applications requirements. From personal experience, I have been able to get more done with less code with PHP. Java has a much more strictly enforced object oriented approach which is actually quite nice whereas PHP is still lacking a bit in this area. For the most part, you will be able to accomplish the same things with both languages. I also feel that PHP has much better community driven support then Java which could be a factor. It really all depends on what you guys are most comfortable with. Both languages play well with Flash/Flex.

Chris Gutierrez
A: 

Java is faster than PHP in terms of pure execution time. Here is an interesting algorithm performance comparison that ranks a number of languages, showing Java to be approximately 300 times faster than PHP:

http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/

With that said, this is NOT a good approximation of the speed differences for real-world applications. A major bottleneck will typically be your database. However if your application requires a lot of processing that doesn't occur in the database, you may see performance improvement with Java.

One advantage in terms of remoting is that Adobe offers Blaze DS which is a standard implementation of AMF for Flex. They also include some messaging capabilities ("data push") which I don't believe are implemented in AMFPHP.

cliff.meyers
A: 

Language choice is largely (though not entirely) irrelevant in terms of speed. Very large deployments have been built on both, and the speed factor comes from good architecture and code. So whether you go with php or java, hopefully there are good architects/designers/developers versed in the ways of writing for performance involved.

Rog
A: 

Java is always going to be faster than PHP, unless you have done something very wrong!

BUT...

The speed of the server side script won't really be noticed by the user, because so many other things add to the time it takes to get a response from the server (network delay, propagation delay, etc). To the user PHP and Java will seem equally fast.

To the server, however, there is a difference. According to your post you plan to have many concurrent users. If each user takes 20% longer to complete a request with PHP, then PHP can handle 20% fewer concurrent users. So if you worry that the server will fill up and run at maximum capacity, then I would pick Java. If you don't expect that to happen for quite a while, then I would pick PHP, based solely on performance.

Of course there are other things to take into account, like what you can do with each language, libraries available, developers available to/how well you know each one.

I would also strongly advice against changing anything backend once the system is up and running. If you start out with MySQL, don't change to Oracle half way. Either stick to MySQL, unless it becomes impossible, or start using Oracle from the beginning.

Marius
A: 

Hello there,

I would say, try both by doing a prototype ( e.g 3-4 pages ) for each language, and run a few performance test , overall should not take more than one week to do these. Each language has its own pros / cons.

atsmir01