Evaluating Web Service Apis: Finding a Flexible Video Management System
Total Page:16
File Type:pdf, Size:1020Kb
Evaluating Best-of-Class Web Service APIs for Today's Multi-platform Video Management Solutions By Alan Ramaley, CTO, and Nick Rossi, VP Engineering thePlatform for Media, Inc. ABSTRACT services in a deployment and scale them independently. Video management and publishing platforms are evolving to meet the market’s Areas of focus will include: need for reaching consumers with reliable, high-capacity services – anytime, anywhere, Breadth – an API should expose all on any device. As such, solution providers the functionality in the underlying have to integrate their technology with a service vast set of devices, systems, and Cohesion– a given service should environments—includingauthenticated have a single area of responsibility syndication, third-party websites, mobile Security – we will compare and devices with vastly differing specs, set- contrast five common models topboxes, connectedTVs, smart over-the-top Web standards– support for devices, andthird-party services, such as ad REST,Atom, RSS, and JSON for data networks and content discovery engines. services, and REST and SOAP for business services. Web service application programming Data access – APIs should provide interfaces (APIs) play an integral role in very flexible read and write access to enabling content providers and distributors service data to succeed in a consumer driven market Notifications – with a comparison of that’s in constant flux. Developers at media push vs. pull notification models. companies and TV service providersneed Extending the schema– what to look flexibility and open APIs to adapt to for to make sure a service can changes in TV, online, and mobile video support your custom data. publishing. Scalability– how to build scalability into an API at the core, to allow for This paper provides an in-depth evaluation a 99.99% read SLA of the most important features web service APIs should offer and explains why those Lastly, the paper focuses on some of the best features are important. It also examines the evolution of APIs and recommends best developer support practices, including API practices for a flexible, reliable and easily clients and documentation. managed API set. Several areasfor evaluation are examined and explained, all with an eye towards how APIs informed by service- oriented architecture (SOA) can be used to decoupleand safeguard business-critical INTRODUCTION BREADTH The recent introduction of Time Warner Cable’s iPad application is just one example First, APIs should expose as much of the of the kind of services and applications that video management system’s functionality as service providers and media companies can possible. It’s very hard to predict what parts develop in-house by taking advantage of of your system you’ll need to automate, open web service APIs. based on where customer needs take your business. So,the more elements are available Going forward, web service APIs will via the API, the more flexibility you have to continue to play a crucial role in enabling respond to a changing marketplace. developers at content companies and TV service providers the flexibility to develop Verification Process new services and respond to the changes in multi-platform video publishing. A good ad-hocapproach to testing an API’s breadth is to go to the management console When video management systems were or user interface and ascertain whether the in their infancy, few offered a set ofAPIs technology vendor uses its own published that anybody could use to build a media API. If the vendor is not using it, not only is business.Most solution providers that a sign that they haven’t built their incorporated user interfaces on top of system for maximum adaptability, but it also proprietary systems that could only expand demonstrates that thevendordoesn’t rely on when in-house developers felt like adding its own APIs to support its product. features. If anoutside user wanted to conduct their own development on top of such This can often be checkedby watching a systems, they were out of luck. network trace while using the system’smanagement console. If there The industry has since learned that web areprivate protocols or undocumented service APIs are a critical component for payloads going back and forth, then it’s content providers and distributors, as it likely the public APIs aren’t complete enables them to adapt to a fluid marketplace enough or powerful enough for general where consumer demand and IP-connected usage. technologies are in constant flux. For this reason, APIs are now a standard part of every video management system. But COHESION despite the widespread adoption of APIs, not every system is equal. It begs the question: Each API endpoint should focus on a single How good are a given system’s APIs, and area of responsibility within the system and willthey continue to meet the needs of a use consistent operations and serialization media business as it grows? methods for everyobjecttype. With one set of rules to interact with the system, This paper explores the most developers can more easily integrate with it. importantcapabilities to consider when evaluating the effectiveness of a system’s APIs. Multiple Services Versus a Single magnitude more traffic than others, and the Monolithic Service mix of read vs. write traffic varies, but the deployment of a single switchboard API is In a provider’s API, if every call goes limited to an unhappy compromise between against a single “api.provider.com” or traffic capacity and cost. “services.provider.com” endpoint, with some kind of “command” or “service” One must be rigorous about dividing parameter as a switchboard, that means the services into areas of responsibility to avoid API provider has implemented a single these pitfalls. A good system will split its monolithic endpoint that contains all APIs. APIs into separate, focused services in which each API endpoint has a single job. For example, you might see calls like this in This ensures that other services aren’t a monolithic API: affected if unexpected load hits one piece of the service, and the deploymentcan scale http://api.provider.com/index.php? each endpoint as appropriate. For example, service=baseentry&action=list if there is an abundance of feed requests, http://api.provider.com/index.php? administrators can simply add another feeds service=multirequest&action=null server instead of spinning up another http://api.provider.com/index.php? instance of the entire API stack. service=flavorparams&action=list http://api.provider.com/index.php? Data Services versus Business Services service=accesscontrol&action=list http://api.provider.com/index.php? There are two basic types of web service=partner&action=getInfo services: A monolithic API has several drawbacks: 1. Data services, which handle stateful persistence of metadata. First, it makes federated deployments very 2. Business services, which are difficult,where some data is local to the stateless services with business logic content or service provider while other data that interactswith the data in data is in the cloud. For example, youmight want services. to use an API cloud for most services, but store end-user transaction data locally for The best approach is to look for a web- securitypurposes. A single, monolithic API service framework that follows the endpoint does not have this capability. principles of service-oriented architecture (SOA), which decouples data persistence Second, it puts a limiter on how fast the from business logic so that services of each provider can extend the service. As the kindcan be deployed and optimized feature set grows, provider development will independently. lag as internal teamsare encumbered with the increasing overhead ofcoordinating Base Objects feature work and deployments in a single code base. Optimally, every data service object has a base object with identically named Finally, there’s no single scalability strategy properties for identifiers, modification that works for all APIs: some get orders of history, and other common settings. Properties such as title, id, guid, added, starting with “Test”,one could execute the updated, and lockedshould beconsistent following query: across all services. Consistently identified http://<service>/data/<objectType>?byT properties are beneficial, especially when itlePrefix=Test&range=1-5 querying for data objects, since the same kinds of queries can be used across all In a system that implements base objects implementations. and base queries, the only things that need to change in order to perform the queries in If a framework implements these core these examples are the host name and the properties, you can use similar queries object name. Because the pattern repeats across various services. For example, if across services, once you’ve learned how “updated” is a base property, here’s an one service works, you’ve learned how all of example of a query you could use them work. inanyservice to get items updated in the month of September 2010: SECURITY http://<service>/data/<objectType>?byU pdated=2010-09-01T00:00:00Z~2010- APIs must be secure, and calls to APIs from 10-01T00:00:00Z end-user services (such as web form comments) must be completely separated If “id” is common, the following query from admin services (such as video could be performed in order to get object publishing). IDs sorted by when they were added: Admin Security http://<service>/data/<objectType>?fiel ds=id&sort=added The level of admin security that is needed depends on what the user is trying to Finally, if “title” is common, in order to accomplish. Web service API authentication search for the first five items that have a title methods tend to fall into one of five models. See the table on the following page, which outlines each security type: Security When You’d Use It Drawbacks Type API freely There are some cases where no security Not secure enough for admin available to is desired.