# Introducing Simplekiq: A Lightweight Orchestration Framework for Ruby

DevFeed: [Introducing Simplekiq: A Lightweight Orchestration Framework for Ruby](<https://devfeed.tech/articles/introducing-simplekiq-a-lightweight-orchestration-framework-for-ruby-20033.md>)

Original publisher: [Read original article](<https://technology.doximity.com/articles/introducing-simplekiq-a-lightweight-orchestration-framework-for-ruby>)

Author: Doximity

Published: 2023-05-03T11:28:00Z

Content type: article

Language: en

Sources: [Doximity](<https://devfeed.tech/sources/doximity.md>)

Topics: [Orchestration](<https://devfeed.tech/topics/orchestration.md>), [Sidekiq](<https://devfeed.tech/topics/sidekiq.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Framework](<https://devfeed.tech/topics/framework.md>)

Tags: [declarative](<https://devfeed.tech/tags/declarative.md>), [orchestration](<https://devfeed.tech/tags/orchestration.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [sidekiq](<https://devfeed.tech/tags/sidekiq.md>), [workflow](<https://devfeed.tech/tags/workflow.md>)

## AI overview

The article introduces Simplekiq, a lightweight Ruby workflow framework built on Sidekiq Pro batching. It presents declarative, single-file orchestrations with serial and parallel execution as a way to make complex background-job workflows easier to understand, diagnose, and refactor.

## Source excerpt

Sidekiq is an amazing background job framework for Ruby with a long history of the best kind of minimalism - one of performance and succinctness. However, a downside of this is that long workflows built from dozens of background jobs queueing subsequent background jobs can be difficult to consistently design and maintain. We especially struggled with refactoring these types of structures since one has to read through all the code for the jobs to understand when and from where each job might get queued. The added complexity of manually defining Sidekiq Pro batches leads to difficult-to-diagnose triage in more creative workflows, especially when batch callbacks are involved. Introducing Simplekiq: A Solution to Our Challenges We solved our issue by building Simplekiq (special thanks to Daniel Pepper for freeing the rubygems simplekiq name for us) --a lightweight background job workflow framework built on top of Sidekiq Pro batching. Simplekiq solves the issue of having to follow long chains of jobs that queue other jobs ad nauseam. Workflows that span many files and job classes are inherently difficult to understand, diagnose and refactor. Simplekiq flattens out these complex, multi-file workflows into declarative, single-file ones which we call orchestrations. Each orchestration can contain a mix of serial and parallel execution so that even the most complex workflow can be expressed in an efficient, readable syntax. Comparing Sidekiq Pro and Simplekiq with an Example It's easier to demonstrate this with an example: making an apple pie. The late, great Carl Sagan taught us that to make an apple pie from scratch we must first invent the universe. That's a bit out of budget for most bakeries, but in the spirit of simplicity let's explore how a workflow for baking an apple pie from basic ingredients looks in standard Sidekiq Pro structures and compare it to the flattened Simplekiq paradigm. Our example will also show how refactoring differs between the two. Implementing