Skip to main content

Design Philosophy

Tasks can exist in many forms and shapes, and the main purpose is to facilitate asynchronous programming models.

Some use-cases:

  • The API executes the critical path (e.g., accepting an order), and one or more tasks are created to offload work (e.g., creating order confirmation PDF, sending confirmation emails, etc.).
  • A service accepts a video upload and creates a task to process the video.
  • Services create tasks to run aggregation jobs that can last for hours.
  • And more.

Taskurai provides a structured way to create and follow up on tasks.

For a good user experience, it is recommended to quickly accept requests and provide feedback to the end-user that the task is in progress:

  • Your order has been received. You will receive an email with the order confirmation.
  • Show a progress spinner (using the progress reports on the task).
  • Report progress in a status menu but allow the user to continue with their work.
  • And more.

Message Driven Architecture

Taskurai follows a message-driven architecture, serving as a central hub for processing and managing asynchronous tasks. By leveraging messages as a means of communication, Taskurai enables loose coupling and improves system resilience. It allows you to create tasks, define dependencies, and track progress while maintaining coordination and control.

In Taskurai's message-driven system, the initiating process creates tasks and invokes corresponding commands in Taskurai. These tasks share a standardized envelope, simplifying their central tracking and management. Unlike event-driven architectures that may have varying envelope structures, Taskurai ensures consistency, facilitating monitoring and coordination.

Taskurai's asynchronous communication promotes efficient task processing without the need for immediate completion. While awaiting task completion is possible, Taskurai emphasizes async feedback by encouraging the use of messages or asynchronous UI updates. This approach enhances user experience and allows for scalable and responsive handling of time-consuming tasks. Tasks can be processed in parallel, leveraging the defined scale for each worker.

Taskurai's primary focus is on offloading non-critical path tasks from services that handle critical path operations, such as storing order requests in the database and providing quick responses to end-users. By seamlessly handling the execution of asynchronous tasks, Taskurai enables services to prioritize critical path operations while ensuring timely and asynchronous feedback to end-users via UI updates, emails, messages, or other channels.

Taskurai strikes a balance between coordination and scalability. While tasks can be processed in parallel and at scale, Taskurai maintains task coordination and progress tracking, ensuring efficient execution and management.

Moreover, Taskurai empowers tasks to create additional tasks, forming a hierarchical structure that reflects complex workflows. This capability enhances system flexibility and extensibility as tasks orchestrate and coordinate the execution of related subtasks. The hierarchical relationship between tasks allows for managing dependencies and ensuring the smooth flow of business processes.

While Taskurai shares some similarities with event-driven architectures, its focus on single-receiver tasks and hierarchical task structures sets it apart from traditional pub-sub models. Taskurai's approach provides a balance between centralized coordination and scalability, harnessing the benefits of both granular task execution and efficient task management. By embracing Taskurai's unique task-oriented approach, you can build robust and flexible systems that handle complex workflows while maintaining control, coordination, and scalability.

Uniform Envelope

Taskurai employs a uniform task envelope to facilitate development and support by various stakeholders, including developers, help desks, and service desks.

Containers

Tasks are handled by workers running in normal containers, allowing you to leverage the full power of your programming language and reuse existing libraries. Taskurai enables tasks to run for as long as needed, unrestricted by function or lambda limitations. The platform offers elasticity comparable to other serverless solutions, scaling from zero to a large set of parallel workers and commands.

Monoliths or Microservices

Many services and applications begin as monoliths, but maintaining and operating them can become challenging and costly over time.

While microservices can be a beneficial pattern, transitioning to a microservices architecture can introduce design, maintenance, and operational complexities.

In most cases, it's not necessary to start from scratch; instead, separating distinct parts of the monolith into separate services can make the existing service leaner. This approach involves moving out services that may cause scaling or stability issues, such as those relying on resource-intensive libraries, prone to memory leaks (e.g., PDF generation), or handling non-critical path tasks that slow down API requests, among others.

New Applications or Refactoring

Taskurai is suitable for both new projects and refactoring old monolithic applications.

For most applications and businesses, we recommend starting with a single API service and combining this pattern with offloading tasks to dedicated services. This approach has proven to be easy to maintain and provides scalability in many cases.