SOFTWARE ENGINEERING · INSIGHTS

Building a Scalable Task Scheduler Microservice

How we evolved task management into a dedicated scheduling service with Node.js, AWS SQS, and MongoDB.

DevRabbit Insights · 4 min read
Software developers collaborating on source code at their office workstation

From Task Management to a Scalable Platform

In today’s fast-paced business environment, efficient task management has become a key factor in ensuring organizational success. Companies are constantly looking for ways to optimize their workflows, enhance productivity, and reduce operational inefficiencies. Recognizing this need, we embarked on the development of a task management system that could streamline these processes and help organizations stay ahead in a competitive landscape. What started as a basic tool for managing simple tasks has grown into a robust platform that can handle intricate scheduling, allocation, and task-tracking needs.

Initially designed with a specific focus on the restaurant industry, our system was built to meet the unique operational demands of fast-paced service environments. Restaurants, with their ever-changing schedules and the need for real-time task tracking, provided the ideal foundation for the development of our platform. As we gathered user feedback and gained a deeper understanding of their challenges, we expanded the system’s capabilities to accommodate a broader range of business sectors. The system is now versatile enough to support various industries, such as retail, hospitality, healthcare, and even project management, making it a valuable tool for any organization.

One of the core strengths of our task management system is its adaptability. Although the restaurant industry was our starting point, the platform’s ability to scale and adjust to different business models means that companies across diverse sectors can benefit from its functionalities. Features such as real-time task updates, customizable workflows, team collaboration, and automated reminders can be tailored to fit the specific needs of any industry. This adaptability ensures that our system not only meets the demands of today’s business world but also evolves with the changing needs of organizations as they grow and face new challenges.

Evolving the Platform Through User Feedback

Our journey began by implementing basic task creation and assignment functionalities, laying the groundwork for a streamlined process. As we gathered valuable user feedback and closely observed operational requirements, we identified opportunities for enhancement. This led to the expansion of our system, incorporating several key features to improve task management. Among these additions were geolocation-based task completion verification, ensuring tasks were completed in the correct location, and file attachment support during task creation, allowing users to upload necessary documents for context. We also introduced a feature for users to upload completion evidence, further validating task fulfillment. The addition of an interactive comments section enabled seamless collaboration among team members, fostering better communication. Lastly, task templating was implemented to enhance efficiency by providing predefined task structures, reducing the time spent on repetitive assignments.

Illustration of a task-planning board, calendar, reminders, and a person managing assignments
Task scheduling, collaboration, and completion tracking in one adaptable platform.

A Dedicated Scheduler Microservice

As our platform matured, we recognized the growing demand for sophisticated scheduling capabilities. Users needed the ability to schedule tasks for future execution and set up recurring tasks. Rather than integrating scheduling directly into our existing system, we opted for a microservice architecture. This approach ensures better scalability and allows other modules to leverage the scheduling functionality independently.

The Technical Stack

Our scheduler microservice is built on a robust technical stack:

  • Node.js with Express for the service layer
  • AWS SQS for reliable message queuing
  • MongoDB for flexible data storage

The choice of MongoDB was strategic, considering our need to handle unstructured data and support high-volume write operations efficiently.

Four Core Scheduler Components

Our scheduling system consists of four primary components:

01

Scheduler Service

Handles initial schedule validation and queue management

02

Processor Worker

Manages business logic and calculates next schedule times

03

Polling Worker

Operates on 5-minute intervals to retrieve and process due schedules

04

Task Execution Worker

Manages the actual execution of scheduled tasks

RESTful Scheduling Endpoints

The scheduler microservice exposes four RESTful endpoints:

MethodEndpointPurpose
POST/scheduler-service/v1/scheduleCreates new schedules
PUT/scheduler-service/v1/schedule/:scheduleIdUpdates existing schedules
GET/scheduler-service/v1/schedule/:scheduleIdRetrieves schedule details
DELETE/scheduler-service/v1/schedule/:scheduleIdRemoves schedules

Accurate Scheduling Across Time Zones

One of the crucial aspects of our scheduler is its robust handling of different time zones. We leverage JavaScript's Intl global object and the Luxon package to ensure accurate schedule execution across various geographical locations.

Scaling for Different Scheduling Volumes

For organizations with lower scheduling volumes, we've also designed a simplified architecture using a single queue. While this approach reduces complexity, it's important to note that it may require adjustment as scheduling demands grow.

The development of our scheduler microservice represents a significant step forward in our task management capabilities. By separating scheduling concerns into a dedicated microservice, we've created a flexible, scalable solution that can adapt to various business needs while maintaining high reliability and performance.

Ready to Build Software That Scales?

Connect with DevRabbit to explore scalable services and smarter workflows for your business.