Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Developing using the ETTK, Part 3

Grid services and Web services

Doug Davis, ETTK Technical Lead, IBM
Doug is the Technical Lead for the Emerging Technologies Toolkit (ETTK). Previous projects include WebSphere Machine Translation, Team Connection and IBM's FORTRAN 90 Compiler. You can reach Doug at dug at us.ibm.com.

Summary:  The previous article in this series examined the basics of Web services, what they are, and how to create them. This article explores a relatively new concept -- Grid services. In particular, what Grid services are and why someone would consider converting their traditional Web service into a Grid service.

Date:  19 Aug 2003
Level:  Introductory

Activity:  1232 views
Comments:  

Grid services

Writing and maintaining a simple StockQuote service and other stateless Web services is a fairly trivial endeavor. Aside from the specific operations offered by the service (in this case getQuote()) the user of the service doesn't need to know or do anything else -- just invoke the operation and get back the result. But, when a Web service wants to maintain persistent data (for example, become a stateful Web service) things become a little more complex.

Exactly how persistent data is queried by a client can vary. For example, the StockQuote service uses the getQuote() method to return a piece of data, a reasonable solution for that scenario. However, what if the Web service had several pieces of data it wanted to expose -- there is no standard (or easy) way for the client to get the list of data that it can query, nor is there even a standard way of getting or setting the data. For example, for each piece of data the service can offer a getFoo() and a setFoo() method, but is it then getfoo(), get_foo(), getFOO(), or getFoo()? Something as trivial as the exact format of the operation name can cause some annoying headaches. To help with issues such as these, a standard was developed called Open Grid Service Infrastructure (see Resources for a download link to a pdf file). The Grid infrastructure provides a standard way for clients to query the list of data (Service Data Elements or SDEs) that a service is exposing as well as a standard way of querying and setting that data.

Of course in order for the Grid infrastructure to manage this data for you it must be made aware of it. Depending on the implementation of the Grid specification, how you go about doing this will vary -- this article will refer to the IBM Grid Toolbox, which is based on the OGSA (Open Grid Services Architecture) implementation, which comes with the Emerging Technologies Toolkit (ETTK) (see Resources for a download link). In this implementation the port type in the WSDL for the service is modified with additional tags denoting the data you want to be made available; for example, you might add the following:

<sd:serviceData name="CounterState"
                type="counter-state:CounterStateType"
                minOccurs="1"
                maxOccurs="1"
                mutability="mutable"
                modifiable="false"
                nillable="false">
   <documentation>Counter State Complex Type</documentation>
</sd:serviceData>

This will tell the Grid infrastructure that a piece of data called CounterState, and of type CounterStateType, should be exposed to the client as an SDE. Once this is done, through the Grid client-side APIs, the client will be able to ask for the list of available Service Data Elements exposed by this service and then query each one's value or set it -- if that is allowed.

Once persistent data is introduced into the picture, other issues related to the management of that persistent data become very important, issues such as the following:

  • How long that persistent data remains around
  • How the user sees that persistent data
  • Whether all users see the same instance or have their own instance of that data
  • How the user can query the list of available instances if they are separate instances of this data (for each user).

The Grid infrastructure also provides a standard way for clients to manage this information -- in particular, it allows clients a way to create new instances of a service (which implicitly means new instances of the Service Data Elements because SDEs are associated with instance of services) and provides methods for managing and discovering those instances.

As an example, take one of the sample Web services found in the ETTK -- the AddressBook service. In that example, all users of the service will see the same set of addresses stored in it. If you converted the service into a Grid service, each user could create their own instance of the AddressBook service, thus allowing them to modify the names and addresses without effecting any other user's information. And, similar to SDEs, users can query the system to obtain the list of AddressBook instances that are available. Of course creating new instances of services could lead to storage issues. To help resolve this issue, the Grid provides a mechanism by which instances can optionally be given expiration times -- which gives the system an opportunity to destroy old instances of services automatically.

Another useful feature offered by the Grid infrastructure is a notification system. So, aside from being able to simply query the current value of a piece of data being managed and exposed as a Service Data Element, a client can request to be notified when one of those Service Data Elements is modified. This works by the client invoking the subscribe operation on the Grid service, telling it which data it is interested in and the location of the client's notification receiver. So when the interested data changes, the Grid infrastructure (on the server) will send a notification message to the client. This of course means that the client must be running a SOAP server itself in order to receive the message.

Aside from receiving notifications when Service Data Elements are modified, a client can also be notified when new instances of services themselves are created. This is done in a similar fashion -- subscribing to the Grid's registry itself. If you look at the Grid AddressBook sample in the ETTK you'll see how it uses this notification system to allow multiple clients accessing the same Addressbook to receive updates automatically as one of the clients modifies fields within the data. In Figure 1 is the interface this demo uses.


Figure 1. Interface used in the ETTK demo
Interface used in the ETTK demo

You can see there are two panels, each representing a client accessing the Grid's repository of address books. By using the top panel, new address book instances can be created. Then each client (in the bottom left or right panels) can select which address book instance to view by selecting it from their respective drop-down boxes. If both clients have selected the same instance, then, as changes are made in one, they are automatically (and immediately) visible in the other client's pane.


Summary

In a nutshell, the Grid infrastructure offers Web service developers a standard way of exposing persistent data and instances of their Web services regardless of their specific implementation. Likewise, clients will be able to manage their data and Web services no matter what implementation or environment their service might be running in.

In previous articles in this series there was more focus given to using Web services from a developer's perspective. In particular, code snippets and a more detailed explanation of exactly how to code up your Web services was given. Grid services, unfortunately, are a little more complicated than traditional Web services and, as such, most people find that they must use the tooling provided with the OGSA implementation. However, even with the tooling the steps involved and the necessary code changes require more in-depth discussions than there is space for in this article. With that in mind, this article has stayed at a high-level, exposing you to the overall concepts the Grid in an attempt to pique your interest. For a more comprehensive discussion and detailed coding examples you should look at the Web Services Track in the Emerging Technologies Toolkit. In there you'll find quite a lot of material to aide in your development and understanding of the Grid.


Resources

About the author

Doug is the Technical Lead for the Emerging Technologies Toolkit (ETTK). Previous projects include WebSphere Machine Translation, Team Connection and IBM's FORTRAN 90 Compiler. You can reach Doug at dug at us.ibm.com.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=SOA and Web services, Grid computing
ArticleID=10353
ArticleTitle=Developing using the ETTK, Part 3
publish-date=08192003
author1-email=
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers