Colleague with glasses behind her laptop

REST API in my own application, or do I put an integration (layer) in front of it?

To integrate your application into your business processes, you want to connect it with other systems. But do you do that with a REST API directly from your application, or do you use an integration layer? In this blog article you will find out when it makes sense to choose an integration layer and what possibilities that brings.

REST in your own application versus an integration layer

When you have purchased an application, you have little influence on what an API does. You cannot change it. When you have built an application yourself, you can design a REST API however you want. Whether you build REST into your own application or put an integration layer in front of it depends on what your application offers and how generic it is. For an application that delivers a standard output or has only one consumer, you can choose to add the interface to the application.

If you want to serve more than one consumer or want to connect applications to each other with an API, it is smarter to place an integration layer between them. A REST API from an integration layer can easily be 'exposed' multiple times. Moreover, when you replace an application, you do not also have to change your entire API. So whether you choose REST in your own application or in an integration layer depends entirely on the purpose of your API.

The possibilities of an integration layer

When you choose to place an integration layer in front of your application, you make up for the shortcomings of the underlying system. If an application cannot handle duplicates well, you arrange a method for that in the integration layer. That layer is where the workarounds are allowed to live; you do not want them in your application itself. That applies to several capabilities you find in an integration layer:

Granularity

How you structure your data and how much data you share on request has to do with the granularity of your REST API. That is hard to change. When you only need an address, you may well get all personal data back. The same goes for the granularity of your application: does it fit your objects and collections? With an integration layer you decide which data you share, which can potentially differ per consumer. If you have to do that in your application, it is a lot of work.

Decoupling functionality from technology

In an integration layer you can handle technical details, documentation, management, validation and authorization, so that a REST API mainly does what it should do. Thanks to that decoupling, it is easier to connect new components to each other or separate them again.

Flexibility during upgrades

This has already been touched on briefly, but when you upgrade a system you also need a new version of your REST API. By putting an integration layer in between, that is not necessary. You connect the functional part of the API at the back end to the new version of your system. An integration layer makes you far more flexible and saves your consumers a lot of changes.

Orchestration

When you need information from multiple systems for a request, that is difficult if you have a REST API in your own application. You would rather not have an application in turn fetch data from another system to be able to answer the request. That makes it complex, and you have no insight into what happens at the back end. With an integration layer, those requests can run in parallel, information is collected and shared much more efficiently, and you keep an overview.

Mapping

You will find this functionality in the integration layer. Say your systems are in Dutch but your APIs are in English. In the intermediate layer you then arrange for the language to be converted without much effort.

Questions about this case?
Get in touch
Portrait of Erwin Beets

Written by
Erwin Beets

Want to talk through your integration strategy? We are happy to think along.