Amazon Web Services Just Got More Interesting

Thursday, August 21st, 2008
Amazon added ordering to their SimpleDB queries and released Elastic Block Store into Beta, these two improvements enable many more types of applications to run easily within their cloud system.

SimpleDB Ordering in Queries

A couple weeks ago Amazon made some improvements to SimpleDB, with the biggest one being their support of ordering query results. With this update you can now do queries such as getting the newest entries, or get the top rated items. Previously you could code around the lack of ordering on queries through different methods, such as pulling all the results and sorting them in the code, or keeping a list of the 10 most recent items in the DB that is update any time an item is updated. Those methods mean more work for the developer, and if not done carefully much slower response time for end users.

Now with the query ordering SimpleDB is much more attractive for building on top of for many of the typical website applications.

Elastic Block Store

If SimpleDB even with ordering still isn’t enough for you, you need a “real” database or just want to be able to use all the tools built for the existing databases then Elastic Block Store should interest you. It basically functions as a SAN within the Amazon cloud that you can connect to your EC2 instances. As it’s persistent across instances you can use it for permanent storage for items like the files for a relational database. It also has some nice snapshot/backup features putting the data into S3.

If you’re building a site that needs to be able to scale, Amazon is now an even more viable ...

Full entry and comments
Read other entries about Development
Written by James Punteney

Speeding Up Javascript Downloads

Tuesday, July 22nd, 2008
Looking at different methods of including Javascript in web pages to determine the fastest method for page loading and rendering.
This post was inspired by Non-blocking JavaScript Downloads as well as Steve Sounders Google I/O presentation.

The Test Method

To set these tests up I created 5 php files that each sleep for 2 seconds before returning one Javascript variable to the page. The 2 second sleep time and the tiny file size makes any network or bandwidth variability have a negligible affect on the overall time for the downloading. This isn’t meant to simulate real world, it’s meant to easily illustrate the differences in download time while eliminating network/bandwidth issues as much as possible. Here is an example of one of the php files:
<?
Header("content-type: application/x-javascript");
sleep(2);
// Setting Var for Safari 2 to check when script is loaded
??>
var d1 = true;
On to the tests

Including Javascript in the Header

This is the most common way of including Javascript files in a ...

Full entry and comments
Read other entries about Javascript
Written by James Punteney

Automated Mouseover Images using YUI

Sunday, July 13th, 2008
Setup image mouseovers quickly and easily just add a css class. The script preloads the images and will also verify that the over state image is available so broken images aren’t displayed.

When building sites often image mouseovers or rollovers are needed, while there are many ways to go about adding in this functionality all of them required more steps than ideal. At the very least you’d have to specify the over state image to use and attach some some javascript to the mouseover and mouseout events. To streamline this process I created this mouseover script, an example of it in action is to the right.

To enable the mouseover just include the required javascript files and then for any image that should have the mouseover apply the css class of ...

Full entry and comments
Read other entries about Javascript
Written by James Punteney