InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

The Need for an Event-based API in the Cloud

Posted by Boris Lublinsky on Feb 24, 2010

Sections
Operations & Infrastructure,
Enterprise Architecture,
Development,
Architecture & Design
Topics
Event Driven Architecture ,
Cloud Computing ,
Events ,
Architecture ,
SOA

According to William Vambenepe

Events/alerts/notifications have been a central concept in IT management at least since the first SNMP trap was emitted, and probably even long before that. And yet they are curiously absent from all the Cloud management APIs/protocols.

And yet the bulk of cloud management APIs today are based on polling. According to George Reese such polling approach:

... results in an incredibly inefficient use of CPU power... [at] the cloud provider as well as wasted bandwidth on both ends. We certainly do a number of optimizations to make sure we are polling as infrequently as we can get away with... [but] the bottom line remains, however, that most of our calls are wasteful.

To solve this problem, Reese proposed an event-driven API through which "the cloud provider notifies us of changes in resources we care about" He also noted some of the challenges his proposal is going to face:

  • An event-driven API demands a level of standardization that just doesn't exist in the cloud world today. You can't have every consumer designing its own callback API, and even supporting a cross-cloud system with every cloud provider defining its own callback protocol is problematic.
  • You can't provide data via the callbacks because providing data requires reverse authentication and complicates the entire process.
  • In the end, the consumer can't fully trust the callback API. It still needs to make some calls on its own to verify the cloud provider is actually working properly.

Reese proposed some simple solutions to deal with those challenges:

  • The introduction of a standardized callback format (should be very simple, something like [consumer-base]/[asset class]/[id])
  • Integration of event callbacks into the existing cloud APIs.

Based on his experience with the WS-Notification family of specifications, Vambenepe strongly supports the idea of simple APIs. In his opinion, a cloud-centered eventing protocol can be made simpler by focusing on fewer use cases (cloud scenarios only). The following elements, according to him, can be used as a foundation for a cloud eventing implementation:

  • Types of event. The client should be able to specify what kind of resource information he is interested in.
    How do you describe the changes you care about? Is there an agreed-upon set of states for the resource and you are only notified on state transitions? Can you indicate the minimum severity level for an event to be emitted?...
    In Vambenepe’s opinion, WS-Topics represents the best approach to solve these problems.
  • Event formats. Cloud events should adhere to a standard event model defining:.
    How is the event metadata captured (e.g. time stamp of observation, which may not be the same as the time at which the notification message was sent)? If the event payload is a representation of the new state of the resource, does it indicate what field changes (and what the old value was)?
  • Subscription creation. A standard subscription mechanism has to be created, considering the following questions:
    Do you get to change what filter the subscription carries? Can you change the delivery endpoint?... Who sets the expiration period? Can the provider set a max duration? Can you renew a subscription...? What if your subscription is being killed because your deliver endpoint is down?... Do you provide a separate... subscription management... endpoint (different from the event delivery endpoint) when you subscribe?
  • Delivery mechanism. There are many options for event delivery ranging from permanently opened HTTP connections (similar to COMET long polling) to HTTP callback URL to XMPP, to AMQP, to email.
  • Security. Depending on the delivery mechanism, different security implementations might be required.
  • Throttling. An eventing implementation should ensure that neither resource, nor consumers are overwhelmed by the amount of the emitted/received event.

As InfoQ has previously reported, asynchronous APIs are very important for cloud computing. Introduction of a full-fledged eventing protocol can solve this problem and more. Hopefully, authors of this specification will learn from WS-Notification and create the one that will be simpler without sacrificing coverage and reach.

  • This article is part of a featured topic series on SOA
WS-Topics by William Vambenepe Posted
Check out the paper : " Towards a common API for publish/subscribe" by Francesco Bongiovanni Posted
WS-Eventing is simple enough by Faisal Waris Posted
  1. Back to top

    WS-Topics

    by William Vambenepe

    Thanks for picking this up Boris, nice summary. I just have to correct your statement that "in Vambenepe’s opinion, WS-Topics represents the best approach to solve these problems."

    Here is what I said about WS-Topics in the blog entry you refer to: "some of this is handled by WS-Topics which I still like conceptually (I co-edited it) but is too complex for the task at hand."

    So no, I do NOT think that WS-Topics should be used to classify events for Cloud management APIs. We need something simpler.

  2. Back to top

    Check out the paper : " Towards a common API for publish/subscribe"

    by Francesco Bongiovanni

    Some research was done towards that goal actually. You can check a paper entitled "Towards a common API for publish/subscribe" from Peter Pietzuch et al. They are quite good in this domain (along with Prof. Roberto Baldoni from the University of Roma La Sapienza. (no, I'm not from their research teams :P but I do some research in this domain so i can assure you their work it's worth a look)

  3. Back to top

    WS-Eventing is simple enough

    by Faisal Waris

    W3C is working on standardizing WS-Eventing. It is limited but simple.

    Azure AppFabric has limited pub/sub but I believe that it will get better.

    For mobile applications, email may be good fit - especially with 'push' email capabilities (personally I have used windows mobile exchange client + .Net CF and SOAP to good affect).

Educational Content

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.