Jump to content

Best AJAX friendly framework ...


lampstax

Recommended Posts

I m working on a new project, and normally I would just jump in and start coding, but since this site will take quite a bit of work to create, I want to make sure at least the foundation is solid.    As always, any advice is appreciated.    I have been coding PHP for a while but unfortunately being self taught, I probably missed out on a few important topics covered in computer science class.

 

That said,

 

The website is going to have to make use of heavy AJAX.   Almost a pure AJAX front end like Google Docs.   I have setup my own `framework` using Cache_Lite, Smarty, XAJAX, and a custom PDO wrapper for db access all nicely in `MVC` architecture.   It works .. fairly well .. but I'm not 100% sold on XAJAX.   I've seen sputter performance from it from a previous client website that hit around 100k concurrent user, but that might be because the client was pushing his hardware a bit too.   Any thought or suggestion for a more scalable or faster AJAX PHP library ?

 

Secondly, I am a bit concerned with how the site might scale.   Lets assume six, seven digit concurrent user level.    Would a main stream framework be preferable to home grown in term of speed, security, and expandability ?

 

There's a couple more misc issues, but these are the big two.

 

Would welcome any thought, experience, horror stories, or success stories.   Does most ( or all ) successful start up have to eventually switch over the an `big` frame work like Zend or CI or Cake ?  What are you experiences ?

Link to comment
Share on other sites

With a fully Ajax enabled application, your primary concern is concurrency. Foremost, you just need a fast server with a fast connection. Forming the response is secondarily, and I do not think it matters too much which framework you use. After the initial payload of JS, all that is left is small bits and pieces of data. Forming a response should be possible within 0.2 seconds, which would leave you 0.3 for network latency without the user getting annoyed. That should be easily possible with any current framework (except maybe Symfony), as long as you don't do too intensive stuff in these tiny requests.

 

With these type of applications, you usually have a large payload of JS initially. You have some options to reduce the cost of this:

 

1) Use a lightweight server to serve up static files

2) Try to ensure client side caching

3) Consider Gzip

4) Consider loading parts dynamically (only if it's REALLY big)

 

It's worth noting that IE 6 doesn't cache Gzipped JavaScript files, so depending on you public, you may want to forget about Gzip. Loading parts of the JS library dynamically is not as complicated as it sounds. It's sort of like require in PHP. The requests gives some indication that some JS is needed, it is included in the response and made executable with eval().  That's it. Only worth it if you have a REALLY big application, with lots of optional library files that may or may not be used during the visitors session. Remember to send an appropriate caching header when you're sending just JavaScript.

 

Only experience with something similar is an application using ExtJs and Zend Framework. Bottleneck in that was indeed the initial payload, and the heavy processing client side. It was really heavy on FF2 and Vista. It was decent in IE6 and 7, FF3 and Safari though. In fact it was lightning fast in Safari.

Link to comment
Share on other sites

For the javascript framework, if you want to use one, I suggest using google cache.  http://code.google.com/apis/ajaxlibs/documentation/  They already have the major frameworks there (jquery, prototype, mootools, dojo) and they are already compressed/gzipped and support versioning.  Then they also have plenty of bandwidth to serve.  The major advantage of this is once more and more people use google cache, the chances get better that someone already has googles jquery (for example) already in their cache from a different site they visited and so they client browser doesn't have to download it again for your site making it load very fast.  If they don't it downloads it using googles bandwidth, not yours.  Win-Win!

Link to comment
Share on other sites

For the javascript framework, if you want to use one, I suggest using google cache.  http://code.google.com/apis/ajaxlibs/documentation/  They already have the major frameworks there (jquery, prototype, mootools, dojo) and they are already compressed/gzipped and support versioning.  Then they also have plenty of bandwidth to serve.  The major advantage of this is once more and more people use google cache, the chances get better that someone already has googles jquery (for example) already in their cache from a different site they visited and so they client browser doesn't have to download it again for your site making it load very fast.  If they don't it downloads it using googles bandwidth, not yours.  Win-Win!

 

I would only do this if you are sure you are always going to be able to use googles version that they store because form what i see they only store the latest stable version so if jquery comes out with 1.2.7 and it break a plug-in, you will need that plug-in to be fixed.

Link to comment
Share on other sites

 

If you will use ajax to power the site then the only thing you really need is a framework with a lot of libraries for you to use and a very, very small "core" to load in order to power the system. The "core" are the files loaded when the system is first started up - before you actually do anything. Since you will receive lots more AJAX requests than someone running a site using plain HTTP, you will need a faster framework - or more powerful server to make up the difference.

 

Benchmark the frameworks before you start using them.

 

 

Link to comment
Share on other sites

Maybe because that's not what the OP is asking.

 

Yes you are correct.. But the title of the post says so. thats why I read this topic....And I only searched for the list ..

 

No, it says best Ajax friendly framework. To top it off, it is in the board "PHP Applications, Frameworks and Libraries > Application Frameworks".

Link to comment
Share on other sites

Maybe because that's not what the OP is asking.

 

Yes you are correct.. But the title of the post says so. thats why I read this topic....And I only searched for the list ..

 

No, it says best Ajax friendly framework. To top it off, it is in the board "PHP Applications, Frameworks and Libraries > Application Frameworks".

 

I love the strong use of BBCode going on in this post.  Kind of made me smile.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.