Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

4. Connection Management

Chapter 4. Connection Management

As we have seen so far, Cloud Connectors abstract away most of the fuss of dealing with APIs: we haven’t needed to know whether a service provider is a REST-based service, a SOAP-based service, or some other custom protocol on top of TCP. But when service providers have more stateful protocols that require the management and sharing of connections, they may need some additional input from the end user of the connector to manage its state.

To put connection management into context, many early APIs, and some current APIs as well, support session-based authentication. In these schemes, the user typically first has to call a “login” method, which takes a username/password combination as input and returns a unique session key that represents that user’s session. The user must then include this session key in each request to the API, and then call “logout” when he is finished. Figure 4-1 illustrates a typical session-based authentication scheme.

This type of authentication maps very naturally to a website because users are accustomed to “logging in” when they start working with a particular site and “logging out” when they are done. But when it comes to web APIs, this proves more difficult because the client must keep track of state, manage concurrent sessions, worry about session timeouts, etc.

Instead, Cloud Connectors abstract away these types of processes and offer automatic connection management that will handle connecting, disconnecting, validating connections, getting a session identifier, and so on. This chapter will discuss in detail how to configure connection management features and fine tune your connectors for both performance and reliability.

Session-based authentication

Figure 4-1. Session-based authentication

  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint