Developer's Toolkit
Cleaning up Your API
Calling external services to provide features or data for your applications is a functionality that should be an important part of your app dev strategy.
- By Peter Varhol
- 03/15/2008
Many of you who read my column probably know that I enjoy writing geographic mashups using the Microsoft Virtual Earth API. This is a Web service that provides programmatic access to the Virtual Earth maps, letting you create your own mapping applications by calling a set of maps and functions from your ASP.NET pages. Applications using this service can be external Web sites or internal to an enterprise; it doesn't matter, as long as the HTTP calls can pass through the firewall.
I'm coming across more and more commercial Web services that provide the same ability. Among the dozens of Web services for data and processing, perhaps the best known is Salesforce.com. Other Web services are so highly specialized that they're only known in a specific industry or application.
Only a Matter of Time
If you're not yet calling external Web services to provide features or data for your applications, it's only a matter of time before this functionality becomes an important part of your application development strategy. You may even be writing your own service, for commercial use or for use by other development groups within your organization.
But there's more to it than simply exposing an HTTP, SOAP or remote procedure call interface, and perhaps writing a Web Services Description Language (WSDL) for that service. You have to make it worthwhile and safe for developers to use a Web service, whether it's external or internal. They need a high level of confidence that the Web service will perform up to the standards of their application. You have to make a service as easy to use and reliable as a component library is today.
Your Web service interface needs security and access, quality of service measures, scalability, and service-level agreement standards. From the standpoint of developers aching to add new features, these characteristics represent the seamy underside of building Web services.
How do you provide these features and measurements? A part of the solution is up to you. To a large extent, performance and scalability are your responsibility as an application developer. You have to do performance and load testing as a part of your development process. Once you've deployed the Web service, you also have to make sure that you're providing enough capacity for your users. That's true whether you're hosting the service yourself or using a hosting service provider.
Looking Outside the Box
But you can also outsource a fair amount of the necessary but unloved work to a small but growing set of services providers. One such services provider is Mashery Inc. The company refers to its service as an on-demand API infrastructure, but what it really does is provides the infrastructure surrounding your entire Web service. Mashery can host your Web service and, in doing so, supply some of the areas that are more challenging and less interesting to do on your own.
Here's how it works. By signing up for the Mashery service, the company will proxy your service through its network. If you use keys to provide access to your service's API, it will work with your keys or issue its own. It tracks usage of the API, and can throttle excessive usage, or cut off access altogether if a threshold is reached.
Mashery gives you reports on the usage of your Web service. The reports describe statistics such as the number of calls to the service, developers using the service and calls for each developer. (Mashery licenses by developer, because it has no knowledge of the number or scope of applications that might be calling a particular service.)
The company also recruits users for your Web service. It offers a listing of the Web services it supports for other developers. Some services providers may allow trial or limited access for evaluation purposes, in which case Mashery would manage that also. While the vendor doesn't host your Web service, you can certainly find a hosting service that can provide you with capacity on-demand if you need it.
Service Marketplace
In time, services such as Mashery may well become the marketplace for offering and leasing Web services of all types. You may start by visiting the Web site in search of a particular feature or specialized component that you need for an application. That feature may be especially complex to write yourself, or it may require costly or otherwise unobtainable data.
Over time, you may have ideas for your own service, or you may want to turn internal software into commercial services. You would naturally turn to the same service that you've been using on the flip side to manage your service, and the cycle comes around.
About the Author
Peter Varhol is the executive editor,
reviews of Redmond magazine and has more than 20 years of experience as a software
developer, software product manager and technology writer. He has graduate degrees
in computer science and mathematics, and has taught both subjects at the university
level.