"Tracking the number of orders per second using ksqlDB is very crucial to us, so we can monitor the use and health of the platform in real time."
Lucas Viecelli
Database Reliability Engineer, iFood
For more than 10 years, technology company iFood has mainly focused on meal delivery, serving more than 60 million orders every month in more than 1,200 cities across Brazil. Its vision is to revolutionize the world of food, providing customers with a more practical and pleasurable way of life. It seeks to accomplish this by developing more intelligent ways to efficiently and conveniently produce, sell, and bring dishes to the consumer’s table.
To forge a link between consumers, restaurants, and delivery services, iFood offers an online food delivery app/portal to customers where they can order food quickly with no hassles. On the back end, it’s supported by a cloud-based data infrastructure.
The challenges with batch pipelines
After early growth and rapid operations expansion in 2016, iFood realized it needed to scale and migrate its data center-hosted back-end operations to the cloud. Fluctuations in demand (e.g., the peaks at Sunday lunch and dinner time) also contributed to this decision, which could be addressed by the elasticity offered by the cloud.
iFood was also using a host of databases, services, and applications, which were all tightly coupled together, and batch pipelines to move between these systems. A simple error in any of the services affected other services; troubleshooting the source of the error was timeconsuming and ultimately brought their business to a screeching halt.
To solve these problems, iFood decided to adopt Apache Kafka®. Without sufficient resources and expertise to self-manage Kafka, iFood initially went with AWS Managed Streaming for Apache Kafka (MSK) to build streaming data pipelines to monitor orders and track delivery.
However, very quickly, the iFood team found themselves continuing to spend a lot of time managing Kafka despite being on Amazon’s cloud-hosted service. The data and platform engineering teams increasingly found themselves spending a majority of time performing operational tasks such as cluster sizing and capacity planning vs. focusing on higher value initiatives. Some of the challenges they faced included, but was not limited to, security authentication issues and manual Kafka software updates and bug patches. Ultimately, iFood decided to switch to Confluent Cloud, a fully managed cloud-native service for their Kafka projects.
Since then, iFood has built streaming data pipelines between 2,000 microservices, allowing the organization to fully decouple their legacy architecture and adopt an event-driven architecture.
They also expanded to a variety of other use cases. They built streaming data pipelines to a data lake on AWS to run analytics and machine learning algorithms. They also leveraged real-time data coming in from the geolocation of their delivery drivers to build tracking capabilities, so customers can track the status of their orders in real time. By leveraging ksqlDB, they can run stream processing on their real-time data streams to monitor the number of orders on iFood’s platform every second.
