ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know that this could be classed as flamebait, but I am looking at developing an application, which is quite complicated and I can't make my mind up on the technology that I will use.
I have developed applications in LAMP over the past year or so, and used Java about 2 years ago when at university, so I have some experiance with both.
The application is basically an online ordering system for the ordering of electrionic data. The data can be ordered or a user can select existing data that can be either downloaded by http or ftp.
The application works like the following:
1. The users registers through the application, and their request is reviewed and an account created on their behalf, with access rights given to the data that they have already, bought the 'rights' to view.
2. The data is in two formats 'preprocessed' or requires processing. If 'Preprocessed' the users can select sections of the data or the entire dataset The application needs to, on the fly create the data file from the selection and add it to a list of files that are then generated into a compressed file either zip or tar.gz. This file is then avaiable to download. If it requires processing the user selects it to be added on an order list and can either be added to an FTP site or stored on another media (DVD/CD/Tape etc.)
3. A history of all selections need to be avaiable for billing and so that if needed the client can re-download their selection, which are regenerated when needed, in zip or tar.gz files.
So in summary it is very much like an ecommerce site however it is expected to do some processing itself on demand.
Hardware is not a problem as I am already looking at a 2-tier system, one database/data processing and the other good old web application server.
Now the loads will vary thoughout the year with peak periods, and loads during this time are expected to be very high. However the system will most likely tick over when not in the 'busy season'.
So from what I have said, which technology would you use? LAMP or Java (JSF/JSP/J2EE)?
I can see the benefits and drawbacks for both and I can't decide! Please help!
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Quote:
Originally Posted by tuxdev
Java and PHP aren't comparable.
Hmm, if they aren't, why are they so often compared ?
As the OP is experienced with both Java and PHP and given the fact each one can certainly be used successfully for this project, the right choice is to use the language/platform he is the most comfortable with.
The problem I have is that both have their benefits and drawbacks, both are more than capable to do solve the problem that I have, and both are scaleable, which is another important requirment.
The problem is that even though I look at both, and compare the two, I still can't make my mind up.
The thing is that if there was more than me developing the application then I think that it would be better to come to a conclusion. My boss is happy for me to use either.
PHP will provide you with a cheaper alternative. Not only in the obvious. If you need to bring on other developers in the future, PHP developers are "a dime a dozen" so to speak. This has the down-side of finding a good one much more difficult--but when you do, they typically don't get paid what Java developers do (at least in my understanding).
I must admit that I am biased though-- I've only done very minimal work in JSP. I started with ASP, then JSP, and now PHP. I haven't found a situation for what I do that PHP hasn't been more then adaquete. For me, the major benefits are GPL and community support.
If you can't decide, and you are the only one developing this project (thus other people coding now and in the future isn't likely), just go with whichever you are more comfortable working in. Heck, pick the one you think looks "prettier" if it's that close of a contenst. Because at that point it's really just preference.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
Java technology is open source and (recently) GPLd too.
Community support for Java is huge, I typically find answers to my questions in seconds by googling.
Java has a wider scope. It will eventually, as a platform, include PHP as one of its scripting languages. I would definitely go for Java, with a touch of PHP where and if needed.
I think that I am going to have to create a simple prototype in both and find out which is better. I think that is the only way that I am going to really find out which technology route to take.
Ahh the fun of it. Knowing my luck I bet you even after the prototypes I'll still won't be able to make my mind up...
<>
From experience with both Java and PHP, here's a firm, decisive recommendation:
It depends.
However, PHP5 will likely be your best bet. In fact, to maximize re-use you can use PHP on the front and back-ends to get up and running sooner. You'll always have the option of "Java-fying" (yep) later if performance or other requirements become evident.
Design-wise, it will clearly make sense to decouple the code-generation from the request/response aspects of this system via some sort of asynchronous/queueing system. Either technology, combined with your database of choice, can handle this.
That said, Java will give more control over load balancing, thread control, and nearing that ...ideal... of a transactional approach. The relative overhead of (designing), developing, and maintaining any java components might be suggested especially if you see the project scaling and potentially requiring coordination or parallelism between multiple backend systems, although (sorry) even this can be done in PHP as well.
As for performance, much can be done to bring the PHP code in line with the Java side, in many contexts even outperforming the Java side. We're seeing some light artillery directed this way and have probably stepped on a few toes already here...it's time to end this post.
(It is/was possible to import/use java classes in PHP. Not recommended in a production environment, but hey, since we're going out on limbs here...).
</>
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.