# web applications architectures comparison

- Thread: https://externals.io/message/33367
- Original archive: https://news-web.php.net/php.internals/33367
- Started by Nuno Lopes on 2007-11-21T15:26:50+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #33367 — Nuno Lopes — 2007-11-21T15:26:50+00:00

URL: https://externals.io/message/33367#33367

Hi,

I was assigned a class work in the university to compare web
applications architectures, mainly PHP vs
Java+Hibernate+Struts/Stripes. I'll need to provide some benchmarks
for some typical web apps.

Well, I'm a bit afraid that Java may win, because of the usage of
Hibernate, which caches sql stuff in memory. The first request is
usually very slow (10 seconds or more), but following requests are
much faster.

So, do you have any suggestions for which PHP application architecture
should I discuss? Like a standard pdo-based app, with files being
generated and stored on the server, possibly bypassing php completly
on the following request (like livedocs). Use a particular PHP
framework (cake, zend, ...)? Any useful case-studies that you may have
are also welcome.

(Although I participate in the PHP development for a few years, the
websites I run have at most 1.5 million page views per month, so
performance isn't an issue, hence my lack of experience in scaling PHP
apps..)


Thanks,
Nuno

P.S.: Sorry for the off-topic, but I didn't find a better place to ask this.

---

## #33368 — Lukas Kahwe Smith — 2007-11-21T15:34:04+00:00

URL: https://externals.io/message/33367#33368 · In reply to: #33367

> Hi,
>
> I was assigned a class work in the university to compare web
> applications architectures, mainly PHP vs
> Java+Hibernate+Struts/Stripes. I'll need to provide some benchmarks
> for some typical web apps.
>
> Well, I'm a bit afraid that Java may win, because of the usage of
> Hibernate, which caches sql stuff in memory. The first request is
> usually very slow (10 seconds or more), but following requests are
> much faster.

I would not be afraid of that. The question people have to solve is  
not one of performance but one of scalability and maintainability.  
Java tends to force people into this frame of mind to rely on one  
monolithic piece if software to solve all of their problems. This  
means a simple project ends up being way more complex from day one.  
Moreover if their single monolithic software fails them, they have a  
problem. This is the key point that Rasmus keeps saying .. what you  
want is a layered approach that allows you to solve your real world  
problems as they appear.

So if Java beats PHP in serving a half way complex page from a single  
server in # of requests per second I am still not impressed. The  
question is how long did it take to setup that server. How long will  
it take until it becomes too expensive to keep adding to this one  
server? What will you do for failover? etc ..

regards,
Lukas

---

## #33369 — Alexey Zakhlestin — 2007-11-21T16:33:09+00:00

URL: https://externals.io/message/33367#33369 · In reply to: #33367

I think a good example of php-technology would be symfony project +
caching in memcached

it can be made to work really fast


> Hi,
>
> I was assigned a class work in the university to compare web
> applications architectures, mainly PHP vs
> Java+Hibernate+Struts/Stripes. I'll need to provide some benchmarks
> for some typical web apps.
>
> Well, I'm a bit afraid that Java may win, because of the usage of
> Hibernate, which caches sql stuff in memory. The first request is
> usually very slow (10 seconds or more), but following requests are
> much faster.
>
> So, do you have any suggestions for which PHP application architecture
> should I discuss? Like a standard pdo-based app, with files being
> generated and stored on the server, possibly bypassing php completly
> on the following request (like livedocs). Use a particular PHP
> framework (cake, zend, ...)? Any useful case-studies that you may have
> are also welcome.
>
> (Although I participate in the PHP development for a few years, the
> websites I run have at most 1.5 million page views per month, so
> performance isn't an issue, hence my lack of experience in scaling PHP
> apps..)
>
>
> Thanks,
> Nuno
>
> P.S.: Sorry for the off-topic, but I didn't find a better place to ask this.
>
> --
> 
> 
>
>


-- 
Alexey Zakhlestin
http://blog.milkfarmsoft.com/

---

## #33372 — Gergely Hodicska — 2007-11-21T19:02:44+00:00

URL: https://externals.io/message/33367#33372 · In reply to: #33369

Hi!


Alexey Zakhlestin wrote:
> I think a good example of php-technology would be symfony project +
> caching in memcached
With symfony it is worth using Doctrine (a Hibernate-like ORM tool), 
which has built-in caching possibility.


Best Regards,
Felhő

---

## #33374 — Nuno Lopes — 2007-11-21T23:36:49+00:00

URL: https://externals.io/message/33367#33374 · In reply to: #33368

> > […]
>
> I would not be afraid of that. The question people have to solve is  not 
> one of performance but one of scalability and maintainability.  Java tends 
> to force people into this frame of mind to rely on one  monolithic piece 
> if software to solve all of their problems. This  means a simple project 
> ends up being way more complex from day one.  Moreover if their single 
> monolithic software fails them, they have a  problem. This is the key 
> point that Rasmus keeps saying .. what you  want is a layered approach 
> that allows you to solve your real world  problems as they appear.
>
> So if Java beats PHP in serving a half way complex page from a single 
> server in # of requests per second I am still not impressed. The  question 
> is how long did it take to setup that server. How long will  it take until 
> it becomes too expensive to keep adding to this one  server? What will you 
> do for failover? etc ..


Although I agree with you, my project is mainly about performance of 
different web apps architectures.
Anyway, thanks for your point of view. I might use it to convince my 
professor (who doesn't like PHP..) :)

Thanks,
Nuno
