Explanation

Trax compared with Quartz.NET and Hangfire

Checked on 2026-11-05 against Quartz.NET 4.7 and Hangfire 1.8.25. Corrections are welcome as issues.

All three run background work in .NET. They solve different problems.

Quartz.NET is a time-based job scheduler. Its strength is precise triggers: cron with seconds, calendars, daily time windows, time zones and daylight saving. Version 4.0 (September 2026, .NET 10 only) added retry policies, stored execution history, continuations, typed job input, an HTTP API and a dashboard. Version 3.x, without them, is still maintained for older frameworks. It is Apache-2.0.

Hangfire is a background job processor. Its strength is simplicity: pass a lambda, and the method runs in the background with retries, persistence and a mature dashboard. Hangfire is LGPL-3.0; batches, official Redis storage and throttling are in the paid Pro and Ace packages.

Trax's scheduler is one layer of a larger framework. It runs trains, chains of typed steps whose every run is recorded, on cron and interval schedules, and it needs the layers below it. The rest of Trax (an API, the operations console, state machines) is optional.

Scheduling

TraxQuartz.NET 4Hangfire
Cron5 or 6 fields (seconds)5, 6 or 7 fields (seconds, optional year)5 or 6 fields, or Cron.* helpers
Time zonesUTC onlyPer trigger, and a defaultPer recurring job
Daylight savingNot applicable: UTCCalendar-interval triggers keep the hour of dayCron in a chosen time zone, DST-aware
IntervalsEvery.Minutes(5)Simple, calendar-interval, daily-time-interval and fixed-delay triggersNo interval type: cron such as */5 * * * *
ExclusionsExclude.DaysOfWeek(), Dates(), DateRange(), TimeWindow()Calendars: holiday, weekly, daily, cron, annual, monthlyNo
Run a job now, with any inputITrainExecutionService.QueueAsync(...); TriggerAsync(externalId) for an existing scheduleTriggerJob(jobKey, input)BackgroundJob.Enqueue(() => ...)
Run once, laterScheduleOnceAsync(input, delay) or TriggerAsync(id, delay)ScheduleJob<TJob, TInput>(input, delay)BackgroundJob.Schedule(..., delay)
Missed runsPer schedule: FireOnceNow or DoNothing, past a thresholdMisfire instructions per trigger typeRelaxed, Strict or Ignorable per recurring job
Priority0 to 31 per group and per queued run; dependents get a boostPer trigger, compared only between triggers due at the same timeQueue order; honoured only with Pro's Redis storage
Pause a scheduleDisable a schedule or a whole group, in code or the consolePause and resume a trigger, a job, a group or everythingNot documented
Schedules removed from codeDeleted at the next startKept until you delete themKept until RecurringJob.RemoveIfExists
Many schedules at onceScheduleMany, IncludeMany, at startup or at runtimeScheduleJobs(...) in one transactionBatches in Pro (paid)

Trax evaluates every schedule and exclusion in UTC. A job that has to run at 9:00 in a local time zone, across daylight saving changes, is a better fit for Quartz.NET or Hangfire. A Trax schedule is picked up on the scheduler's next poll, every 5 seconds by default, so firings closer together than that are not precise. Queued work starts sooner: on PostgreSQL a notification wakes every dispatcher, with a 2-second poll behind it.

Composition

TraxQuartz.NET 4Hangfire
Unit of workA train (IServiceTrain<TIn, TOut>) made of Junction<TIn, TOut> stepsIJob, or IJob<TInput>Any public method
Steps inside a jobA chain of junctions; the first failure skips the restNone built inNone built in
Typed inputIServiceTrain<TInput, TOutput>IJob<TInput>; JobDataMap in 3.xCompile-time lambda arguments
Jobs that follow jobsInclude() and ThenInclude(): one parent per schedule; groups checked for cycles at startupStartAfter continuations with outcome conditions; one parent eachContinueJobWith; Pro batches add a continuation after a whole batch
A parent choosing its children at runtimeYes: dormant dependents, activated with input the parent choosesNoNo
"If nothing happens in 30 minutes"A state machine timer, stored and fired by the server, up to 366 days, which can start a trainA one-off triggerBackgroundJob.Schedule

A Quartz or Hangfire job is one method. A Trax train splits the same work into junctions, each its own class with its own dependencies and tests, and records which junction failed.

Persistence and history

