Skip to main content

d-cron

Distributed Cron Scheduler for Go powered by PostgreSQL Advisory Locks. Zero extra tables, zero daemons, 100% split-brain safe.

$ go run main.go
[INFO] Connecting to PostgreSQL advisory lock engine...
[INFO] Key=84920491 TryLock() -> LEADER ELECTED (Epoch=1, Node=pod-01)
[INFO] Registering job: cleanup-temp-files cron="0 */6 * * *"
[INFO] Triggering job: cleanup-temp-files [epoch=1] [duration=42ms] [status=SUCCESS]

Everything you need for distributed job scheduling

A complete production-ready cron engine designed specifically for scaled Go applications.

Zero New Infrastructure

Uses standard PostgreSQL session-bound advisory locks. No Redis clusters, no etcd, no sidecars, and no extra deployment daemons.

Single Leader Scheduler

Only 1 active Leader node runs the timer clock across all scaled container replicas. Zero database thundering-herd lock spikes.

Split-Brain Fencing Tokens

Passes strictly increasing monotonic LeaderEpoch tokens in job context to fence stale database writes during network partitions.

Zero Migration Default

Advisory locks live in Postgres memory structures. Default operation requires zero database tables and zero DDL migrations.

In-Process Go Functions

Register standard Go functions directly with scheduler.Add. No JSON payload serialization or worker queue decoupling required.

Built-in Observability & UI

Embedded Web Dashboard UI, Prometheus metrics exporter, OpenTelemetry distributed tracing, and REST admin API out of the box.

Ready to simplify your background jobs?

Get started in under 2 minutes. Install d-cron into your Go project today.

Read Documentation