Note that there are some explanatory texts on larger screens.

plurals
  1. POStrictly server-side processing (no web browser interaction): is Java or PHP better for this scenario?
    primarykey
    data
    text
    <p>Here's the situation:</p> <p>I currently have a web application that uses PHP to serve HTML/CSS/JS and that talks to a MySQL DB. Completely vanilla and common. The PHP is a mixture of presentation logic (HTML generation, etc) and business logic (the app uses Ajax extensively to make requests for data or to tell the server to make changes to something).</p> <p>As part of a redesign of this system I am removing all of the presentation logic from the PHP. Instead, I will be using <a href="http://www.sencha.com/products/extjs/" rel="nofollow">Ext JS 4</a> (a javascript-based windowing toolkit / app) connected to a <a href="http://kaazing.com" rel="nofollow">web socket gateway</a> (a COMET/AJAX replacement that allows bi-directional communication) on the server. Let's wave a magic wand for a minute and forget about how the Ext JS 4 gets delivered to the browser and how it talks to the web socket gateway.</p> <p>What we are left with is a web socket gateway (written in Java and running persistently listening on a specific port for web socket connections) and some business logic / DB interaction currently written in PHP.</p> <p>At this point, I see one of two options:</p> <ol> <li><p>Keep the business logic / DB interaction in the PHP and execute it by calling either PHP from the command line or by having the PHP / Apache listen on a different port only for communications from the web socket gateway.</p></li> <li><p>Write a new Java or C++ application that will be persistent and listen on a specific port for communications from the web socket gateway. The business logic / DB integration is re-written in Java or C++ code and is part of this application.</p></li> </ol> <p>Would re-writing in Java or C++ give better performance than calling PHP over and over? (The PHP code is pretty cleanly written: object-oriented using packages like CodeIgniter and Doctrine).</p> <p>Would the performance benefits outweigh the hassle of re-writing all the business logic? Obviously dependent on many factors such as quantity of code but what is your gut feeling?</p> <p>In case it might influence your thinking / feedback, you should know that the web socket gateway (Kaazing) supports JMS, Stomp, AMQP, XMPP, or something custom you build yourself.</p> <p>Let me know if there is any other info I can provide to help you with your answers.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload