Lack of good API design hurts the cloud

Application programming interfaces can make or break a cloud service -- so why are so many so poor?

APIs are fine-grain services that may be called by other systems, applications, or even people to provide access to core cloud services. They can be used for putting information into cloud storage, pulling information from cloud storage, updating a cloud-based database, validating data, monitoring a network -- pretty much anything you can think of.

The trouble arises when you look at the design of these APIs. They vary from the well thought out, well tested, and correctly deployed to those that fall into the category of "What were they thinking?" Unfortunately, I see more "What were they thinking?" APIs these days than good ones.

[ Get the no-nonsense explanations and advice you need to take real advantage of cloud computing in InfoWorld editors' 21-page Cloud Computing Deep Dive PDF special report. | Stay up on the cloud with InfoWorld's Cloud Computing Report newsletter. ]

There are two major tips to remember when you design an API for a cloud system, whether it's for simple storage or access to advanced high-performance computing cycles:

1. Fine-grain APIs and services trump coarse-grain varieties
There's always an argument around API functionality, but the best practice is to put very little in each API. Although this approach means you may need to invoke many primitive APIs at the same time to get the desired behavior, having more fine-grain APIs provides better control over cloud services.

Some people claim there's a performance penalty for having multiple fine-grain services rather than a few coarse-grain ones. I rarely see such a penalty, so my advice is when in doubt, break it out. If you experience performance issues, you can then combine the fine-grain services and their API with a coarse-grain version.

2. Error processing and recovery should be designed in
APIs often fail, yet entire applications are written to depend on hundreds of APIs working together. If a single API fails, the entire system is hosed.

API developers need to design in error handing and recovery mechanisms to deal with any potential failure, thus keeping the APIs and their services available. This means resources need to automatically restart, communication links need to be reestablished, and so on -- APIs and their services need to be resilient.

I suspect developers will put more effort into the design and the deployment of cloud APIs in the next few years. They'll simply have to: As public and private clouds get more pervasive, any vulnerable APIs will cause major problems whether for an internal cloud or an external cloud provider's business. I hope the cloud providers will meet the challenge sooner than later.

This article, "Lack of good API design hurts the cloud," originally appeared at Read more of David Linthicum's Cloud Computing blog and track the latest developments in cloud computing at For the latest business technology news, follow on Twitter.

Copyright © 2012 IDG Communications, Inc.

How to choose a low-code development platform