Swaran Soft
Technology

Data Engineering: Building Reliable Data Pipelines for AI

November 11, 20266 min readBy Yogesh Huja, Founder & CEO
Data Engineering: Building Reliable Data Pipelines for AI

Whilst problems with AI are commonly attributed to the models involved, in our experience this is seldom the case. Typically, it is issues with data – being delayed, missing, or even subtly restructured three weeks previously without anyone knowing.

A sales forecasting model based on incomplete sales data (for example, it excludes a region’s sales returns) will continue to give inaccurate results week by week. Similarly, a credit model trained on data with dates in differing formats will behave strangely. And a chatbot accessing old versions of a product catalogue may confidently recommend products which are no longer available. Again, none of these are model related and all represent data engineering issues.

Data engineers gather, process and structure data from various sources so that it can be securely distributed to those and the applications which require it. Where a company is keen to implement AI, this is fundamental. Here I describe the data engineering function, common areas of failure, and how robust data pipelines can be developed.

What does data engineering involve?

Data must be moved from source to consumer in a reliable and usable way. Common data sources in India include ERP’s (such as SAP or Tally), CRM’s, a small number of bespoke applications, team owned spreadsheets and increasingly IoT and external sources such as marketplaces and payment gateways.

Engineers then construct pipelines to extract, validate and process this data. It is then loaded into a central location, for example a data warehouse or lakehouse. Consumers such as analysts, dashboard interfaces and AI models can then consume this data.

Supporting functions include structuring data in a business relevant way within tables; managing pipeline execution and oversight; defining user permissions; recording data provenance and managing costs, particularly as data volumes increase.

Why AI has higher data expectations

Whilst traditional business intelligence can cope with imperfect data, if a sales report is slightly out or even a day late, somebody will recognise this and take corrective action. However, AI is more sensitive. Models learn from past data, and so if historical data is flawed, this will affect how a model behaves.

Many AI solutions operate in real-time. For instance, a fraud detection model must analyse transactions in real-time and so must receive updated data every few seconds. Nightly batch loading would therefore be inappropriate.

Un-documented ad-hoc scripting

It is not unusual to find vital business data being handled by a Python script produced by an engineer two years ago. This runs on one server and is often wholly un-documented. When this person departs, no-one else understands how the script works. Ideally pipelines should be version controlled and supported by suitable pipeline orchestration software. Documentation is also crucial.

Excel intervention

Throughout numerous data pipelines, somebody will download, amend in Excel and then re-upload data. Each of these manual actions introduces potential for error and slows down processing. Frequently, eliminating such interventions provides the swiftest improvement in data engineering outcomes.

Creating robust pipelines

PracticeWhat it means
Version controlPipeline code is stored in Git. Changes are subject to review prior to implementation.
OrchestrationPipeline execution, re-attempts and logging are managed using software such as Airflow or Prefect.
ValidationAutomated schema, volume and business validation occurs on each pipeline load.
Oversight and notificationIssues and delays are reported instantly to the responsible team rather than the following morning.
ProvenanceAll significant data fields can be related back to source systems.
PermissionsRestrictions and/or obfuscation apply to sensitive data including PAN and Aadhaar related information and salary details.

As with application development, this functionality is nothing new. Unfortunately, however, data teams often neglect it as initial pipelines tend to be hastily devised and later become centrally important.

Selecting the right infrastructure

Whilst there is no universally applicable infrastructure solution, there are common approaches which address most requirements. A data warehouse is ideal for structured business data (for example sales, finance and human resources) as querying tends to be regular and there is an emphasis on report generation. Conversely, data lakes or lakehouses are appropriate for large quantities of varied data such as logs, sensor data, photographs and documents – often required by AI. For real-time decision making (for example in fraud detection or stock level updating) streaming pipelines are also essential.

Typically, enterprises adopt a hybrid infrastructure solution. Crucially, you should begin by analysing your actual use cases rather than attempting to replicate an infrastructure schematic seen at a conference.

Fortunately, open source technology can now address all infrastructure areas. Orchestration can be achieved via Airflow, data transformation using dbt and data can be stored within PostgreSQL or Apache derived systems. Application data is often stored using Supabase or equivalent. This avoids vendor lock-in and allows the infrastructure to be hosted either internally or within an Indian data centre, facilitating simplified compliance with the DPDP Act.

Data privacy is also integral to infrastructure design

As stipulated by the DPDP Act, businesses must understand what personal data they process, together with the rationale for doing so and who can access it. Data engineering is where this is implemented. As data enters a pipeline, it should be labelled to highlight whether it is personal. Where complete data is not required, it should also be obfuscated. Furthermore, a log of who has accessed what data should be maintained. Unfortunately, adding these capabilities to an existing data warehouse is cumbersome. Ideally, they should be incorporated from the outset.

Initial action plan

StageTimeframeActivities to undertake
AnalysisWeeks 1-2Undertake source system analysis. Establish the most significant AI or analytics use case and analyse present data quality
Pipeline DevelopmentWeeks 3-5Develop pipelines for the key use case. These include validation, orchestration and oversight functionality.
Pipeline ValidationWeeks 6-7Compare pipeline data with source systems. Address discrepancies. Train the responsible team.
DeploymentWeek 8Deliver the solution, together with oversight functionality and a pipeline development backlog for the subsequent use case.

Developing pipelines in this staged, use case driven manner ensures continued business relevance. Moreover, components are progressively developed for re-use meaning that substantially less time is spent on pipeline two and three in comparison to pipeline one.

For over 25 years, Swaran Soft has developed enterprise solutions. Almost all of our AI implementations – including HR agents and RBI and DPDP compliant financial automation – rest upon underlying data engineering functionality.

Going forward

Identify the single most important AI or analytics use case from an executive perspective. Then analyse all data sources underpinning it. Pay particular attention to those which currently require manual handling and/or lack validation. This forms your initial data engineering development backlog.

Want to talk it through with us? We run a free 45-minute AI Pilot Assessment. Drop a line to info@swaransoft.com, or ring +91 9220-313-650 (India) | +971-50-9292-650 (UAE). You'll find more at www.swaransoft.com

Common queries

Free 45-minute AI Pilot Assessment

Share this article:
Yogesh Huja — Founder & CEO, Swaran Soft
Yogesh HujaFounder & CEO

AI Architect and Entrepreneur building India's Edge AI ecosystem. 25+ years in enterprise technology. Founder of Swaran Soft, Gignaati, and Copilots.in.

Published: ⏱ 6 min read