Choosing between java or php for GWT!

For my new application for reading heavy databases, I need to use GWT and mysql. But when choosing between Java and PHP, I have some confusion, 1) JDBC with mysql is slower than PHP with mysql (won PHP) 2) if I use PHP, I have to use JSON to transfer data between the server and the client. 3) This json analysis and overhead processing can be easily replaced with fast RPC calls if I use JAVA (native JAVA) 4) GWT has a lot of support and a small framework for JAVA / RPC calls, so the performance is better.

Please help me choose a good one.

+7
java php gwt
source share
7 answers

I think both of them are very suitable. Although I understand that your need for performance is an important issue, I personally think that neither the SQL driver nor JSON parsing will be a performance issue later.

With most AJAX calls, network overhead (TCP handshake, etc.) takes up most of the time if you do not have large files to transfer. And then it doesn't matter what the backend is.

If you use Java and Application Server, your database connections must be combined quickly. If you use GWT RCP, you can easily reorganize your application if you need to make changes later, a big plus. If you find that some of your updates are two slow, the greatest performance improvement may be due to caching data on the client and / or aggregation of AJAX calls. This refactoring is much easier if you use Java both on the client side and on the server side.

+8
source share

GWT is an environment for building a web application using Java code. You can connect it to a PHP server (and there is documentation on how to do this). But, from my point of view, you are losing the main point of GWT, one language for your entire application.

If you really need to use GWT for your interface, also make your server in Java. If you use a different approach, use PHP + HTML + JavaScript.

My 2 cents.

+7
source share

One important point that, it seems to me, has been missed is cost. If you use PHP, your posting costs will potentially be significantly less. Adding Java to the equation usually means starting from a dedicated server or virtual machine (remember that the developed Java GWT interface is compiled in Javascript). Ignoring the cost of Java would seem like the obvious choice of the two, for the reasons mentioned above, mostly in one language and lighter RPC.

+4
source share

I think it really depends on what you want to record and in which you want to support it. Personally, I would use PHP, because I am personally more familiar with PHP.

0
source share

I would stick with Java as it is the official GWT language. If you use PHP, you lose the benefits of using powerful Java IDEs like Eclipse and IntelliJ Idea for development and debugging.

0
source share
0
source share

IF you use PHP for the backend, you cannot use "GWT rpc", you can use an asynchronous HTTP request (using RequestBuilder), but your hosting costs will decrease. I think it’s better to implement your backend using REST services (via PHP) and then call these services with your GWT application in the frontend (for example, using restygwt ). With this approach, you can easily change your underlying technology (or interface technologies) in the future.

Have a good time.

0
source share

All Articles