Harnessing a web service API with JavaScript – use the three-peat to avoid DNS failures

iofy download serviceWe’ve recently done work harnessing our iofy RESTful web services in JavaScript, especially the account management sections. Typically, in old-school fashion, an account management system is done server side with PHP, PERL, Ruby, etc, interacting with a database.

<sarcasm>That’s great when you want your heavy hitting developers to do design work or when you want your designers to do low-level work (or if you want to add a layer of management to your project where you need to separate out what parts of a page are owned by what developer/designer.)</sarcasm>

Why give yourself that headache? I had that headache for a while and have a direct solution. REST + JavaScript. My heavy hitters delivered RESTful functionality for our API that can be harnessed by pretty much anything capable of HTTP. My webmaster and designers can now, purely in JavaScript, harness this API and deliver all the functionality they need with all the gorgeous style they possess.

You can too (drop us a note and sign up as a reseller.) Our API is REST and we’ve got JavaScript libraries for harnessing it. The JavaScript queries the web service and receives an RSS 2.0 response. Parse it, and you’ve got everything you need for account management, content delivery, sales, and reporting.

Now for the difficulty in JavaScript web service API harnessing… The big surprise we ran in to initially was with the failure rate of HTTP requests from client-side JavaScript calls. DNS stinks. We would make requests and randomly get failures. As it turns out, DNS will fail between 1% and 3% of the time on a typical DSL connection. You need to retry that connection…

I recommend the three-peat for failed connections. In your JavaScript (or any other language), use asynchronous calls to a function which will repeat the HTTP request up to three times before erroring out. This reduces the likelihood of failure to a cube of the failure rate.

The worst DNS providers fail 3% of the time. Therefore the first request has a 3% chance of failure. The second has 0.09% chance since the 3% that failed are 3% likely to fail again (3% multiplied by another 3%.) The third try won’t fail unless something bigger is going wrong, drops the chance to 0.0027%. This is far more acceptable than 3 in 100 and effectively removes the DNS issue of web service connections.

Back to the iPhone

iPhoneA while back I wrote about switching to the BlackBerry 8800. The long route to that BlackBerry was because I wasn’t entirely happy with the iPhone – it was just a glorified phone/iPod when released. Now that Google Mail supports IMAP IDLE, 3rd party apps are running, and the 1.1.3 update can be used on my preferred T-Mobile (with a little massaging), I’m back to using it as the preferred lifestreaming device.

Until Term-vt100 works as well as Rove’s SSH client, the 8800 stays in my bag for backup…

A merger sort of week

msft-yhoo-amzn-adbl.jpgWow, what a week to be in the media industry. Yesterday with Amazon picking up Audible, and today with Microsoft’s bid for Yahoo!. It’s consolidation-for-growth time.

Audible is Apple’s provider for Audiobooks. Having Amazon, a primary competitor to Apple, pick up the company makes for some interesting times ahead of us. Will Apple continue to use Audible as its audio backbone? How about Amazon’s plans for Audible content and its distribution? What is the industry response? The conversations amongst my team and co-workers didn’t stray far from those questions yesterday.

And now today, with Microsoft finally taking the plunge and offering real money for Yahoo!, Inc, we’re in for some more great questions. Yahoo! has more users than any other service on the Internet. That part is interesting and you’ll see plenty of articles on the sale being all about Microsoft trying to compete with Google, but I’m more interested in Microsoft’s use of Yahoo! Music and their massive amount of users for that service.

Ian Rogers heads up Yahoo! Music and is accurate and honest about the direction the music industry is headed. If Ian’s views are as accurate as I think they are, and if the rumors of Yahoo! Music moving towards offering music for free are true, there are certainly more game changers coming.

I’m excited as hell for this to come true (if and when it comes true.) iofy corporation is a technology company which builds the backbones for delivering content. These changes are going to offer great opportunities for us as a small and agile company.

What a great way to end the week!