India’s Leading Domain & Web Hosting Provider
Agritech marketplace moves 14 file-based integrations to events and speeds farmer payouts
Marketplace buying from 85,000 farmers through 260 collection centres and selling to processors and modern retail · AWS Mumbai · 13 weeks
As-is situation
Fourteen integrations moved data over SFTP and database links: collection-centre weighbridge files, quality-lab results, warehouse stock, an ERP for invoicing, a payments partner and two buyer systems. Cron scripts on a single EC2 instance moved files hourly or nightly. Farmer payouts depended on weighbridge and quality data reaching the ERP, so whenever a file failed, payments slipped by a day or more. Finance staff found failed files about 11 times a month, and 9% of farmer grievance calls concerned late payment.
- Weighbridge-to-ERP data lag of 2-14 hours through hourly and nightly file drops
- Failed files discovered by finance staff about 11 times a month
- One EC2 cron host running all 14 integrations as a single point of failure
Approach, tools and architecture
NTSPL defined six business events (lot weighed, quality graded, lot accepted, stock moved, invoice raised, payout released) with schemas in the EventBridge schema registry. Collection-centre apps publish through an outbox; the ERP database is captured with AWS DMS CDC into Kinesis, and EventBridge Pipes maps changes to events. Each consumer, from ERP to the payments adapter and buyer feeds, has its own SQS queue and DLQ. A Step Functions workflow releases each payout once weight, grade and acceptance events for a lot have all arrived. Buyers still on files receive them through AWS Transfer Family.
Implementation approach
Measured results
Operational improvements
- Operations replay a failed lot event from the DLQ console instead of re-sending files
- A new processor buyer was connected in five days by subscribing to existing events
Cost considerations
Services cost INR 39 lakh. Event, queue, CDC and workflow charges run about INR 48,000 a month, including the DMS replication instance, and both the cron EC2 host and its standby server were retired after the final cutover.
Return on investment
Same-day payouts improve farmer loyalty to collection centres; the company values each 1% gain in farmer retention at about INR 1.2 crore of annual procurement margin. Finance also stopped spending about 60 hours a month chasing failed files.