Additional projects

Basalt.NET

Applications need durable background work with local storage or a shared SQL Server queue.

A .NET durable job, scheduling and static-workflow engine with embedded storage or SQL Server backends, retry and idempotent enqueue, leases, fencing, crash recovery and a separate WPF management dashboard.

Developmentv1.1.0MITC#
Last verified
2026-09-18
Platform / runtime
.NET 8; .NET Framework 4.7.2 / WPF consumer support; Embedded or SQL Server
01 / DURABLE EXECUTION

Persist intent before running a handler

Basalt is an in-process .NET job engine. The application hosts the runtime and workers; a separate job server is not required. A successful enqueue means durable submission, not completed execution.

01 · APPLICATIONEnqueue typed joboptional stable idempotency key
→
02 · PROVIDERPersist executionEmbedded files or SQL Server
→
03 · WORKERLease and invoke handlerregistered in the executing process
→
04 · STATERecord outcomecomplete, retry or recover

Basalt's documented delivery contract is at least once. A process can fail after an external side effect but before durable acknowledgement; the handler may run again. External operations therefore need idempotency or a fencing mechanism accepted by the external resource.

02 / OWNERSHIP AND RECOVERY

Leases make abandoned work recoverable

A worker claims an execution under a bounded lease and renews ownership while handling it. If the lease expires, another worker may recover the execution. Ownership changes produce a fencing token; handlers can pass JobContext.FencingToken to an external system that supports rejecting stale owners.

Embedded storage uses BasaltDB WAL and durable files. SQL Server storage uses transactional rows, leases, compare-and-swap revisions and fencing in the configured schema. The provider changes the persistence mechanism; it does not change the public at-least-once contract.

Unknown commit. When submission outcome is uncertain, retry the identical job with the same idempotency key. Generating a new key can create a separate receipt.
LEASE LIFECYCLE
claim execution
↓
renew while handler runs
↓
acknowledge or schedule retry
↘
lease expires → eligible recovery
03 / STORAGE PROVIDERS

Local ownership or a shared SQL queue

EMBEDDED

One application or machine

Basalt stores its durable state in an application-owned writable directory. The application hosts the workers and handlers. This path avoids operating a separate service, but the directory and its storage lifecycle belong in the deployment plan.

using var basalt = Basalt.Embedded(@"C:\data\jobs");
SQL SERVER

Multiple processes share work

SQL Server coordinates a shared queue through the configured schema. Every process that executes jobs registers the matching handlers and starts the Basalt runtime. SQL Server storage is not a standalone worker service.

using var basalt = Basalt.SqlServer(connectionString);
SAME API

Keep job code provider-neutral

The documented API lets applications select the persistence provider while retaining the job registration and handler model. Provider deployment, schema access and operational ownership still differ.

04 / TIME-BASED WORK

Scheduling policy is persisted with the work

Basalt documents delayed, interval, daily and cron schedules. Cron scheduling supports timezone, overlap and misfire policies. Scheduling recurrence is a distinct concept from retries: retries handle a failed execution; a schedule creates work according to its recurring policy.

C# · CRON POLICY
await basalt.ScheduleAsync(
    "nightly",
    new BackupJob(),
    schedule => schedule
        .Cron("0 2 * * *")
        .InTimeZone("Central Europe Standard Time")
        .OnOverlap(OverlapPolicy.Skip));

Retry policy is persisted with the execution. Documented strategies include fixed, linear, exponential and exponential-with-jitter. MaxAttempts includes the initial attempt.

05 / STATIC WORKFLOWS

Declare a durable DAG up front

Workflow definitions are static directed acyclic graphs with named steps, explicit dependencies and dependency-failure policies. They describe known orchestration, rather than arbitrary runtime graph mutation.

Invoice workflow dependency graphCreate invoice precedes send invoice, which precedes customer notification. Basalt persists the static workflow and its execution state.CREATE INVOICESEND INVOICENOTIFY CUSTOMER
  1. Create invoice
  2. Then send invoice
  3. Then notify customer
06 / OPERATIONS AND INSPECTION

Runtime management stays behind the API

The management and monitoring surface exposes health, queues, executions, failures, schedules, workflows, workers and cumulative statistics. BasaltDashboard is a separate WPF management console. Its documentation says it uses the storage-neutral public Basalt API rather than reading Embedded files or SQL Server tables directly.

Repository evidence includes CI workflows, core and SQL Server projects, test suites and consumer smoke projects. Build or test claims should be read from the current repository workflow/status, not inferred from the presence of those checks.

Browse the Basalt documentation

07 / DELIVERY LIMITS

At least once shapes application design

  • Handler invocation can repeat after a crash, lost acknowledgement or expired lease.
  • External side effects need idempotency or an external fencing check; a Basalt fencing token cannot protect a system that ignores it.
  • Each process that executes shared SQL work must host the runtime and register relevant handlers.
  • BasaltDashboard is a separate WPF consumer and has its own runtime/platform requirements.
  • Durability guarantees depend on the selected provider and its storage environment.

Independent Systems · All products