Hand holding a pen at a whiteboard

REST API Orchestration

REST APIs are often positioned as a form of simplification, see also our earlier blog: simplification is a hoax. The granularity/scope of services is made smaller and the orchestration ends up with the consumers of our REST API. But how do your consumers know which steps they need to go through in the orchestration, and do they clean up the mess of half-completed transactions?

A real-life example

An information request comes in for the purchase of one of our products, and it concerns a potential new customer. That is of course excellent news.
In the existing situation, all information that is available through our portal or app, or from an external party, is offered to our service and processed by us as a whole. We take the burden off our consumer and take care of data integrity ourselves.

If we now switch to a REST approach and thereby change the granularity of the services to a "resource" level, the picture looks a little different. REST services are based on collections of resources, for example collection: "customers" | resource: "customer"

The responsibility for the orchestration is shifted to the consumer.

Are you struggling with a specific integration challenge? Or do you have a question about certain systems, applications or Integration as a Service? Get in touch with us.

The consequences for the provider and the consumer of the services

As the provider of the service we have certainly simplified: all complex logic in the service has been moved to the consumer. The REST services have been set up far more generically and can therefore also be used for other processes outside the scope of "information request for purchase of new product". But for us as the provider of the services, too, there are risks attached to this approach. We will sometimes have to take measures to clean up the "mess" of a half-completed process and so safeguard data integrity.
For the consumer of our service, changes are needed in the way of working: the orchestration has to be built in.

What options do we have?

Recipe for the consumer
REST service documentation by default contains a lot of information about the resources and the collections, but information about the orchestration is not standard. Ideally, the provider of the service supplies a "recipe" for the orchestration in the form of documentation.

  1. Check whether the customer exists (continue at step 3)
  2. Look for a case for the customer (if the case does not exist, continue at step 4, otherwise at step 5)
  3. Create a customer
  4. Create a case
  5. Create a task "call customer"

Orchestration service
Another solution is to still create an orchestration layer on top of the REST endpoints: the consumer dumps their data and is relieved of the burden, but you have not really achieved much compared with the existing situation.

Choreography (event bus)
The event bus is of course not a RESTful solution, but you can choose to use it alongside your REST APIs to cover this use case. Keep an eye on the WeAreFrank blogs for a detailed explanation of this topic.

Making a good choice

If you are considering converting your integration landscape to a REST architecture, get in touch with WeAreFrank! to help you avoid the pitfalls this change will bring.

Want to know more about how to build, test and manage a REST API with our Frank!Framework? Watch our how-to video.

Questions about this case?
Get in touch
Portrait of Jeroen Jansen van Rosendaal

Written by
Jeroen Jansen van Rosendaal