Rolling out an Open API
May 14th, 2005Over at Oreilly Radar there is a piece up called How To Roll Out an Open API. I’ve been thinking about this kind of stuff quite a lot lately as I develop different web services and develop tools for web services.
I would like to add some comments regarding interopability and accessibility. Interopability and accessiblity go hand in hand. By interop I mean the little bugs that go along with web services because no one actually agress on what the specs mean. I view accessibility how as far you’re willing to reach out given interop issues. Here you have to consider how developers will write software against your web service. A couple things about this:
REST, SOAP, and accessibility
POX (plain ol’ XML) parsing is arguably the farthest reaching web service. Advocates of this approach often quote Amazon’s REST service as a prime example of how wonderful it is (POX != REST though…). Supposedly more people use the REST version than the SOAP version. The question to me is what type of queries are people doing with the REST API vs. the SOAP API. I’m going to guess that the more complex queries come from the SOAP API because WSDL makes it easier to consume.
Forggeting this though and coming back to accessibility: REST appeals to a particular type of developer and SOAP/WSDL another. For instance, I think a SOAP/WSDL service is much easier to consume in C# than a REST service. Other developers don’t feel this way. So no matter what your feelings are on REST vs. SOAP – it all depends on how far you want your reach to be. Do both SOAP and REST at the cost of more work and you will gain a farther reach.
Toolkits and accessibility
If you’re going to do wide distribution, test against a variety of toolkits. Make Java, C#, PHP, Python, and Perl integration tests. One of the things that I do is capture messages from various clients and throw them at my webservices in the unit tests. This is a good way to ensure that bugs don’t come back and bite you over again too…
WS-* and accessibility
On top of SOAP you can gain features, i.e. WS-Security, at the cost of reach and ease of use. Jeff Schneider is pretty optimistic about this part of the SOAP stack. My opinion is that portions of it are ready for the enterprise. But that if you’re creating a so called “Open API” for anyone and everyone, you should probably stay away. The tools just aren’t there yet (I’m working on some though, so if you have any suggestions…).
Versioning
In closing, one topic which isn’t related to interop/accessibility: Versioning. One of these days I’m going to sit down and do case studies on Amazon and EBay’s versioning practices. They both update their schemas frequently and support older versions for a period of time. Of course, this is very hard to do. I’m starting to reach the opinion that the only good way to do this is to deploy multiple versions of your application at the same time. I.e. version 2.0 is still running when 2.1 is out. They just use the same underlying database. More on this another time though.
Just don’t switch versions too often and follow good XML versioning practices.
To be continued
Developing effective web services is hard. Partly because of the inherent complexity and its still so new. 5 years may seem like a 1000 years in the tech world, but we’re still learning. Maybe the only hard and fast rule is they’re always going to take you more time than you think…