Creating bespoke middleware to digitalise an airline’s operations

minute read


The client, a newly launched airline offering charter flights to short- and medium-haul destinations, aspired to be a cloud-based and entirely paperless business. As a startup, their business model lent itself well to fully digitalised operations. However, this greenfield development would sit within a complex ecosystem of third-party software and multiple sources of data ingestion. 

The Background

Much like any other airline, the client uses various services provided by a host of different vendors to conduct its business. To achieve their digital-first aspirations, the client knew they wanted a custom-built interface that would reconcile data from multiple aviation software products and feed these into the airline’s operations system. This would save time by allowing them to automate common tasks. It would also enable them to easily connect new system data, significantly minimising onboarding friction.

The Technical Bit

Lola Tech built a bespoke middleware to reconcile different data sets and help the client easily reconcile various system data. It was built using Node.js and deployed on AWS as Lambda functions using Serverless Framework. 

We set up the CI/CD pipeline with GitHub Actions. We then used the built-in secrets to manage the repository’s sensitive information. An additional benefit of GitHub Actions was that it enabled us to set up different configurations for different code repository branches. 

Serverless Framework allowed us to easily configure the Lambda functions from code, deploy our code using terminal commands and test our functions locally without having to deploy them to AWS. Using Serverless, we could also control which functions were deployed in which environment and allowed us to configure external plugins in order to send error alerts or upload files to Amazon S3 buckets.

Many of the third-party services feeding data into the client’s system use SOAP interfaces. The challenge here was that not many libraries deal with SOAP requests for JavaScript. After some research, we identified easy-soap-request as the easiest to use. By creating our own wrapper functions around the interface of the library and using the xml2js library to easily convert XML to JSON and vice versa, we were able to edit our SOAP requests; make SOAP calls by specifying the endpoint, action, and request; and use our SOAP responses in code. For services that use REST interfaces, we used popular JS library Axios.

Due to the sheer volume of data that an airline business generates daily, we knew that synchronous computing would lead to long run times for our function - meaning wasted time and extra bills to the client. To avoid that we leveraged the built-in asynchronous computing in JavaScript to reduce execution times by simultaneously making hundreds of calls. We also designed our code to minimise the dependencies between our data. We then isolated the operations that could be done without dependencies and made them asynchronous. 

The Results

Time was of the essence with this client, and by minimising dependencies and creating asynchronous code we sped up the execution of functions from minutes to mere seconds.

AWS Lambda and Serverless allowed us to easily deploy functions from our codebase, without having to manage the dependencies, environment variables and required classes. Using just one line of code we could easily decide which functions we wanted to be deployed to which environments. Running the code locally through Serverless is an effective method for reducing friction, and working with your functions in development is as easy as pressing the Test button on the AWS Lambda interface. Once we had access to the third party systems we were able to quickly create and deploy functions that started communicating with them.

Lastly, deploying to production was as easy as adding the functions to the production environment in the Serverless configuration file - a task that took less than three hours. By leveraging the efficiencies of these various open source tools we managed to build a bespoke middleware solution in six months, from discovery to final deployment. 

Final Thoughts

We can confidently say that AWS Lambda is a great option for building enterprise-grade middleware. It is easy to work with and deploy, and by using AWS cloud infrastructure any work built with it is also reliably available. This project was part of a wider engagement with the client that also included the design and build of two mobile apps, each tailored to a different audience. We will publish details of that particular work soon, but in the meantime, why not read more about app development on our blog (see link below).

Have a project in mind? Let's talk.

Contact us