TraxQuartz.NET 4Hangfire
DatabasesPostgreSQL; SQLite for a single process; in-memoryRAM, SQL Server, PostgreSQL, MySQL, Oracle, Firebird, SQLite (no clustering)SQL Server and in-memory; Redis in Pro (paid); PostgreSQL, MongoDB, MySQL, SQLite and Redis from the community
Run historyEvery run's state, timing, failing junction and exception; input and output too with SaveTrainParameters()A row per run with result, exception message and duration; input opt-in (4.4+)Every state change; the job's arguments and return value
After the last retryA dead letter in trax.dead_letter, acknowledged or requeued from the consoleThe trigger returns to its schedule, or pausesFailedState, kept until retried or deleted from the dashboard
RetentionYour trains' runs are kept until you add them to AddMetadataCleanup; resolved dead letters go after 30 daysA retention per result, 1 day by defaultSucceeded and deleted jobs expire; failed ones never do
Logs per runILogger output written to trax.log, tied to the run, readable in the consoleExecution log capture, capped (4.3)The community Hangfire.Console

Running on several servers

TraxQuartz.NET 4Hangfire
Several serversYes, on PostgreSQLYes, on a clustered database storeYes
CoordinationOne server evaluates schedules under an advisory lock; workers claim runs with FOR UPDATE SKIP LOCKEDNo leader: a database lock per trigger acquisition, check-ins to detect dead nodesDistributed locks and atomic queue fetch
CapacityGlobal MaxActiveJobs (10 by default) and a cap per manifest group, approximate across several hosts; workers per hostThread pool size, and execution-group limits per node or cluster (4.6+)Workers per server and per queue; semaphores in Ace (paid)
One run at a time per subjectFor queued work: one run per subject key at a time, across servers, the next chosen by priority then ageNot covered here[Mutex] in Ace (paid); [DisableConcurrentExecution] locks a whole method
Fair dispatchEach manifest group gets a share of every dispatch cycle, so a busy group cannot starve the restNot foundNot found
Work on other machinesHTTP runners, SQS or AWS Lambda, chosen per train, with signed requestsClustered nodes on a shared databaseServers sharing the storage
HostsThe console lists each host, its role, its slots in use and the runs it holdsNot covered hereNot covered here

Retries and failures

TraxQuartz.NET 4Hangfire
Automatic retryScheduled runs: 3 by default. A run queued on demand is not retried[RetryPolicy] or a default policy (4.4+)Every job: 10 by default
BackoffExponential: 5 minutes doubling to 1 hour by defaultFixed, exponential with cap and jitter, or a list(n-1)⁴ + 15 + random·n seconds, overridable
Stuck runsRecovered on startup; runs stuck Pending past 20 minutes or running past 60 are failed so retries applyRequestsRecoveryThe server watchdog requeues
Resume part-wayA retry or a requeued dead letter resumes after the train's last checkpoint; an operator can resume from a chosen stepNoNo
Repeat a run's choicesA retried or requeued run replays the branch decisions the original recordedNoNo
Which failures retryEvery failure retries; the failure's class is recorded (transient, conflict, permanent)Any exception retriesOnlyOn and ExceptOn filters

Cancellation

TraxQuartz.NET 4Hangfire
In job codeA CancellationToken through the train, its junctions and EF CoreCancellationToken on the job contextA CancellationToken parameter
From codeCancelAsync(externalId), CancelGroupAsync(groupId)Interrupt(jobKey)BackgroundJob.Delete(jobId)
On another serverBetween junctions, through a database flag (needs AddJunctionProgress())At the owning node's next check-in (4.6+)The job's state is polled every 5 seconds
From the UICancel a run or a whole groupInterrupt a running job (4.7)Delete
Recorded asCancelled, excluded from retries, dead letters and the success rateA Cancelled result (4.4+)DeletedState

Hooks and progress

TraxQuartz.NET 4Hangfire
HooksITrainLifecycleHook: started, completed, failed, cancelled, state changedJob, trigger and scheduler listenersClient, server and state filters
ProgressThe junction running now, by name, with AddJunctionProgress()A percentage and message, ReportProgressNo
Live updatesGraphQL subscriptions; SignalR and RabbitMQ broadcastersListenersSignalR through community packages

Dashboard

TraxQuartz.NET 4Hangfire
DashboardThe operations console at /trax/dashboard, served by the API hostBlazor at /quartz, or standalone; 3.x has noneBuilt-in middleware at /hangfire
APIGraphQL, opt-in per train with [TraxQuery] and [TraxMutation]An HTTP API at /quartz-apiCommunity extensions
ActionsRun or queue any train with new input; trigger, enable, disable or edit a schedule; cancel; requeue a run or a dead letter; resume from a checkpoint; change scheduler settings on every host without a restart; do any of these to everything a filter matchesPause, resume, trigger with overrides, interrupt, run again, backfill, a cron editorRequeue, delete, reschedule
Terminal and scriptstrax-console: the same lists and actions, and JSON lines for scriptsThe HTTP APINot found
A failureReason, failing junction, failure class and stack traceThe exception messageStack trace
NumbersExecutions per minute or hour, queue depth, success rate, each run's junction timelineRuns over time by result, median and p95 durationSucceeded and failed counts, queue depth
AccessRefuses to start until you choose RequirePolicy, RequireRoles or AllowAnonymousShell()Refuses to start until you choose RequireAuthorization() or AllowAnonymous()Local requests only, until you add an authorization filter

