Using AWS EventBridge + Lambda to handle auction timeline.

Dushant Singh
CARS24 Engineering Blog
3 min readSep 28, 2023

In the world of car auctions, timing is everything. Ensuring that each auction ends precisely when it’s supposed to is crucial to maintaining efficiency and customer satisfaction. However, as the scale of our operations grew, we encountered a significant challenge with our traditional cron-based system. This prompted us to explore more scalable solutions, eventually leading us to adopt AWS EventBridge Scheduler. In this blog post, we’ll delve into how this transition revolutionised our auction timeline management.

The Cron-Based Conundrum

For years, we relied on cron jobs to manage the timelines of our car auctions. While it served us well initially, we soon found it struggling to cope with the increasing number of auctions we were handling. The crux of the problem lay in the synchronisation of over a thousand auctions that were supposed to end simultaneously.

Scaling Challenges

One of the primary limitations of our cron-based system was its inability to scale effectively. When hundreds of auctions were slated to conclude at the same moment, our servers would often struggle to handle the concurrent load, resulting in performance issues and, at times, auctions running over their allotted time.

AWS EventBridge Scheduler: A Game-Changer

To address these challenges and provide a more robust solution for managing our auction timelines, we turned to AWS EventBridge Scheduler. This cloud-based event-driven system allowed us to orchestrate the conclusion of auctions with precision and scalability.

  1. Independent Schedulers for Each Auction

In the AWS EventBridge Scheduler approach, we adopted a microservices-like architecture. Instead of relying on a single monolithic scheduler, we created independent schedulers for each auction. Each scheduler was configured to trigger events at the exact time an auction was supposed to end.

2. Event Bus and Rules

The heart of our solution is the AWS Event Bus, which acts as a central communication channel. When an auction’s dedicated scheduler pushes a message into the event bus, it becomes available for processing. Rules defined within the EventBridge then come into play.

3. Independent Targets

One of the key advantages of EventBridge is its support for multiple independent targets for each rule. For us, this meant that each auction could have its own set of actions triggered at the designated endpoint. These actions could include invoking AWS Lambda functions or sending data to an API destination.

Utilizing AWS Lambda Functions

In our setup, we utilized AWS Lambda functions as the primary mechanism for executing actions when an auction concludes. These serverless functions are highly scalable and can be invoked in real-time when an event occurs.

  • Marking Auctions as Over

When the event corresponding to an auction’s conclusion is triggered by EventBridge, it invokes the associated Lambda function. This Lambda function, in turn, communicates with our services to mark the individual auction as “over.” This process ensures that each auction ends precisely when it’s supposed to, without any delays or hiccups.

Benefits of AWS EventBridge Scheduler

The transition to AWS EventBridge Scheduler has brought about several notable benefits for our car auction platform:

  1. Scalability: With independent schedulers and serverless Lambda functions, we can effortlessly handle a large number of auctions, even when they conclude simultaneously.
  2. Reliability: AWS EventBridge offers high availability and durability, reducing the risk of downtime or disruptions in our auction timelines.
  3. Flexibility: The ability to define custom rules and targets for each auction allows us to tailor our solution to different auction types and scenarios.

Conclusion

In the fast-paced world of car auctions, timing is a critical factor that can significantly impact success. Our transition from a cron-based system to AWS EventBridge Scheduler has not only resolved scalability issues but also elevated the reliability, and flexibility of our auction timeline management.

As we continue to leverage the power of AWS services, we are confident that our customers will enjoy a seamless and efficient auction experience, with auctions concluding precisely when they should, regardless of the scale of our operations.

--

--