Dagu vs Prefect

अगर आप Python लिखे बिना orchestration चाहते हैं, तो Dagu देखें।

Prefect उन data teams के लिए Python framework है जो अपने flows code में लिखती हैं। Dagu एक single binary है जो declarative YAML से आपके मौजूदा commands को call करता है, और चलाने के लिए कोई database नहीं रखता। यह पेज दिखाता है कि flows को Dagu पर ले जाने पर क्या बदलता है।

Commands call करने वाला workflow, बिना decorator
# etl.yaml
schedule: "0 6 * * *"
 
steps:
  - id: extract
    run: python etl/extract.py --since=yesterday
    output: RAW_PATH
 
  - id: transform
    run: python etl/transform.py ${RAW_PATH}
    retry_policy:
      limit: 3
      interval_sec: 60
    depends: [extract]
 
  - id: load
    run: python etl/load.py --target=warehouse
    depends: [transform]

Execution order

extracttransform3 retriesload

Workflows Python code नहीं, declarative YAML हैं

File-backed state वाला single binary

कोई external database या message broker नहीं

shell, Docker, HTTP, SSH, SQL, sub-workflows और Agent Harness steps के लिए executors

At a glance

Dagu vs Prefect एक नज़र में

Authoring
Dagu

Commands call करने वाला declarative YAML।

Prefect

@flow और @task decorator वाले Python functions।

Runtime
Dagu

File-backed state वाला single binary।

Prefect

Prefect server और एक database, अलग workers के साथ।

Best fit
Dagu

छोटा self-hosted runtime चाहने वाले script, container और ops automation।

Prefect

flows को code के रूप में लिखने वाली Python-केंद्रित data teams।

In depth

How Dagu does it

01

Python framework नहीं, declarative YAML

Prefect काम को @flow और @task decorator में लिपटे Python functions के रूप में मॉडल करता है, इसलिए workflow आपके codebase के अंदर रहता है। Dagu हर step को command ही रखता है और उसके चारों ओर scheduling, retries और dependencies को YAML में जोड़ता है।

  • ऐसे steps परिभाषित करें जो shell, Docker, HTTP, SSH, SQL या sub-workflows चलाएँ
  • जो Python नहीं लिखते उन operators के लिए भी workflow पठनीय रखें
  • जिन scripts को call करता है उनके साथ YAML को git में रखें
02

File-backed state वाला single binary

Production का Prefect setup, Postgres जैसे database पर टिका एक Prefect server और flows चलाने वाले workers चलाता है। Dagu single binary के रूप में आता है और run history, logs तथा queue state को local filesystem पर रखता है।

  • एक download से शुरू करें, कोई database तैयार किए बिना
  • Files और एक binary संभालकर backup और upgrade करें
  • ज़रूरत पड़ने पर local runs से queue-based या distributed workers तक बढ़ें
03

Dagu हर step के चारों ओर क्या जोड़ता है

हर run के per-step logs, retries और history web UI में रहते हैं, और Dagu Cloud एक console से हर server पर नज़र रखता है।

  • steps के बीच outputs भेजें, और runtime पर मिले items पर parallel से fan out करें
  • किसी process को घेरे बिना run को approval या human task के लिए रोकें
  • Dagu Console से failed runs, चूकी हुई deadlines और अपने सामान्य समय से बहुत आगे निकल चुके runs के alerts पाएँ

FAQ

Practical questions before adopting Dagu

क्या Dagu, Prefect की जगह ले लेता है?

हाँ। हर task एक step बन जाता है जो वही Python script, container या service call चलाता है, और Dagu बिना किसी database के schedules, retries, logs, history और web UI जोड़ता है। Dynamic fan-out, runtime पर मिले items पर parallel से होता है। अगर आप Prefect के किसी ऐसे feature पर निर्भर हैं जो Dagu में नहीं है, तो dagu.sh/contact पर उसका अनुरोध करें।

क्या मैं बिना Python लिखे Dagu इस्तेमाल कर सकता हूँ?

हाँ। Dagu workflows commands call करने वाला YAML हैं। कोई step आपका मौजूदा Python script चला सकता है, पर orchestration layer को खुद कोई Python या framework import नहीं चाहिए।

Prefect की तुलना में Dagu को कौन-सा infrastructure चाहिए?

Dagu को एक binary और एक filesystem चाहिए, क्योंकि state file-backed है। एक सामान्य Prefect deployment, database वाला server और एक या अधिक workers चलाता है। Dagu उन machines पर चलता है जिन्हें आप host करते हैं। Dagu Cloud इन servers के लिए console जोड़ता है, लेकिन आपके workflows कभी नहीं चलाता।

Next step

Start with one workflow.

Install Dagu, move one fragile script or agent task into YAML, and decide from a real run history.