View Poll Results: a better platform?

3. You may not vote on this poll
  • JSP

    0 0%
  • Servlet

    3 100.00%
  • PHP

    0 0%
Results 1 to 2 of 2

Thread: Servlet vs PHP

  1. #1
    biswajyoti is offline Member
    Join Date
    Jul 2008
    Rep Power

    Question Servlet vs PHP

    We have to build an online automatic system for evaluating c,c++,java programs for an online programming contest. We feel that the system will be faster if we use a servlet based system rather than a PHP based system though our team is more comfortable with PHP. The database in any case will be MySQL. We feel that a servlet based system can help us pool our database connections and will open up multiple threads rather than processes as in PHP. The system will involve a presentation layer for accepting the files and update the database. When the files get uploaded a system is triggered by RMI to check the files and inserts the scores in the database. A script can periodically update the ranks and create a static page with the ranks. A similar system is also possible in PHP. But which is more favourable platform? servlet or php? Is it possible that with one connections in one class I can handle all the db queries in servlet? Is this advisible? How can we optimize the system for speed more?

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Rep Power

    Talking I naturally optomize for time-domain criticality

    I suggest a Sevlet based approach, Connection Pooling is just one of a Coffee Plantation of built-in ( not drop in ) that lends to scalablitiy. In paticular, it is possible to do programmatic approaches ( with Java ) that are traditionally proven using an API that has parallelization exposed to the coder. While some may feel that is not a proveable basis for your design assesment, we can expect that counter-claims would be substantiated with hand-tweaked one-off designs run on powerful racks. Scriplet based approaches are definitely do-able, I have near-zero experience with any scripting language, but I am as of this moment writing a JSP, which amounts to a scriplet that calls a Servlet.

    The Servlet is paged in once in Tomcat. There is a call to init() when the code is brought in from persistent register. ( fancy name for disc ) After that, the Server just puts a new Thread on the entry()
    Java Code:
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    and the programming challenge reverses, we have to put synchronized(this) or something in the code as the server will just put new instruction pointers on a pattern of bits and bytes in ram that is already running.

    What we do to make Logging time efficient is have page ranks, domaing tracking or whatever be passed to a dedicated thread that does nothing but Buffering Logging. It sorta gets mildly sophisticated, traditionally is considered system programming beyond the domain of the every companies' coder, but so-far / so-good ~ I loaded a project in NetBeans a few days ago and the only thing if found in several hundred lines of code was the semicolon I had not removed prototyping my SessionMaster, I had skipped out on short notice to load NetBeans.

    Everything I have tried to program in seems to be already coded into Tomcat. I expect they will already have logging running on it's own buffer space.

    Just the way I would do it, with stuff I have not thought of yet already working .....

    message edit: Java can do NUMEROUS database access protocols. Recently I have begun to think one basis for the design of Java was to provide a uniform call paradigm such that database access could be made better by having a layer between the actual code that calls the db vis-a-vis the coder's view of what is going on. Database everything is all through Java, and as well something like constructing a URL is built in to the Libs,....

    I had someone ask me a question about threading recently, when I looked at the code it had a switch that could translate the call to fit any of five or six database call string syntax fomats. These were very common names we hear often.

    Java Practices -> Get database connection
    Java Database Connectivity - Wikipedia, the free encyclopedia
    Java: Database Connection Pooling with Tomcat
    Java Skyline
    Last edited by Nicholas Jordan; 07-10-2008 at 01:25 AM. Reason: mySQL + JNDC + JDBC + so on....
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Similar Threads

  1. servlet
    By kondalrao.p in forum Java Servlet
    Replies: 1
    Last Post: 09-06-2008, 02:10 PM
  2. Servlet
    By banie in forum New To Java
    Replies: 6
    Last Post: 04-11-2008, 06:18 PM
  3. JSP or Servlet
    By ravian in forum JavaServer Pages (JSP) and JSTL
    Replies: 4
    Last Post: 12-03-2007, 04:00 PM
  4. How to mix servlet & JSP
    By Swamipsn in forum Java Servlet
    Replies: 1
    Last Post: 08-08-2007, 01:57 AM
  5. Replies: 1
    Last Post: 08-07-2007, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts