Comments on: The DB problem inherent to dynamic web pages https://shlomi-noach.github.io/blog/mysql/the-db-problem-inherent-to-dynamic-web-pages Blog by Shlomi Noach Wed, 22 Jul 2009 07:48:43 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: Roland Bouman https://shlomi-noach.github.io/blog/mysql/the-db-problem-inherent-to-dynamic-web-pages/comment-page-1#comment-2757 Wed, 22 Jul 2009 07:48:43 +0000 https://shlomi-noach.github.io/blog/?p=955#comment-2757 ” in itself, can slow down loading time; plus the page can get rendered awkwardly before all ajax calls are returned”

sure it can. but the trick is of course to make sure the most important things are rendered ASAP with the initial request. The remainder of the page gcan then trickle in through one ore more ajax requests.

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/the-db-problem-inherent-to-dynamic-web-pages/comment-page-1#comment-2754 Wed, 22 Jul 2009 05:20:55 +0000 https://shlomi-noach.github.io/blog/?p=955#comment-2754 @Roland,

True, with Ajax you can do nifty things. It does make for multiple HTTP connections, which, in itself, can slow down loading time; plus the page can get rendered awkwardly before all ajax calls are returned.

]]>
By: Robert Wultsch https://shlomi-noach.github.io/blog/mysql/the-db-problem-inherent-to-dynamic-web-pages/comment-page-1#comment-2751 Wed, 22 Jul 2009 04:39:00 +0000 https://shlomi-noach.github.io/blog/?p=955#comment-2751 In a short time I think lib drizzle will provide the answer that we are looking for in term of parallelization of queries.

When I worked on a newspaper website I got the front page down to around 5 queries, and story pages around 10. However even these few fast queries are not fast enough for many applications. One way or another cache management needs to be part of the discussion as I think it is a a powerful stop gap and part of an ideal complete solution.

]]>
By: Roland Bouman https://shlomi-noach.github.io/blog/mysql/the-db-problem-inherent-to-dynamic-web-pages/comment-page-1#comment-2724 Mon, 20 Jul 2009 15:33:05 +0000 https://shlomi-noach.github.io/blog/?p=955#comment-2724 Hi!

“Parallelization with web pages is not so simple, and requires understanding of multi threading programming. ”

For many cases, it might be easier to use Ajax to do parallel HTTP requests. Of course, this requires client side javascript, and you can’t parrallelize a whole lot due to a limited number of simultaneous HTTP connections, but still, Ajax does get the job done many times without requiring multi-threaded server side programming.

I do agree that a multi-threaded server side programming language would be nice – I have considered trying Java instead of PHP for that reason. But it’d be even nicer if there would be some way to do it in PHP too.

kind regards,

Roland

]]>
By: shlomi https://shlomi-noach.github.io/blog/mysql/the-db-problem-inherent-to-dynamic-web-pages/comment-page-1#comment-2723 Mon, 20 Jul 2009 15:12:32 +0000 https://shlomi-noach.github.io/blog/?p=955#comment-2723 Jsled,

You are absolutely right. I could have blocked on the collection of Futures.
I chose the above code because I believe it is slightly easier to understand for non-Java programmers. At least that was my thinking.

Thanks,
Shlomi

]]>
By: jsled https://shlomi-noach.github.io/blog/mysql/the-db-problem-inherent-to-dynamic-web-pages/comment-page-1#comment-2721 Mon, 20 Jul 2009 13:44:44 +0000 https://shlomi-noach.github.io/blog/?p=955#comment-2721 If you’re going to block until all of the queries have returned anyways, you might as well dispense with the CountDownLatch … just submit the queries and use the Futures to either return immediately (if they’re already finished) or block until they have finished. It’s a bit more straightforward, and will have the same runtime behavior.

]]>