Security

TraxQuartz.NET 4Hangfire
Who may start a job over the API[TraxAuthorize] per train; a served train without it, or without [TraxAllowAnonymous], stops the hostView, Operate and Administer roles per schedulerNo API to start jobs
Remote workersA runner refuses to start without a signing key or an explicit opt-out; replayed requests are refusedNot applicableNot applicable
Audit of operator actionsEvery GraphQL request, bulk operations included, sent to an audit sink you writeA pause records its reason and userNot found

Developer experience

TraxQuartz.NET 4Hangfire
A first scheduled jobA train, a junction and a schedule, or dotnet new trax-schedulerA job class and its triggerOne line
Dependency injectionConstructor injection in trains and junctionsScoped jobs through the job factoryScoped services through JobActivator
TestingAn in-memory data provider; junctions tested aloneJobExecutionContextBuilder, a fake time providerReplace services in DI
Checked before the first runThe host refuses to start if a chain can never run, naming the step and the missing typeAnalyzers and a generator (4.2+)None
Health checkAddTraxSchedulerLiveness(): unhealthy once the dispatcher stops completing cyclesAddQuartz health checksCommunity packages
LicenceMITApache-2.0LGPL-3.0; Pro and Ace are paid

Hangfire has the least ceremony. Trax has the most: reaching a scheduled job means trains and junctions (Core), run recording (Effect), dispatch (Mediator) and manifests (Scheduler).

When to choose Trax

  • Scheduled work has phases. Extract, transform, validate and load become junctions, each testable alone and each named in the run record when it fails.
  • Schedules depend on each other. Parent and child schedules are declared at startup, groups are checked for cycles, and a parent can decide at runtime which dormant children run and with what input.
  • You need an audit trail. State, timing and failure details are recorded for every run once a data provider is configured, and SaveTrainParameters() adds input and output.
  • You run work in bulk. ScheduleMany and manifest groups with their own caps keep a thousand sync jobs from starving billing.
  • You want dead letters. A scheduled run that runs out of retries waits for a person instead of retrying forever.
  • Work for one record must not overlap. Queued work with the same subject key runs one at a time across servers.
  • Failed work should restart where it stopped. A retry or an operator resumes after the last checkpoint instead of rerunning steps that already called other systems.
  • Jobs run on Lambda, SQS or separate worker services. Each train is routed to a transport, and what is sent is signed.
  • Operators fix things in production. Edit schedules, pause them, run a train with new input, and requeue or cancel everything a filter matches, from a browser or a terminal.
  • Callers outside the process start jobs. Trains are GraphQL mutations with authorization per train, and the host refuses to start with one left unguarded.
  • You already use Trax. The scheduler runs the trains you have.

When to choose Quartz.NET or Hangfire

  • The job is "send this email in five minutes". Hangfire does it in one line.
  • Schedules follow a local clock. Trax evaluates cron and exclusions in UTC only.
  • Your database is SQL Server, MySQL or Redis. Quartz.NET covers SQL Server and MySQL, Hangfire covers SQL Server, and Hangfire Pro covers Redis. Trax runs on PostgreSQL, or SQLite for one process.
  • Every job needs retries, including ones started on demand. Hangfire retries every job; Trax retries scheduled runs only.
  • You want the lowest learning curve, or background work is a small part of the system.
  • You need OpenTelemetry tracing. Quartz.NET 4 emits spans and metrics; Trax does not emit spans.
  • You only need a scheduler. Trax.Scheduler needs Trax.Effect and Trax.Mediator under it. Quartz.NET and Hangfire stand alone.

Using them together

Trax does not need to own every background job in an application. Hangfire or Quartz.NET can keep the jobs they already run while trains take over the work that has internal structure. A Hangfire job or a Quartz IJob resolves ITrainBus and calls RunAsync with the train's input, so the run is recorded in Trax like any other, while the outer library keeps its own trigger, retry and dashboard. Trax's own retries, dead letters and misfire rules do not apply to those runs, since they are not Trax schedules, and a Hangfire retry reruns the whole train. Use ITrainExecutionService.QueueAsync instead of RunAsync to queue the run rather than run it inline.