Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Why Zimbra is Written in Java and not PHP

  1. #1
    macguru is offline Intermediate Member
    Join Date
    Apr 2006
    Posts
    17
    Rep Power
    9

    Default Why Zimbra is Written in Java and not PHP

    Hi,

    Today I just got Zimbra working on our company server and was generally pleased. It does 90% of what we need, and I think its a great product with great support for even greater price.

    I have one question (or suggestion ???), since I am fluent in programming. Why Zimbra is written in Java and not PHP? Tomcat is slow and resource-hungry, even over local 100mbit net login process takes 20 - 30 seconds, despite hosting on 2.8 GHz P4 PC with fast 3ware RAID. On the other hand, compiled (with opcode cache) PHP programs are very very snappy. I am not a fan of any technology whatsoever, decision must be made on the basis of purposfulnes and not personal taste. Please do not consider as I am throwing stones, just curious....

  2. #2
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    18

    Default

    We tried to index MS Word and HTML docs in PHP and it didn't work. We tried to get Apache and PHP to compile and work with MySQL but ran into some trouble. We tried in Java with Tomcat and it worked. So we wrote the app in Java.

    - - Ok just kidding - -

    Real answer is we've got alot of Java fans and expertise here at Zimbra. A few examples:

    Anand - Worked on the JDK and some low level while at Sun, at BEA he work on JRockit

    Roland - Tech lead of security group on early JDK releases

    Satish - Led the team the invented JSP

    Scott - ex-CTO of BEA so has spent sometime under the hood of some serious Java applications

    Lots of other folks here but just mentioned a couple. I think you get the picture.

    - BTW: Java has almost nothing to do with the initial login. The first time hitting Zimbra you need to load the JavaScript application into cache. So it takes a little longer. Subsequent times should be much faster.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    daimer77 is offline Active Member
    Join Date
    Oct 2005
    Posts
    34
    Rep Power
    9

    Wink Many reasons for choosing Java over PHP

    Here we go:

    1) JSP/Servlets are faster and easier to scale. (At runtime they are already compiled, and runs in threaded mode). PHP must start a process each time a new request is made, which is very resource consuming to the OS. PHP is not suitable for large web solutions. That is also the reason You will never see large bank or govern solutions based on PHP.

    2) PHP is a scripting language not a real high level programming language, it has weakly type bindings, and is very difficult to maintain when large bulks of code is to be written. The code itself often appears unstructured and cluttered when one need to write large procedures for certain tasks.

    3) Clustering, failover and scaleablillity is almost impossible in PHP. Furthermore mulitprogramming, threading and advanced designpatterns is impossible to deploy in PHP.

    4) Java is a real high level language to be used in advanced solutions where stability and security has high priority.

    I deeply respect PHP for it's popularity today. But I don't believe many programmers consider it a real programming language they like to work with. PHP is specialized towards WEB usage, where Java is a general purpose programming language with unlimited technical options.

    I have worked both with PHP and Java/JSP/Servlets. I think both sides have advantages. But if Zimbra should appear as a serious competitor to MS exchange only an implementation in Java should be considered.

    Happy easter, Daniel Mersebak
    Last edited by daimer77; 04-12-2006 at 02:15 AM.

  4. #4
    macguru is offline Intermediate Member
    Join Date
    Apr 2006
    Posts
    17
    Rep Power
    9

    Default Re: Why Zimbra is Written in Java and not PHP

    Yes, I've got your point. As long as software works as expected, its underlying technology does not matter. You have a lot of highest-class Java specialists in your company, so obviously you have choosen Java. What I like in PHP is very quick prototyping with template engine (like Savant) and adodb, plus enormous number of third-party class libraries. However, debugging PHP is a nightmare, I am simply use "echo" in problematic code to get a clue what is going on (stone age, eh ?).

    We have one client (large international advertising agency), which year or a couple ago have choosen MS Exchange as their corporate mail platform. Now they have numerous troubles just as expected. They also considered Open Exchange, but their buttheads in London moved toward MS (local branch I have contact with had only one option - to submit). Have you sold Zimbra to the large customers who have thousands of sites abroad (and huge e-mails, like 50 - 100 mb each)? Personally, I am in doubt of scalability of Java solutions because of JVM overhead. Such organizations have a lot of designers which work on Quad-CPU Macs, and they certainly will smell rats about 20-30 sec login process. I am using Dual CPU Mac and AhlonXP 1600 Linux PC, both with FireFox, and I have to say clicking on tabs/options leads to short pause, which is related to AJAX I think.

  5. #5
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    18

    Default

    We have customers with thousands of mailboxes deployed running some heavy corporate traffic. Some of these are public knowledge, and others can be reviewed under NDA or as part of the sales/trial process.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  6. #6
    StefanD is offline Project Contributor
    Join Date
    Oct 2005
    Location
    Belgium
    Posts
    68
    Rep Power
    9

    Post

    Have you sold Zimbra to the large customers who have thousands of sites abroad (and huge e-mails, like 50 - 100 mb each)? Personally, I am in doubt of scalability of Java solutions because of JVM overhead.
    We did buy zimbra, not for thousands of sites abroad but just for one site and have mailbox sizes between 100MB - 1GB, except a few known bugs/enh (The most of them are already solved in the development version) we are totally happy with zimbra.

    about 20-30 sec login process
    For the first time now, I timed the login process and for me it's just about 4-5 sec. Using Fedora Core 5 with firefox 1.5.0.1. I have to admit, it's a pc with 2GB ram, so maybe it's more a client side issue, than a problem with zimbra developed in java.

  7. #7
    dijichi2 is offline OpenSource Builder & Moderator
    Join Date
    Oct 2005
    Posts
    1,176
    Rep Power
    11

    Default

    php is very good for prototyping, and for developing most web apps up to but probably not including enterprise level! it's possible to write nice tidy php code but most php codebases you see are from non-disciplined beginners and the vast majority is junk, hence it's bad reputation. it's quite easy to cluster, load balance, scale, failover, and easy to debug (look at your logs, not echo!!). it's quick to program and reasonably quick to run for simple tiered web stuff. Horde/IMP well optimized can run very large mailboxes very quickly, so it is possible to do. However, with complex scripts and under heavy loads it runs like a pig, and it's not really suitable for running command line stuff or daemons - it can do it but it feels wrong.

    perl and java seems to be a perfect cross-platform mix for zimbra, i'm very very very impressed by the stability of the java code in particular. each release seems to use less and less resources of the host machine and respond quicker. unfortunately java is less easy for sysadmins/wannabe programmers to jump into hence i think the relative lack so far of community contributions, but i've no doubt they will come in time. well done guys so far!

  8. #8
    alangb is offline Member
    Join Date
    Apr 2006
    Posts
    10
    Rep Power
    9

    Default

    Quote Originally Posted by dijichi2
    php is very good for prototyping, and for developing most web apps up to but probably not including enterprise level! it's possible to write nice tidy php code but most php codebases you see are from non-disciplined beginners and the vast majority is junk, hence it's bad reputation. it's quite easy to cluster, load balance, scale, failover, and easy to debug (look at your logs, not echo!!). it's quick to program and reasonably quick to run for simple tiered web stuff. Horde/IMP well optimized can run very large mailboxes very quickly, so it is possible to do. However, with complex scripts and under heavy loads it runs like a pig, and it's not really suitable for running command line stuff or daemons - it can do it but it feels wrong.

    perl and java seems to be a perfect cross-platform mix for zimbra, i'm very very very impressed by the stability of the java code in particular. each release seems to use less and less resources of the host machine and respond quicker. unfortunately java is less easy for sysadmins/wannabe programmers to jump into hence i think the relative lack so far of community contributions, but i've no doubt they will come in time. well done guys so far!
    PHP is a fantastic language for any form of web application, especially when combined with AJAX. If you are serious about PHP prgoramming then you want to be heavilly into classes and use a sensible IDE such as Zend Studio (www.zend.com) which allows you to debug your scripts line by line in realtime (plus many other brilliant features).

    Sometimes Java is an overkill - but each to our own eh?

  9. #9
    dijichi2 is offline OpenSource Builder & Moderator
    Join Date
    Oct 2005
    Posts
    1,176
    Rep Power
    11

    Default

    PHP is a fantastic language for any form of web application, especially when combined with AJAX. If you are serious about PHP prgoramming then you want to be heavilly into classes and use a sensible IDE such as Zend Studio (www.zend.com) which allows you to debug your scripts line by line in realtime (plus many other brilliant features).
    OOP in PHP has only matured in version 5 which relatively few people have deployed yet in anger due to lack of backwards compatibility, and is still pretty crude compared to Java. It's also extremely slow running long complex scripts, even precompiled with the various accelerators out there, and i think it's inherently unsuited for clean, fast AJAX systems. But aside from that it's fantastic - I use it almost exclusively for web stuff Zend is proprietary stuff which I'm glad to see hasn't really taken off, but the upcoming Eclipse support looks v.promising.

    I must say that Zimbra has single-handedly changed my view on server-side Java, and I intend to dip my feet in the water and write some zimbra stuff when i get a chance.

  10. #10
    alangb is offline Member
    Join Date
    Apr 2006
    Posts
    10
    Rep Power
    9

    Default

    Quote Originally Posted by dijichi2
    OOP in PHP has only matured in version 5 which relatively few people have deployed yet in anger due to lack of backwards compatibility, and is still pretty crude compared to Java. It's also extremely slow running long complex scripts, even precompiled with the various accelerators out there, and i think it's inherently unsuited for clean, fast AJAX systems. But aside from that it's fantastic - I use it almost exclusively for web stuff Zend is proprietary stuff which I'm glad to see hasn't really taken off, but the upcoming Eclipse support looks v.promising.

    I must say that Zimbra has single-handedly changed my view on server-side Java, and I intend to dip my feet in the water and write some zimbra stuff when i get a chance.
    I haven't had any issues with large scripts, but that could be because I break myu code up into small common libraries that get loaded only when needed - so I don't really have any scripts that are incredibly large to comment on speed issues ... I just don't get them(!).

    I mentioned Zend from a code authoring and debuggin point of view - it has cut my development time by at least 60%. In large this is due to the live debuggin facility, but also the coding ide has great facilities that make coding so much faster.

    In reference to your last comment - I agree, that why I'm here! The only problem I have is the time to learn it all. I have a new project that Zimbra + java is ideally suited to - a good opportunity to learn I think, but the customer wants it this side of christmas!

    The other problem is that I can't run Zimbra on my development server, which means runnning another server which I don't have. Plus I don't have the time to muck around with custom ports and getting Zimbra et all to run together.

    Looks like I'm going to have to dip my toe in to the mires of Ajax + PHP.

    I use PHP5 on Apache 2, by the way, which is fantastic - much faster than 4 and no problems to date.
    Last edited by alangb; 04-16-2006 at 09:10 AM.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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