Building a scalable backend for SmartLunch’s meal-ordering service

Here’s how SmartLunch streamlined its meal-ordering service using Redpanda as a plug-and-play replacement for Apache Kafka®.

By
on
February 21, 2023

Nobody performs at their best when they’re hungry. Feeling hunger at work dulls your concentration, lowers your energy levels, and sours your mood as you struggle to focus on your tasks and not on your rumbling stomach. It’s also proven that hunger leads to stress, which can change your behavior and negatively affect your decision-making abilities.

At a desk job, this can just mean missing an important email or ignoring a coworker’s incessant messages. But if you work in the medical field, construction, a factory, or a warehouse—an ill-made decision can have serious consequences. This is why many factory and warehousing companies want to offer substantial meals for their workers. However, the high cost of building an entire cafeteria is a major obstacle.

This is where SmartLunch comes in.

Meet SmartLunch

SmartLunch is a platform that makes it simple and affordable for large-scale warehouses and factories across Poland to offer meals to their workers—without the burden of building an on-site cafeteria.

In short, SmartLunch provides client companies with an on-site kiosk, which employees can use to order their meal from a list of local restaurants. Once the employee places their order, the local restaurant then delivers the food directly to their workplace.

This may sound just like your average food delivery service that’s already available in big cities, but most warehouses and factories are located in far-flung areas—where deliveries are scarce and internet connections can be slow or intermittent. For that reason, SmartLunch has designed its kiosks to work on limited connections and can even process orders while offline so no employee goes hungry.

What’s more, since employers save what they’d spend on building a costly cafeteria, they can use a percentage of those savings to cover over 60% of the employee’s meal instead. As a result, employers love SmartLunch because it’s cost-effective, and employees love it because they pay less than half the price for their meal.

Although if your platform is standing between a hungry employee and their meal order, the technology behind it better be quick. Keep reading to find out how SmartLunch made meal-ordering faster and easier for over 500 companies (and thousands of employees) by simply adding Redpanda to its software architecture.

The problem: handling an overly-complex architecture

Let’s touch on the architecture powering SmartLunch. In the simplest terms, the meal-ordering architecture consists of a kiosk, a message queue, and a main server.

Diagram of old SmartLunch architecture using Kafka and ZooKeeper for the message queue.

In this architecture, when an employee uses a SmartLunch kiosk to place a meal order, that order is added to the queue and then sent to SmartLunch’s main server. If the kiosk is offline, the order is stored in the queue until the internet connection is reestablished, then is sent to the server. Note that the queue plays an essential role in this system as it prevents any meal orders from getting lost if the internet connection drops.

So, what was the problem? Originally, SmartLunch relied on Apache Kafka® and ZooKeeper® to handle its queue. However, system admins found they were spending too much time configuring the software and managing certifications. It was clear we needed a much better and simpler solution, so we began the hunt for a different queuing system.

Although during our search, we realized that replacing the current queuing technologies—or removing our complex queuing system altogether—would mean rewriting all the code that controls how orders are sent to the server. What we really needed was a drop-in replacement that would spare us from hours of setup, as well as excessive ongoing maintenance and monitoring.

The solution: replacing Kafka with Redpanda

Once we landed on Redpanda and found it was API-compatible with Kafka, the decision to switch over practically made itself. It’s simple to use, 10x faster than Kafka, and also easily scalable—an important feature as SmartLunch grows.

The biggest advantage was that Redpanda “just worked” with our existing architecture. We didn’t have to change a single line of code. We were able to keep our backend, where we use Karafka—a Kafka framework that simplifies Ruby and Ruby on Rails app development—to create topics, and the Kafka API worked with Redpanda to efficiently manage our queue.

Diagram of new SmartLunch architecture using Redpanda to handle the message queue.
Diagram of new SmartLunch architecture using Redpanda to handle the message queue.

Now, we don’t need to spend time tediously maintaining and updating Kafka and Zookeeper— Redpanda handles it all for us. As for the overall cost of adding Redpanda, it was significantly lower than the cost of leaving our complex system as it was, plus the time and resources spent on maintaining Kafka and ZooKeeper.

As far as the SmartLunch team is concerned, Redpanda’s “plug-and-play” nature offers a unique simplicity that lets us sleep better at night.

Conclusion

More than 500 companies across Poland use SmartLunch to provide co-funded meals to keep their employees happy and productive. By integrating Redpanda into our architecture, we were able to:

  • Simplify our queuing system without changing a single line of code
  • Relieve our team from the operational burden of maintaining Kafka and ZooKeeper
  • Free up time and resources to better focus on high-value business goals—like expanding to other countries!

To learn more about SmartLunch and how it works, visit the SmartLunch website. You can also read more Redpanda case studies across various industries, or dig into their documentation. If you have a similar need for speed and want to try Redpanda as a drop-in Kafka replacement, get in touch and a Redpanda expert will lead the way.

Graphic for downloading streaming data report
Save Your Spot
How Zafin is modernizing banking with Redpanda
Shahir Daya
&
&
&
June 4, 2024
Text Link
Going real time in AdTech: a batch-to-streaming journey
Abhishek Jain
&
&
&
December 5, 2023
Text Link
Accelerating real-time alerts with Redpanda: a successful migration story
Eric Laguer
&
&
&
November 14, 2023
Text Link