System Integration – Design Options

This article is about making a choice on a particular problem while integrating multiple systems. Integrating multiple systems is a common problem that Software engineers solve when their project has multiple systems.

While integrating multiple systems from the scratch there is a small design question. Which system initiates a data transfer? Will the data source system push data into the destination system? (Or) Will the destination systems pull data from the source? (Or) To build a mediator system which takes of pulling the data from the source and pushing into the destination?

Data Push

In this way, the source data system is tied to one or more destination systems and takes the responsibility of sending the required data to the destination system(s).


  • Data sync will be real-time.
  • No unnecssary polling needed.


  • The source could be connected only to a fixed set of systems. Including additional systems could be costly based on the design.
  • By taking up the responsibility of  Data Pushing, sometimes the source system could also additionally have to take care of concerns like the quality of the data being pushed to each system.

Data Pull

In this way, the system which requires data pulls the data from the source system as needed.


  • It’s always better when someone asks and gets only whatever they need. So by this way, the system which needs the data takes the responsibility requesting and getting only what it needs.
  • Since the destination systems know better what it needs when the needs changes, the data integration logic change will be in the same system.
  • Easy to setup any number of development/QA instances, since setting up the system itself will take care of the data pull.


  • Real-time data pull requires continuous polling, thereby increasing the number of requests to the data source.

A Dedicated Mediator

In this way, we build a dedicated system which takes the responsibility of pulling data from the source system(s) and pushing the data to the destination system(s). ETL/EAI systems are examples for this.


  • The systems are very much decoupled. This provides more flexibility.
  • When the whole ecosystems involve multiple systems, there will be more code reusability since there will be only one place which manages the data push/pull for multiple systems.
  • When the data integration requires a lot of data translation/transformation this solution makes the things simple. Since the only job of the mediator is pull->transform->push


  • Since this is integrated with two or more systems, this needs rigorous testing when there is a change in any of the dependent systems.
  • For the solutions involving simple data transfer, maintaining a separate system will be an overkill.
  • Setting up multiple Development/QA environments might require a dedicated instance of the Mediator instance.


In my opinion, whenever there is an expectancy of growing requirements for the data integration it’s better to go with a dedicated Mediator.

When there need is simple data load, it is better to go with Data Pull.

Go with a Data Push only if you have a strong reason to go for it.

Getting the continues sequence with the biggest sum in the given sequence

Gone through a problem in which we had to find the sequence with the largest sum in a given sequence. To elaborate the question, a sequence is given with positive and negative integers mixed say, {3, -4, 5,-2, 10}. In this, continues sequence with the largest sum is {5, -2, 10}. Tried the below solution with the time complexity of O[N].

* Class to find the continuous sequence with the largest sum in a given sequence.
public class MaxSumSequence
public static void main(String[] args)
// The sequence in which we need to find the (sub-)seuence with the
// largest sum.
int[] a={6,-6,1,11};
Sequence aMaxSequence = getMaxSumSequence(a);
System.out.print("The continuos sequence with the maximum sum:{");
for(int i=aMaxSequence.start;i<aMaxSequence.end;i++)

private static Sequence getMaxSumSequence(int[] a)
Sequence theMaxSequence = new Sequence(0, 0, a[0]);
Sequence theCurrentSequence = new Sequence(0, -1, 0);
for(int i=0;i<a.length;i++) { theCurrentSequence.end = i; theCurrentSequence.sum+=a[i]; if (theCurrentSequence.sum > theMaxSequence.sum)
theMaxSequence.start = theCurrentSequence.start;
theMaxSequence.end = theCurrentSequence.end;
theMaxSequence.sum = theCurrentSequence.sum;
// If the current sequence is not have a sum greater than 0, its not
// going to contribute for the sequence
return theMaxSequence;

* The class represent a sequence.
private static class Sequence
public Sequence(int theStart,int theEnd,int theSum)
start =theStart;
end = theEnd;
sum = theSum;
int start;
int end;
int sum;